1
0
forked from 0ad/0ad
Commit Graph

11 Commits

Author SHA1 Message Date
ae3fad73ce
Add a markdownlint pre-commit hook
This adds a pre-commit hook to link Markdown files and fixes all
reported findings.
2024-08-27 10:06:31 +02:00
f58dc9b485
Remove unnecessary executable bits
This removes the executable bits from files which aren't supposed to
have them.

Also removes shebangs for files which aren't supposed to be executable.
2024-08-26 07:46:34 +02:00
1f51fcb87f
Add hook for non-breaking space in 0 A.D.
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.
2024-08-24 13:08:42 +02:00
f48e480f7f Update eslintrc.json to allow for class properties in JavaScript.
Refs: https://code.wildfiregames.com/D4770

This was SVN commit r28084.
2024-05-10 10:10:49 +00:00
ffc4a56b9f Revert non-ASCII characters from source and configuration files introduced in 157c6af18e.
Fixes #6846

Differential Revision: https://code.wildfiregames.com/D5185
This was SVN commit r27965.
2023-12-03 00:30:12 +00:00
bb
5cb9e32b73 Add linter rule detecting project name misspellings.
Reviewed By: Freagarach
Differential Revision: D4313
This was SVN commit r27787.
2023-07-27 20:56:52 +00:00
bb
157c6af18e Make the space in 0 A.D. non-breaking throughout the codebase.
Avoid cases of filenames
Update years in terms and other legal(ish) documents
Don't update years in license headers, since change is not meaningful

Will add linter rule in seperate commit

Happy recompiling everyone!

Original Patch By: Nescio
Comment By: Gallaecio
Differential Revision: D2620
This was SVN commit r27786.
2023-07-27 20:54:46 +00:00
4f2e730d3c CodingConventions: Prefer using const on immutable values.
Using `const` for values that should not be changed is considered a good
practice (https://eslint.org/docs/rules/prefer-const).

Forum poll:
https://wildfiregames.com/forum/topic/38347-codingconventions-use-const-instead-of-let-for-immutable-values-in-functions/
Differential revision: https://code.wildfiregames.com/D3950
Comments by: @bb, @Stan, @wraitii
This was SVN commit r25454.
2021-05-17 15:50:16 +00:00
0c419b5bab CI linting: fix issues with char being null for cppcheck.
The CPPCheck linter outputs 'char: null', which trips the
phabricator-jenkins-plugin, and fails to lint on CI.
To avoid this, filter out null values, since e.g. char is optional
anyways. We do want to fail if non-optional values are missing.

Differential Revision: https://code.wildfiregames.com/D3730
This was SVN commit r25112.
2021-03-23 17:43:19 +00:00
d751927b89 Linter fix on CI.
The CI wasn't properly reporting linting, as it turns out the output of
`arc lint --output json` is not what the Jenkins plugin expects.

This adds a custom lint printer that is compatible with the plugin
expectations.

Also delete the coala/ folder forgotten in the original diff.

Differential Revision: https://code.wildfiregames.com/D3709
This was SVN commit r25082.
2021-03-19 09:13:00 +00:00
c9f37fc613 Lint update: use arclint, remove JSHint, remove coala on CI.
This runs linting using the "arc lint" command of arcanist, which
notably gets run automatically as part of the arc diff workflow.

Changes:
- The major change is that arc lint reports, by default, only issues on
changed lines instead of changed files (--lintall changes that).
- JSHint is largely redundant with eslint and does not support some of
the new Javascript functionality that we are able to use in 0 A.D., such
as conditional chaining, thus it is removed (of course, users can still
run it manually).
- Eslint 7 is supported out of the box and updated to ES 2020
- cppcheck and eslint are optional - if the executable is not found
(e.g. in PATH), it will fallback to a 'dummy' PHP script that does
nothing. This has been tested on windows, mac and Debian (CI).
- The licence year linter now suggests replacement, and has been
rewritten as an arcanist linter.
- Add a JSON error linter.

The intention is to have non-intrusive external linting, and largely the
same text linting.

Coala has largely gone unmaintained in the past few years (more so than
arcanist anyways) and installing it on modern Python is convoluted.

Differential Revision: https://code.wildfiregames.com/D3639
This was SVN commit r25056.
2021-03-15 15:14:28 +00:00