diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /docs/code-quality/lint/linters/ignorefile.rst | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz firefox-adbda400be353e676059e335c3c0aaf99e719475.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'docs/code-quality/lint/linters/ignorefile.rst')
-rw-r--r-- | docs/code-quality/lint/linters/ignorefile.rst | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/docs/code-quality/lint/linters/ignorefile.rst b/docs/code-quality/lint/linters/ignorefile.rst new file mode 100644 index 0000000000..506ea5de51 --- /dev/null +++ b/docs/code-quality/lint/linters/ignorefile.rst @@ -0,0 +1,45 @@ +Ignorefile Lint +=============== + +Ignorefile lint is a linter for ``.gitignore`` and ``.hgignore`` files, +to verify those files have equivalent entries. + +Each pattern is roughly compared, ignoring punctuations, to absorb the +syntax difference. + +Run Locally +----------- + +The mozlint integration of ignorefile linter can be run using mach: + +.. parsed-literal:: + + $ mach lint --linter ignorefile + + +Special syntax +-------------- + +The following special comment can be used to ignore the pattern in the next line. + +.. parsed-literal:: + + # lint-ignore-next-line: git-only + # lint-ignore-next-line: hg-only + +The next line exists only in ``.gitignore``. or ``.hgignore``. + +.. parsed-literal:: + # lint-ignore-next-line: syntax-difference + +The next line's pattern needs to be represented differently between +``.gitignore`` and ``.hgignore``. +This can be used when the ``.hgignore`` uses complex pattern which cannot be +represented in single pattern in ``.gitignore``. + + +Sources +------- + +* :searchfox:`Configuration (YAML) <tools/lint/ignorefile.yml>` +* :searchfox:`Source <tools/lint/ignorefile/__init__.py>` |