1
0
forked from 0ad/0ad
0ad/build/arclint
2024-05-10 10:10:49 +00:00
..
configs Update eslintrc.json to allow for class properties in JavaScript. 2024-05-10 10:10:49 +00:00
dummies Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
pyrolint Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
LICENCE.txt Lint update: use arclint, remove JSHint, remove coala on CI. 2021-03-15 15:14:28 +00:00
README.md Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00: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.
  • project-name detects misspellings of the project name "0 A.D.". In particular the non-breaking space.
  • licence-year detects Copyright header years and compares against modification time.
  • eslint, if installed, will run on javascript files.
  • cppcheck, if installed, will run on C++ files.

Installation

This assumes you have arcanist already installed. If not, consult https://trac.wildfiregames.com/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

cppcheck

Cppcheck is available on various package managers, including HomeBrew on macOS. An installer is available on windows. See http://cppcheck.sourceforge.net for details.