-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
754 additions
and
609 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,192 @@ | ||
# Build-system section | ||
[build-system] | ||
requires = ["setuptools>=40.8.0", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
# Black section | ||
[tool.black] | ||
force-exclude=""" | ||
(tests/aggregate_tests.py| | ||
tests/fast_server_exit.py| | ||
tests/simple_https_server.py| | ||
tests/simple_server.py| | ||
tests/slow_retrieval_server.py| | ||
tests/utils.py| | ||
tests/test_utils.py| | ||
tests/test_repository_lib.py| | ||
tests/test_arbitrary_package_attack.py| | ||
tests/test_developer_tool.py| | ||
tests/test_download.py| | ||
tests/test_endless_data_attack.py| | ||
tests/test_extraneous_dependencies_attack.py| | ||
tests/test_formats.py| | ||
tests/test_indefinite_freeze_attack.py| | ||
tests/test_key_revocation_integration.py| | ||
tests/test_keydb.py| | ||
tests/test_log.py| | ||
tests/test_mirrors.py| | ||
tests/test_mix_and_match_attack.py| | ||
tests/test_multiple_repositories_integration.py| | ||
tests/test_repository_tool.py| | ||
tests/test_replay_attack.py| | ||
tests/test_roledb.py| | ||
tests/test_root_versioning_integration.py| | ||
tests/test_sig.py| | ||
tests/test_slow_retrieval_attack.py| | ||
tests/test_tutorial.py| | ||
tests/test_unittest_toolbox.py| | ||
tests/test_updater.py| | ||
tests/test_updater_root_rotation_integration.py| | ||
tests/repository_data/generate_project_data.py| | ||
tests/repository_data/generate.py)""" | ||
|
||
# isort section | ||
[tool.isort] | ||
skip = [ | ||
"tests/fast_server_exit.py", | ||
"tests/simple_https_server.py", | ||
"tests/simple_server.py", | ||
"tests/slow_retrieval_server.py", | ||
"tests/utils.py", | ||
"tests/test_utils.py", | ||
"tests/test_repository_lib.py", | ||
"tests/test_arbitrary_package_attack.py", | ||
"tests/test_developer_tool.py", | ||
"tests/test_download.py", | ||
"tests/test_endless_data_attack.py", | ||
"tests/test_extraneous_dependencies_attack.py", | ||
"tests/test_formats.py", | ||
"tests/test_indefinite_freeze_attack.py", | ||
"tests/test_key_revocation_integration.py", | ||
"tests/test_keydb.py", | ||
"tests/test_log.py", | ||
"tests/test_mirrors.py", | ||
"tests/test_mix_and_match_attack.py", | ||
"tests/test_multiple_repositories_integration.py", | ||
"tests/test_repository_tool.py", | ||
"tests/test_replay_attack.py", | ||
"tests/test_roledb.py", | ||
"tests/test_root_versioning_integration.py", | ||
"tests/test_sig.py", | ||
"tests/test_slow_retrieval_attack.py", | ||
"tests/test_tutorial.py", | ||
"tests/test_unittest_toolbox.py", | ||
"tests/test_updater.py", | ||
"tests/test_updater_root_rotation_integration.py", | ||
"tests/repository_data/generate_project_data.py", | ||
"tests/repository_data/generate.py", | ||
] | ||
|
||
# Pylint section | ||
|
||
# Minimal pylint configuration file for Secure Systems Lab Python Style Guide: | ||
# https://github.com/secure-systems-lab/code-style-guidelines | ||
# | ||
# Based on Google Python Style Guide pylintrc and pylint defaults: | ||
# https://google.github.io/styleguide/pylintrc | ||
# http://pylint.pycqa.org/en/latest/technical_reference/features.html | ||
|
||
[tool.pylint.master] | ||
ignore = [ | ||
"aggregate_tests.py", | ||
"fast_server_exit.py", | ||
"simple_https_server.py", | ||
"simple_server.py", | ||
"slow_retrieval_server.py", | ||
"utils.py", | ||
"test_utils.py", | ||
"test_repository_lib.py", | ||
"test_arbitrary_package_attack.py", | ||
"test_developer_tool.py", | ||
"test_download.py", | ||
"test_endless_data_attack.py", | ||
"test_extraneous_dependencies_attack.py", | ||
"test_formats.py", | ||
"test_indefinite_freeze_attack.py", | ||
"test_key_revocation_integration.py", | ||
"test_keydb.py", | ||
"test_log.py", | ||
"test_mirrors.py", | ||
"test_mix_and_match_attack.py", | ||
"test_multiple_repositories_integration.py", | ||
"test_repository_tool.py", | ||
"test_replay_attack.py", | ||
"test_roledb.py", | ||
"test_root_versioning_integration.py", | ||
"test_sig.py", | ||
"test_slow_retrieval_attack.py", | ||
"test_tutorial.py", | ||
"test_unittest_toolbox.py", | ||
"test_updater.py", | ||
"test_updater_root_rotation_integration.py", | ||
"generate_project_data.py", | ||
"generate.py", | ||
] | ||
|
||
[tool.pylint.message_control] | ||
# Disable the message, report, category or checker with the given id(s). | ||
# NOTE: To keep this config as short as possible we only disable checks that | ||
# are currently in conflict with our code. If new code displeases the linter | ||
# (for good reasons) consider updating this config file, or disable checks with. | ||
disable=[ | ||
"fixme", | ||
"too-few-public-methods", | ||
"too-many-arguments", | ||
"duplicate-code" | ||
] | ||
|
||
[tool.pylint.basic] | ||
good-names = ["i","j","k","v","e","f","fn","fp","_type","_"] | ||
# Regexes for allowed names are copied from the Google pylintrc | ||
# NOTE: Pylint captures regex name groups such as 'snake_case' or 'camel_case'. | ||
# If there are multiple groups it enfoces the prevalent naming style inside | ||
# each modules. Names in the exempt capturing group are ignored. | ||
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_]*))$""" | ||
ethod-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_]*))$""" | ||
argument-rgx="""^[a-z][a-z0-9_]*$""" | ||
attr-rgx="""^_{0,2}[a-z][a-z0-9_]*$""" | ||
class-attribute-rgx="""^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$""" | ||
class-rgx="^_?[A-Z][a-zA-Z0-9]*$" | ||
const-rgx="^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$" | ||
inlinevar-rgx="^[a-z][a-z0-9_]*$" | ||
module-rgx="^(_?[a-z][a-z0-9_]*|__init__)$" | ||
no-docstring-rgx="(__.*__|main|test.*|.*test|.*Test)$" | ||
variable-rgx="^[a-z][a-z0-9_]*$" | ||
docstring-min-length=10 | ||
|
||
[tool.pylint.format] | ||
ignore-long-lines='(?x)(^\s*(\#\ )?<?https?://\S+>?$|^\s*(from\s+\S+\s+)?import\s+.+$)' | ||
indent-string=" " | ||
indent-after-paren=4 | ||
max-line-length=80 | ||
single-line-if-stmt="yes" | ||
|
||
[tool.pylint.logging] | ||
logging-format-style="old" | ||
|
||
[tool.pylint.miscellaneous] | ||
notes="TODO" | ||
|
||
[tool.pylint.STRING] | ||
check-quote-consistency="yes" | ||
|
||
# mypy section | ||
[tool.mypy] | ||
warn_unused_configs = "True" | ||
warn_redundant_casts = "True" | ||
warn_unused_ignores = "True" | ||
warn_unreachable = "True" | ||
strict_equality = "True" | ||
disallow_untyped_defs = "True" | ||
disallow_untyped_calls = "True" | ||
files = [ | ||
"tuf/api/", | ||
"tuf/ngclient", | ||
"tuf/exceptions.py" | ||
] | ||
|
||
[tool.mypy-securesystemslib] | ||
ignore_missing_imports = "True" | ||
|
||
[tool.mypy-urllib3] | ||
ignore_missing_imports = "True" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.