Up to now `eslint-plugin-brace-rules` was used to enforce a common brace
style for JavaScript code. This plugin was however updated the last time
over 9 years ago and will be incompatible with ESLint v10, as that
[removes `context.getSourceCode()`][1], the plugin relies on.
To keep the eslint config working with ESLint v10, this replaces
`eslint-plugin-brace-rules` with the [`@stylistic/brace-style`][2] rule
from `@stylistic/eslint-plugin`, a package we already use.
While `@stylistic/brace-style` doesn't offer an option to format braces
in exactly the same way as before, the "allman" style seems to be the
one closest to the existing code.
[1]: https://eslint.org/blog/2025/11/eslint-v10.0.0-alpha.0-released/#removed-deprecated-rule-context-members
[2]: https://eslint.style/rules/brace-style
With v3.12.0 shfmt changed the behavior of the `--simplify` option to
ignore any EditorConfig when it's provided. Therefore, this option is
now moved to the EditorConfig as suggested by the shfmt author. See
https://github.com/mvdan/sh/issues/1173 for details.
Some have their editor configured to remove trailing whitespace and
editing such a file would "fix" it, adding an unrelated change.
Fix whitespace violations excluding third party libs and generated files
like glad or patches.
Enable pre-commit hook trailing-whitespace to enforce it in the future.
Fixes: #8016
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
During the eslint 8 cycle the formatting rules were split out [1],
deprecating the corresponding rules in core.
This replaces all rules that where moved to @stylistic/eslint-plugin [2]
and accounts for the difference in the indenting rule behaviour.
To allow the pre-commit import hack to continue to work with the
stylisitc plugin for a recent nodejs version to be used.
[1] https://eslint.org/blog/2023/10/deprecating-formatting-rules/
[2] https://eslint.style/packages/default
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This replaces the old arclint eslint setup 1:1 rule wise, only porting
the configuration to a format recent eslint can read.
Further remove the arclint setup as it is no longer of use.
Thanks to Stan for reviewing all needed fixes to Javascript code to
allow for adding this without compromises.
Fixes: #7812
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
Running the markdownlint pre-commit hook as Gitea Action fails for
markdownlint >=0.38.0, as the NodeJS version available in the Act Runner
Docker image so too old for that. To solve this, this commit specifies a
newer NodeJS version to use.
It's a bit hard for contributors to figure out what ruff-format is
unhappy about if all they get is a return status of non zero. Enable
printing a diff with suggested changes with the pre-commit hook.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
With the removal of the premake sources all exclude directives in
.pre-commit-config.yaml are obsolete, so remove them.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This ensures the same Python target version used for `ruff format`
is used for `ruff check` as well. It also allows ruff, even if it's not
run through pre-commit, to use the correct target Python version.
Adding a hook to pre-commit to enforce a consistent style and remove the
hook check-yaml which only checks if a document is parsable and so
become redundant.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
The schema at https://json.schemastore.org/gitea-issue-forms.json
doesn't like empty titles, so just remove the key to the same effect as
a zero length string.
Add document start markers where they are missing.
Use a max line length of 100 as discussed with Dunedan.
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This replaces the existing arclint linter to ensure the project name
does only include a non-breaking space with a pre-commit hook. The regex
to check is slightly different to account for escaped non-breaking
spaces in JavaScript files and to avoid some false-positives.