@@ -78,32 +78,108 @@ addopts = [
7878 " --import-mode=importlib" , # allow using test files with same name
7979]
8080
81- [tool .isort ]
82- include_trailing_comma = true
83- multi_line_output = 3
84- profile = " black"
85- skip_glob = [" docs/*" ]
86-
87- [tool .black ]
81+ [tool .ruff ]
8882line-length = 120
89- target-version = [' py310' ]
90- include = ' \.pyi?$'
91- exclude = '''
92- (
93- /(
94- \.eggs
95- | \.git
96- | \.hg
97- | \.mypy_cache
98- | \.tox
99- | \.venv
100- | _build
101- | buck-out
102- | build
103- | dist
104- )/
105- )
106- '''
83+ exclude = [
84+ " .git" ,
85+ " .tox" ,
86+ " __pycache__" ,
87+ " build" ,
88+ " docs/_build" ,
89+ " dist" ,
90+ " setup.py" ,
91+ ]
92+ lint.select = [
93+ " F" , # Errors detected by Pyflakes
94+ " E" , # Error detected by Pycodestyle
95+ " W" , # Warning detected by Pycodestyle
96+ " I" , # isort
97+ " D" , # pydocstyle
98+ " B" , # flake8-bugbear
99+ " TID" , # flake8-tidy-imports
100+ " C4" , # flake8-comprehensions
101+ " BLE" , # flake8-blind-except
102+ " UP" , # pyupgrade
103+ " RUF100" , # Report unused noqa directives
104+ " TCH" , # Typing imports
105+ " NPY" , # Numpy specific rules
106+ # "PTH", # Use pathlib
107+ # "S" # Security
108+ ]
109+ lint.ignore = [
110+ # Do not catch blind exception: `Exception`
111+ " BLE001" ,
112+ # Errors from function calls in argument defaults. These are fine when the result is immutable.
113+ " B008" ,
114+ # line too long -> we accept long comment lines; black gets rid of long code lines
115+ " E501" ,
116+ # Do not assign a lambda expression, use a def -> lambda expression assignments are convenient
117+ " E731" ,
118+ # allow I, O, l as variable names -> I is the identity matrix
119+ " E741" ,
120+ # Missing docstring in public module
121+ " D100" ,
122+ # undocumented-public-class
123+ " D101" ,
124+ # Missing docstring in public method
125+ " D102" ,
126+ # Missing docstring in public function
127+ " D103" ,
128+ # Missing docstring in public package
129+ " D104" ,
130+ # __magic__ methods are are often self-explanatory, allow missing docstrings
131+ " D105" ,
132+ # Missing docstring in public nested class
133+ " D106" ,
134+ # Missing docstring in __init__
135+ " D107" ,
136+ # # Disable one in each pair of mutually incompatible rules
137+ # We don’t want a blank line before a class docstring
138+ " D203" ,
139+ # 1 blank line required after class docstring
140+ " D204" ,
141+ # first line should end with a period [Bug: doesn't work with single-line docstrings]
142+ # We want docstrings to start immediately after the opening triple quote
143+ " D213" ,
144+ # Section underline is over-indented ("{name}")
145+ " D215" ,
146+ # First line should be in imperative mood; try rephrasing
147+ " D401" ,
148+ # First word of the first line should be capitalized: {} -> {}
149+ " D403" ,
150+ # First word of the docstring should not be "This"
151+ " D404" ,
152+ # Section name should end with a newline ("{name}")
153+ " D406" ,
154+ # Missing dashed underline after section ("{name}")
155+ " D407" ,
156+ # Section underline should be in the line following the section's name ("{name}")
157+ " D408" ,
158+ # Section underline should match the length of its name ("{name}")
159+ " D409" ,
160+ # No blank lines allowed between a section header and its content ("{name}")
161+ " D412" ,
162+ # Missing blank line after last section ("{name}")
163+ " D413" ,
164+ # Missing argument description in the docstring
165+ " D417" ,
166+ # camcelcase imported as lowercase
167+ " N813" ,
168+ # module import not at top level of file
169+ " E402" ,
170+ # open()` should be replaced by `Path.open()
171+ " PTH123" ,
172+ # subprocess` call: check for execution of untrusted input - https://github.com/PyCQA/bandit/issues/333
173+ " S603" ,
174+ # Starting a process with a partial executable path
175+ " S607" ,
176+ # Prefer absolute imports over relative imports from parent modules
177+ " TID252" ,
178+ # Standard pseudo-random generators are not suitable for cryptographic purposes
179+ " S311" ,
180+ # Unused imports
181+ " F401" ,
182+ ]
107183
108184[tool .jupytext ]
109185formats = " ipynb,md"
0 commit comments