python-sites.rst (1149B)
1 Python Sites 2 ================== 3 4 This linter verifies that :searchfox:`python site <python/sites/>` files are 5 following the best practices. 6 7 Redundant Specifications 8 -------------------------------- 9 10 If a dependency is specified in the :searchfox:`mach site <python/sites/>`, it 11 does not need to be specified in any command site (eg: `build.txt`, `common.txt`, etc). 12 13 This check warns against these redundant specifications, and can also fix them. 14 15 Specification Ordering 16 -------------------------------- 17 18 The first line of any site file should start with `require-python:`. All subsequent lines 19 should be sorted alphabetically. This check ensures that's the case, and can fix the ordering 20 for you, while still maintaining comment block association. 21 22 Run Locally 23 ----------- 24 25 This mozlint linter can be run using mach: 26 27 .. parsed-literal:: 28 29 $ mach lint --linter python-sites <file paths> 30 31 Configuration 32 ------------- 33 34 This linter is enabled by default, and will run if you make changes to site files. 35 36 Sources 37 ------- 38 39 * :searchfox:`Configuration (YAML) <tools/lint/python-sites.yml>` 40 * :searchfox:`Source <tools/lint/python-sites/__init__.py>`