|
| 1 | +# Build-system section |
1 | 2 | [build-system] |
2 | 3 | requires = ["setuptools>=40.8.0", "wheel"] |
3 | 4 | build-backend = "setuptools.build_meta" |
| 5 | + |
| 6 | +# Black section |
| 7 | +# Read more here: https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file |
| 8 | +[tool.black] |
| 9 | +line-length=80 |
| 10 | + |
| 11 | +# Isort section |
| 12 | +# Read more here: https://pycqa.github.io/isort/docs/configuration/config_files.html |
| 13 | +[tool.isort] |
| 14 | +profile="black" |
| 15 | +line_length=80 |
| 16 | +known_first_party = ["tuf"] |
| 17 | + |
| 18 | +# Pylint section |
| 19 | + |
| 20 | +# Minimal pylint configuration file for Secure Systems Lab Python Style Guide: |
| 21 | +# https://github.com/secure-systems-lab/code-style-guidelines |
| 22 | +# |
| 23 | +# Based on Google Python Style Guide pylintrc and pylint defaults: |
| 24 | +# https://google.github.io/styleguide/pylintrc |
| 25 | +# http://pylint.pycqa.org/en/latest/technical_reference/features.html |
| 26 | + |
| 27 | +[tool.pylint.message_control] |
| 28 | +# Disable the message, report, category or checker with the given id(s). |
| 29 | +# NOTE: To keep this config as short as possible we only disable checks that |
| 30 | +# are currently in conflict with our code. If new code displeases the linter |
| 31 | +# (for good reasons) consider updating this config file, or disable checks with. |
| 32 | +disable=[ |
| 33 | + "fixme", |
| 34 | + "too-few-public-methods", |
| 35 | + "too-many-arguments", |
| 36 | + "format", |
| 37 | + "duplicate-code" |
| 38 | +] |
| 39 | + |
| 40 | +[tool.pylint.basic] |
| 41 | +good-names = ["i","j","k","v","e","f","fn","fp","_type","_"] |
| 42 | +# Regexes for allowed names are copied from the Google pylintrc |
| 43 | +# NOTE: Pylint captures regex name groups such as 'snake_case' or 'camel_case'. |
| 44 | +# If there are multiple groups it enfoces the prevalent naming style inside |
| 45 | +# each modules. Names in the exempt capturing group are ignored. |
| 46 | +function-rgx="^(?:(?P<exempt>setUp|tearDown|setUpModule|tearDownModule)|(?P<camel_case>_?[A-Z][a-zA-Z0-9]*)|(?P<snake_case>_?[a-z][a-z0-9_]*))$" |
| 47 | +method-rgx="(?x)^(?:(?P<exempt>_[a-z0-9_]+__|runTest|setUp|tearDown|setUpTestCase|tearDownTestCase|setupSelf|tearDownClass|setUpClass|(test|assert)_*[A-Z0-9][a-zA-Z0-9_]*|next)|(?P<camel_case>_{0,2}[A-Z][a-zA-Z0-9_]*)|(?P<snake_case>_{0,2}[a-z][a-z0-9_]*))$" |
| 48 | +argument-rgx="^[a-z][a-z0-9_]*$" |
| 49 | +attr-rgx="^_{0,2}[a-z][a-z0-9_]*$" |
| 50 | +class-attribute-rgx="^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$" |
| 51 | +class-rgx="^_?[A-Z][a-zA-Z0-9]*$" |
| 52 | +const-rgx="^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$" |
| 53 | +inlinevar-rgx="^[a-z][a-z0-9_]*$" |
| 54 | +module-rgx="^(_?[a-z][a-z0-9_]*|__init__)$" |
| 55 | +no-docstring-rgx="(__.*__|main|test.*|.*test|.*Test)$" |
| 56 | +variable-rgx="^[a-z][a-z0-9_]*$" |
| 57 | +docstring-min-length=10 |
| 58 | + |
| 59 | +[tool.pylint.logging] |
| 60 | +logging-format-style="old" |
| 61 | + |
| 62 | +[tool.pylint.miscellaneous] |
| 63 | +notes="TODO" |
| 64 | + |
| 65 | +[tool.pylint.STRING] |
| 66 | +check-quote-consistency="yes" |
| 67 | + |
| 68 | +# mypy section |
| 69 | +# Read more here: https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml-file |
| 70 | +[tool.mypy] |
| 71 | +warn_unused_configs = "True" |
| 72 | +warn_redundant_casts = "True" |
| 73 | +warn_unused_ignores = "True" |
| 74 | +warn_unreachable = "True" |
| 75 | +strict_equality = "True" |
| 76 | +disallow_untyped_defs = "True" |
| 77 | +disallow_untyped_calls = "True" |
| 78 | +show_error_codes = "True" |
| 79 | +files = [ |
| 80 | + "tuf/api/", |
| 81 | + "tuf/ngclient", |
| 82 | + "tuf/exceptions.py" |
| 83 | +] |
| 84 | + |
| 85 | +[[tool.mypy.overrides]] |
| 86 | +module = [ |
| 87 | + "securesystemslib.*", |
| 88 | + "urllib3.*" |
| 89 | +] |
| 90 | +ignore_missing_imports = "True" |
0 commit comments