forked from mirrors/gecko-dev
This for a few reasons: * The summary becomes the landing page for code quality: https://firefox-source-docs.mozilla.org/tools/static-analysis/summary.html * I don't think we need a full code quality category * Closer to the source-code-doc * All the files at the same place Differential Revision: https://phabricator.services.mozilla.com/D61767 --HG-- rename : tools/lint/docs/coding-style/coding_style_java.rst => docs/code-quality/coding-style/coding_style_java.rst rename : tools/lint/docs/coding-style/coding_style_other.rst => docs/code-quality/coding-style/coding_style_other.rst rename : tools/lint/docs/coding-style/coding_style_python.rst => docs/code-quality/coding-style/coding_style_python.rst rename : tools/lint/docs/coding-style/format_cpp_code_with_clang-format.rst => docs/code-quality/coding-style/format_cpp_code_with_clang-format.rst rename : tools/clang-tidy/docs/summary.rst => docs/code-quality/index.rst rename : tools/lint/docs/create.rst => docs/code-quality/lint/create.rst rename : tools/lint/docs/index.rst => docs/code-quality/lint/index.rst rename : tools/lint/docs/index.rst => docs/code-quality/lint/lint.rst rename : tools/lint/docs/linters/codespell.rst => docs/code-quality/lint/linters/codespell.rst rename : tools/lint/docs/linters/cpp-virtual-final.rst => docs/code-quality/lint/linters/cpp-virtual-final.rst rename : tools/lint/docs/linters/eslint-plugin-mozilla.rst => docs/code-quality/lint/linters/eslint-plugin-mozilla.rst rename : tools/lint/docs/linters/eslint-plugin-spidermonkey-js.rst => docs/code-quality/lint/linters/eslint-plugin-spidermonkey-js.rst rename : tools/lint/docs/linters/eslint.rst => docs/code-quality/lint/linters/eslint.rst rename : tools/lint/docs/linters/file-perm.rst => docs/code-quality/lint/linters/file-perm.rst rename : tools/lint/docs/linters/file-whitespace.rst => docs/code-quality/lint/linters/file-whitespace.rst rename : tools/lint/docs/linters/flake8.rst => docs/code-quality/lint/linters/flake8.rst rename : tools/lint/docs/linters/l10n.rst => docs/code-quality/lint/linters/l10n.rst rename : tools/lint/docs/linters/license.rst => docs/code-quality/lint/linters/license.rst rename : tools/lint/docs/linters/lintpref.rst => docs/code-quality/lint/linters/lintpref.rst rename : tools/lint/docs/linters/mingw-capitalization.rst => docs/code-quality/lint/linters/mingw-capitalization.rst rename : tools/lint/docs/linters/perfdocs.rst => docs/code-quality/lint/linters/perfdocs.rst rename : tools/lint/docs/linters/rstlinter.rst => docs/code-quality/lint/linters/rstlinter.rst rename : tools/lint/docs/linters/rustfmt.rst => docs/code-quality/lint/linters/rustfmt.rst rename : tools/lint/docs/usage.rst => docs/code-quality/lint/usage.rst rename : tools/clang-tidy/docs/index.rst => docs/code-quality/static-analysis.rst extra : moz-landing-system : lando
39 lines
1.2 KiB
ReStructuredText
39 lines
1.2 KiB
ReStructuredText
License
|
|
=======
|
|
|
|
This linter verifies if a file has a known license header.
|
|
|
|
By default, Firefox uses MPL-2 license with the `appropriate headers <https://www.mozilla.org/en-US/MPL/headers/>`_.
|
|
In some cases (thirdpardy code), a file might have a different header file.
|
|
If this is the case, one of the significant line of the header should be listed in the list `of valid licenses
|
|
<https://searchfox.org/mozilla-central/source/tools/lint/license/valid-licenses.txt>`_.
|
|
|
|
Run Locally
|
|
-----------
|
|
|
|
This mozlint linter can be run using mach:
|
|
|
|
.. parsed-literal::
|
|
|
|
$ mach lint --linter license <file paths>
|
|
|
|
|
|
Configuration
|
|
-------------
|
|
|
|
This linter is enabled on most of the whole code base.
|
|
|
|
Autofix
|
|
-------
|
|
|
|
This linter provides a ``--fix`` option. The python script is doing the change itself
|
|
and will use the right header MPL-2 header depending on the language.
|
|
It will add the license at the right place in case the file is a script (ie starting with ``!#``
|
|
or a XML file ``<?xml>``).
|
|
|
|
|
|
Sources
|
|
-------
|
|
|
|
* `Configuration (YAML) <https://searchfox.org/mozilla-central/source/tools/lint/license.yml>`_
|
|
* `Source <https://searchfox.org/mozilla-central/source/tools/lint/license/__init__.py>`_
|