mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-06 17:05:32 +00:00
6da4e606d4
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>
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
textis configured to detect whitespace issues.jsondetects JSON syntax errors.licence-yeardetects 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`