Files
0ad/build/arclint
Ralph Sennhauser 6da4e606d4 Add cppcheck workflow
Add a workflow for linting and add a cppcheck job.

The job is using cppcheck provided by package manager. Existing errors
are suppressed to get going with CI linting, ideally tho the suppression
list would be empty. Some of the suppressed errors are only found with
more recent cppcheck than what is available in the runner.

Also remove old arclint cppcheck setup.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
2025-03-30 18:06:01 +02:00
..
2025-03-30 18:06:01 +02:00
2025-03-30 18:06:01 +02:00

Linting

This folder contains tools for linting 0 A.D. code Linting is done via Arcanist: https://secure.phabricator.com/book/phabricator/article/arcanist_lint/

Linters

  • text is configured to detect whitespace issues.
  • json detects JSON syntax errors.
  • licence-year detects Copyright header years and compares against modification time.
  • eslint, if installed, will run on javascript files.

Installation

This assumes you have arcanist already installed. If not, consult https://gitea.wildfiregames.com/0ad/0ad/wiki/Phabricator#UsingArcanist .

The linting is done via custom PHP scripts, residing in pyrolint/. Configuration is at the root of the project, under .arclint.

Installing linters

We provide dummy replacement for external linters, so that they are not required.

eslint

Installation via npm is recommended. The linter assumes a global installation of both eslint and the "brace-rules" plugin.

npm install -g eslint@latest eslint-plugin-brace-rules`

See also https://eslint.org/docs/user-guide/getting-started