@@ -75,67 +75,25 @@ include = [
7575# from `tests` so the root directory must be added to Python's path for editable installations
7676dev-mode-dirs = [" ." ]
7777
78- # Black section
79- # Read more here: https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-via-a-file
80- [tool .black ]
78+ # Ruff section
79+ # Read more here: https://docs.astral.sh/ruff/linter/#rule-selection
80+ [tool .ruff ]
8181line-length =80
8282
83- # Isort section
84- # Read more here: https://pycqa.github.io/isort/docs/configuration/config_files.html
85- [tool .isort ]
86- profile =" black"
87- line_length =80
88- known_first_party = [" tuf" ]
89-
90- # Pylint section
91-
92- # Minimal pylint configuration file for Secure Systems Lab Python Style Guide:
93- # https://github.com/secure-systems-lab/code-style-guidelines
94- #
95- # Based on Google Python Style Guide pylintrc and pylint defaults:
96- # https://google.github.io/styleguide/pylintrc
97- # http://pylint.pycqa.org/en/latest/technical_reference/features.html
98-
99- [tool .pylint .message_control ]
100- # Disable the message, report, category or checker with the given id(s).
101- # NOTE: To keep this config as short as possible we only disable checks that
102- # are currently in conflict with our code. If new code displeases the linter
103- # (for good reasons) consider updating this config file, or disable checks with.
104- disable =[
105- " fixme" ,
106- " too-few-public-methods" ,
107- " too-many-arguments" ,
108- " format" ,
109- " duplicate-code"
110- ]
111-
112- [tool .pylint .basic ]
113- good-names = [" i" ," j" ," k" ," v" ," e" ," f" ," fn" ," fp" ," _type" ," _" ]
114- # Regexes for allowed names are copied from the Google pylintrc
115- # NOTE: Pylint captures regex name groups such as 'snake_case' or 'camel_case'.
116- # If there are multiple groups it enfoces the prevalent naming style inside
117- # each modules. Names in the exempt capturing group are ignored.
118- 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_]*))$"
119- 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_]*))$"
120- argument-rgx =" ^[a-z][a-z0-9_]*$"
121- attr-rgx =" ^_{0,2}[a-z][a-z0-9_]*$"
122- class-attribute-rgx =" ^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$"
123- class-rgx =" ^_?[A-Z][a-zA-Z0-9]*$"
124- const-rgx =" ^(_?[A-Z][A-Z0-9_]*|__[a-z0-9_]+__|_?[a-z][a-z0-9_]*)$"
125- inlinevar-rgx =" ^[a-z][a-z0-9_]*$"
126- module-rgx =" ^(_?[a-z][a-z0-9_]*|__init__)$"
127- no-docstring-rgx =" (__.*__|main|test.*|.*test|.*Test)$"
128- variable-rgx =" ^[a-z][a-z0-9_]*$"
129- docstring-min-length =10
130-
131- [tool .pylint .logging ]
132- logging-format-style =" old"
133-
134- [tool .pylint .miscellaneous ]
135- notes =" TODO"
136-
137- [tool .pylint .STRING ]
138- check-quote-consistency =" yes"
83+ [tool .ruff .lint ]
84+ select = [
85+ " D" , # pydocstyle
86+ " E" , # pycodestyle
87+ " F" , # pyflakes
88+ " I" , # isort
89+ " N" , # pep8-naming
90+ " PL" , # pylint
91+ ]
92+ ignore = [" D400" ," D415" ," D213" ," D205" ," D202" ," D107" ," D407" ," D413" ," D212" ," D104" ," D406" ," D105" ," D411" ," D401" ," D200" ," D203" , " PLR0913" , " PLR2004" ]
93+
94+ [tool .ruff .lint .per-file-ignores ]
95+ "tests/*" = [" D" , " E" ]
96+ "examples/*/*" = [" D" ]
13997
14098# mypy section
14199# Read more here: https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml-file
@@ -156,7 +114,3 @@ module = [
156114 " securesystemslib.*" ,
157115]
158116ignore_missing_imports = " True"
159-
160- [tool .pydocstyle ]
161- inherit = false
162- ignore = " D400,D415,D213,D205,D202,D107,D407,D413,D212,D104,D406,D105,D411,D401,D200,D203"
0 commit comments