0ad/source/tools/lint
Ralph Sennhauser 475053ea7c
Fix copyright linter invocation
Requires HEAD to point to --to <commitish> for the files to be in the
state for copyright.py to produce expected results. Which isn't the case
in the gitea workflow.

Also use plumbing commands to on one hand make it more robust and on the
other hand to avoid bad files only in --from <commitish> to leak into
the check.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-06-04 21:12:25 +02:00
..
copyright Fix copyright linter invocation 2025-06-04 21:12:25 +02:00
cppcheck Add cppcheck workflow 2025-03-30 18:06:01 +02:00
jenkinsfiles Add a Jenkinsfile linter 2025-05-08 19:50:21 +02:00
lint.sh Add a Jenkinsfile linter 2025-05-08 19:50:21 +02:00
README.md Add eslint pre-commit hook 2025-05-30 17:30:25 +02:00

Linters

Linters for use in CI or by developers. Also providing configurations for IDEs.

cppcheck

suppression-list

The suppression list is ideally empty, restricting to file scope is preferred.

The format for an error suppression is one of: [error id]:[filename]:[line] [error id]:[filename2] [error id]

libraries

Adding library cfg's for other deps could improve cppchecks ability to find issues.

A linter for checking copyright dates in file headers are up to date.

eslint

For eslint run 'pre-commt run eslint -a'

Installation and IDE integration

Install Node.js and then run 'npm install' in the repo root.

Now you can run eslint as 'npm run-script lint' or if you want eslint to try fix the issues 'npm run-script lint:fix'.

After having installed eslint you might want to add an eslint extension to your editor to get inline warnings and to allow for auto-formatting.