2023-12-26 03:09:59 +00:00
target-version = "py39" # Pin Ruff to Python 3.9
line-length = 95
2024-02-01 16:11:44 -08:00
output-format = "full"
2023-12-27 01:13:04 +00:00
2024-04-24 19:00:00 +01:00
extend-exclude = [
2023-12-26 03:09:59 +00:00
"tests/roots/*" ,
2024-06-13 12:07:46 +01:00
"tests/js/roots/*" ,
2023-12-26 03:09:59 +00:00
"build/*" ,
"doc/_build/*" ,
"sphinx/search/*" ,
"doc/usage/extensions/example*.py" ,
]
2024-04-24 19:00:00 +01:00
[ lint ]
preview = true
2023-12-26 03:09:59 +00:00
ignore = [
2024-04-15 01:58:20 +01:00
# flake8-annotations
2024-03-14 10:37:15 +00:00
"ANN401" , # Dynamically typed expressions (typing.Any) are disallowed in `{name}`
2024-04-15 01:58:20 +01:00
# pycodestyle
2023-12-28 06:41:32 +00:00
"E741" , # Ambiguous variable name: `{name}`
2024-04-15 01:58:20 +01:00
# pyflakes
2023-12-29 09:55:28 +00:00
"F841" , # Local variable `{name}` is assigned to but never used
2024-04-15 01:58:20 +01:00
# refurb
2024-03-17 11:06:39 +00:00
"FURB101" , # `open` and `read` should be replaced by `Path(...).read_text(...)`
2024-04-12 20:35:39 +01:00
"FURB103" , # `open` and `write` should be replaced by `Path(...).write_text(...)`
2024-04-15 01:58:20 +01:00
# pylint
2023-12-26 03:09:59 +00:00
"PLC1901" , # simplify truthy/falsey string comparisons
2024-04-15 01:58:20 +01:00
# flake8-simplify
2024-03-14 11:33:17 +00:00
"SIM102" , # Use a single `if` statement instead of nested `if` statements
"SIM108" , # Use ternary operator `{contents}` instead of `if`-`else`-block
2024-04-15 01:58:20 +01:00
# pyupgrade
2024-03-14 11:33:17 +00:00
"UP031" , # Use format specifiers instead of percent format
"UP032" , # Use f-string instead of `format` call
2023-12-26 03:09:59 +00:00
]
external = [ # Whitelist for RUF100 unknown code warnings
"E704" ,
"SIM113" ,
]
select = [
2023-12-26 03:15:37 +00:00
# flake8-builtins ('A')
2023-12-26 03:19:13 +00:00
# NOT YET USED
2023-12-26 03:15:37 +00:00
# airflow ('AIR')
2023-12-26 03:19:13 +00:00
# Airflow is not used in Sphinx
2024-04-15 01:58:20 +01:00
# flake8-annotations ('ANN')
"ANN" ,
2023-12-26 03:15:37 +00:00
# flake8-unused-arguments ('ARG')
"ARG004" , # Unused static method argument: `{name}`
# flake8-async ('ASYNC')
2023-12-29 09:55:28 +00:00
"ASYNC" ,
2023-12-26 03:15:37 +00:00
# flake8-bugbear ('B')
2023-12-29 09:55:28 +00:00
"B" ,
2023-12-26 03:15:37 +00:00
# flake8-blind-except ('BLE')
2023-12-26 03:19:13 +00:00
# NOT YET USED
2023-12-29 09:55:28 +00:00
# flake8-comprehensions ('C4')
"C4" ,
# mccabe ('C90')
2023-12-26 03:19:13 +00:00
# "C901", # `{name}` is too complex ({complexity} > {max_complexity})
2023-12-26 03:15:37 +00:00
# flake8-commas ('COM')
"COM818" , # Trailing comma on bare tuple prohibited
"COM819" , # Trailing comma prohibited
2024-01-04 02:53:12 +00:00
# flake8-copyright ('CPY')
# NOT YET USED
2023-12-26 03:15:37 +00:00
# pydocstyle ('D')
2024-01-04 04:27:03 +00:00
# "D100", # Missing docstring in public module
# "D101", # Missing docstring in public class
# "D102", # Missing docstring in public method
# "D103", # Missing docstring in public function
# "D104", # Missing docstring in public package
# "D105", # Missing docstring in magic method
"D106" , # Missing docstring in public nested class
# "D107", # Missing docstring in `__init__`
# "D200", # One-line docstring should fit on one line
"D201" , # No blank lines allowed before function docstring (found {num_lines})
2024-01-14 21:13:46 +00:00
"D202" , # No blank lines allowed after function docstring (found {num_lines})
"D204" , # 1 blank line required after class docstring
2024-01-04 04:27:03 +00:00
# "D205", # 1 blank line required between summary line and description
"D206" , # Docstring should be indented with spaces, not tabs
2024-01-14 21:13:46 +00:00
"D207" , # Docstring is under-indented
"D208" , # Docstring is over-indented
"D209" , # Multi-line docstring closing quotes should be on a separate line
"D210" , # No whitespaces allowed surrounding docstring text
2024-01-04 04:27:03 +00:00
"D211" , # No blank lines allowed before class docstring
# "D212", # Multi-line docstring summary should start at the first line
# "D213", # Multi-line docstring summary should start at the second line
# "D214", # Section is over-indented ("{name}")
# "D215", # Section underline is over-indented ("{name}")
2024-01-14 21:13:46 +00:00
"D300" , # Use triple double quotes `"""`
"D301" , # Use `r"""` if any backslashes in a docstring
2024-01-04 04:27:03 +00:00
# "D400", # First line should end with a period
# "D401", # First line of docstring should be in imperative mood: "{first_line}"
2024-01-14 21:13:46 +00:00
"D402" , # First line should not be the function's signature
"D403" , # First word of the first line should be capitalized: `{}` -> `{}`
2024-01-04 04:27:03 +00:00
# "D404", # First word of the docstring should not be "This"
"D405" , # Section name should be properly capitalized ("{name}")
# "D406", # Section name should end with a newline ("{name}")
# "D407", # Missing dashed underline after section ("{name}")
"D408" , # Section underline should be in the line following the section's name ("{name}")
"D409" , # Section underline should match the length of its name ("{name}")
"D410" , # Missing blank line after section ("{name}")
"D411" , # Missing blank line before section ("{name}")
# "D412", # No blank lines allowed between a section header and its content ("{name}")
2024-02-01 16:11:44 -08:00
# "D413", # Missing blank line after last section ("{name}")
2024-01-04 04:27:03 +00:00
"D414" , # Section has no content ("{name}")
# "D415", # First line should end with a period, question mark, or exclamation point
"D416" , # Section name should end with a colon ("{name}")
"D417" , # Missing argument description in the docstring for `{definition}`: `{name}`
"D418" , # Function decorated with `@overload` shouldn't contain a docstring
"D419" , # Docstring is empty
2023-12-26 03:15:37 +00:00
# flake8-django ('DJ')
2023-12-26 03:19:13 +00:00
# Django is not used in Sphinx
2023-12-26 03:15:37 +00:00
# flake8-datetimez ('DTZ')
2023-12-29 09:55:28 +00:00
"DTZ" ,
2023-12-26 03:15:37 +00:00
# pycodestyle ('E')
2023-12-28 06:41:32 +00:00
"E" ,
2023-12-26 03:15:37 +00:00
# flake8-errmsg ('EM')
2024-04-22 22:54:53 +01:00
"EM" ,
2023-12-26 03:15:37 +00:00
# eradicate ('ERA')
2023-12-26 03:19:13 +00:00
# NOT YET USED
2023-12-26 03:15:37 +00:00
# flake8-executable ('EXE')
2023-12-29 09:55:28 +00:00
"EXE" ,
2023-12-26 03:15:37 +00:00
# pyflakes ('F')
2023-12-29 09:55:28 +00:00
"F" ,
2023-12-26 03:15:37 +00:00
# flake8-future-annotations ('FA')
2024-01-04 04:20:14 +00:00
"FA" ,
2023-12-26 03:15:37 +00:00
# flake8-boolean-trap ('FBT')
2023-12-26 03:19:13 +00:00
# NOT YET USED
2023-12-26 03:15:37 +00:00
# flake8-fixme ('FIX')
2023-12-26 03:19:13 +00:00
# NOT YET USED
2023-12-26 03:15:37 +00:00
# flynt ('FLY')
2024-04-22 22:54:53 +01:00
"FLY" ,
2024-04-15 01:58:20 +01:00
# refurb ('FURB')
"FURB" ,
2023-12-26 03:15:37 +00:00
# flake8-logging-format ('G')
"G001" , # Logging statement uses `str.format`
2024-04-22 22:58:13 +01:00
"G002" , # Logging statement uses `%`
2023-12-26 03:19:13 +00:00
# "G003", # Logging statement uses `+`
2023-12-26 03:15:37 +00:00
"G004" , # Logging statement uses f-string
"G010" , # Logging statement uses `warn` instead of `warning`
"G101" , # Logging statement uses an `extra` field that clashes with a `LogRecord` field: `{key}`
"G201" , # Logging `.exception(...)` should be used instead of `.error(..., exc_info=True)`
"G202" , # Logging statement has redundant `exc_info`
# isort ('I')
2023-12-29 09:55:28 +00:00
"I" ,
2024-04-15 01:58:20 +01:00
# flake8-import-conventions ('ICN')
2024-03-14 11:33:17 +00:00
"ICN" , # flake8-import-conventions
2023-12-26 03:15:37 +00:00
# flake8-no-pep420 ('INP')
2024-01-04 04:17:17 +00:00
"INP" ,
2023-12-26 03:15:37 +00:00
# flake8-gettext ('INT')
2024-04-22 22:54:53 +01:00
"INT" ,
2023-12-26 03:15:37 +00:00
# flake8-implicit-str-concat ('ISC')
2023-12-26 03:19:13 +00:00
# NOT YET USED
2024-01-04 02:53:12 +00:00
# flake8-logging ('LOG')
2024-04-22 22:54:53 +01:00
"LOG" ,
2023-12-26 03:15:37 +00:00
# pep8-naming ('N')
2023-12-26 03:19:13 +00:00
# NOT YET USED
2023-12-26 03:15:37 +00:00
# numpy-specific rules ('NPY')
2023-12-26 03:19:13 +00:00
# Numpy is not used in Sphinx
2023-12-26 03:15:37 +00:00
# pandas-vet ('PD')
2023-12-26 03:19:13 +00:00
# Pandas is not used in Sphinx
2023-12-26 03:15:37 +00:00
# perflint ('PERF')
2024-01-04 04:01:52 +00:00
"PERF101" , # Do not cast an iterable to `list` before iterating over it
"PERF102" , # When using only the {subset} of a dict use the `{subset}()` method
# "PERF203", # `try`-`except` within a loop incurs performance overhead
2024-03-14 10:16:36 +00:00
"PERF401" , # Use a list comprehension to create a transformed list
2024-01-04 04:01:52 +00:00
"PERF402" , # Use `list` or `list.copy` to create a copy of a list
"PERF403" , # Use a dictionary comprehension instead of a for-loop
2023-12-26 03:15:37 +00:00
# pygrep-hooks ('PGH')
2023-12-29 09:55:28 +00:00
"PGH" ,
2023-12-26 03:15:37 +00:00
# flake8-pie ('PIE')
2023-12-26 03:19:13 +00:00
# "PIE790", # Unnecessary `pass` statement
2023-12-26 03:15:37 +00:00
"PIE794" , # Class field `{name}` is defined multiple times
"PIE796" , # Enum contains duplicate value: `{value}`
"PIE800" , # Unnecessary spread `**`
"PIE804" , # Unnecessary `dict` kwargs
"PIE807" , # Prefer `list` over useless lambda
"PIE810" , # Call `{attr}` once with a `tuple`
# pylint ('PLC')
"PLC0105" , # `{kind}` name "{param_name}" does not reflect its {variance}; consider renaming it to "{replacement_name}"
"PLC0131" , # `{kind}` cannot be both covariant and contravariant
"PLC0132" , # `{kind}` name `{param_name}` does not match assigned variable name `{var_name}`
2024-04-22 22:54:53 +01:00
"PLC0205" , # Class `__slots__` should be a non-string iterable
"PLC0208" , # Use a sequence type instead of a `set` when iterating over values
2023-12-26 03:15:37 +00:00
"PLC0414" , # Import alias does not rename original package
2024-04-22 22:54:53 +01:00
# "PLC0415", # `import` should be at the top-level of a file
"PLC1901" , # `{existing}` can be simplified to `{replacement}` as an empty string is falsey
"PLC2401" , # {kind} name `{name}` contains a non-ASCII character, consider renaming it
"PLC2403" , # Module alias `{name}` contains a non-ASCII character, use an ASCII-only alias
# "PLC2701", # Private name import `{name}` from external module `{module}`
"PLC2801" , # Unnecessary dunder call to `{method}`. {replacement}.
2023-12-26 03:15:37 +00:00
"PLC3002" , # Lambda expression called directly. Execute the expression inline instead.
# pylint ('PLE')
"PLE0100" , # `__init__` method is a generator
"PLE0101" , # Explicit return in `__init__`
"PLE0116" , # `continue` not supported inside `finally` clause
"PLE0117" , # Nonlocal name `{name}` found without binding
"PLE0118" , # Name `{name}` is used prior to global declaration on line {line}
"PLE0241" , # Duplicate base `{base}` for class `{class}`
"PLE0302" , # The special method `{}` expects {}, {} {} given
"PLE0307" , # `__str__` does not return `str`
"PLE0604" , # Invalid object in `__all__`, must contain only strings
"PLE0605" , # Invalid format for `__all__`, must be `tuple` or `list`
"PLE1142" , # `await` should be used within an async function
"PLE1205" , # Too many arguments for `logging` format string
"PLE1206" , # Not enough arguments for `logging` format string
"PLE1300" , # Unsupported format character '{}'
"PLE1307" , # Format type does not match argument type
"PLE1310" , # String `{strip}` call contains duplicate characters (did you mean `{removal}`?)
"PLE1507" , # Invalid type for initial `os.getenv` argument; expected `str`
"PLE1700" , # `yield from` statement in async function; use `async for` instead
"PLE2502" , # Contains control characters that can permit obfuscated code
"PLE2510" , # Invalid unescaped character backspace, use "\b" instead
"PLE2512" , # Invalid unescaped character SUB, use "\x1A" instead
"PLE2513" , # Invalid unescaped character ESC, use "\x1B" instead
"PLE2514" , # Invalid unescaped character NUL, use "\0" instead
"PLE2515" , # Invalid unescaped character zero-width-space, use "\u200B" instead
# pylint ('PLR')
2023-12-26 03:19:13 +00:00
# "PLR0124", # Name compared with itself, consider replacing `{left} {} {right}`
2023-12-26 03:15:37 +00:00
"PLR0133" , # Two constants compared in a comparison, consider replacing `{left_constant} {} {right_constant}`
"PLR0206" , # Cannot have defined parameters for properties
"PLR0402" , # Use `from {module} import {name}` in lieu of alias
2023-12-26 03:19:13 +00:00
# "PLR0911", # Too many return statements ({returns} > {max_returns})
# "PLR0912", # Too many branches ({branches} > {max_branches})
# "PLR0913", # Too many arguments to function call ({c_args} > {max_args})
# "PLR0915", # Too many statements ({statements} > {max_statements})
2023-12-26 03:15:37 +00:00
"PLR1701" , # Merge `isinstance` calls: `{expr}`
"PLR1711" , # Useless `return` statement at end of function
2023-12-26 03:19:13 +00:00
# "PLR1714", # Consider merging multiple comparisons: `{expr}`. Use a `set` if the elements are hashable.
2023-12-26 03:15:37 +00:00
"PLR1722" , # Use `sys.exit()` instead of `{name}`
2023-12-26 03:19:13 +00:00
# "PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
# "PLR5501", # Use `elif` instead of `else` then `if`, to reduce indentation
2023-12-26 03:15:37 +00:00
# pylint ('PLW')
"PLW0120" , # `else` clause on loop without a `break` statement; remove the `else` and de-indent all the code inside it
"PLW0127" , # Self-assignment of variable `{name}`
"PLW0129" , # Asserting on an empty string literal will never pass
"PLW0131" , # Named expression used without context
"PLW0406" , # Module `{name}` imports itself
"PLW0602" , # Using global for `{name}` but no assignment is done
2023-12-26 03:19:13 +00:00
# "PLW0603", # Using the global statement to update `{name}` is discouraged
2023-12-26 03:15:37 +00:00
"PLW0711" , # Exception to catch is the result of a binary `and` operation
"PLW1508" , # Invalid type for environment variable default; expected `str` or `None`
"PLW1509" , # `preexec_fn` argument is unsafe when using threads
2023-12-26 03:19:13 +00:00
# "PLW2901", # Outer {outer_kind} variable `{name}` overwritten by inner {inner_kind} target
2023-12-26 03:15:37 +00:00
"PLW3301" , # Nested `{}` calls can be flattened
# flake8-pytest-style ('PT')
2023-12-29 09:55:28 +00:00
"PT" ,
2023-12-26 03:15:37 +00:00
# flake8-use-pathlib ('PTH')
2023-12-26 03:19:13 +00:00
# NOT YET USED
2023-12-26 03:15:37 +00:00
# flake8-pyi ('PYI')
2023-12-26 03:19:13 +00:00
# NOT YET USED
2023-12-26 03:15:37 +00:00
# flake8-quotes ('Q')
2023-12-26 03:19:13 +00:00
# "Q000", # Double quotes found but single quotes preferred
# "Q001", # Single quote multiline found but double quotes preferred
2023-12-26 03:15:37 +00:00
"Q002" , # Single quote docstring found but double quotes preferred
"Q003" , # Change outer quotes to avoid escaping inner quotes
2024-01-02 02:22:08 +01:00
"Q004" , # Unnecessary escape on inner quote character
2023-12-26 03:15:37 +00:00
# flake8-return ('RET')
"RET501" , # Do not explicitly `return None` in function if it is the only possible return value
"RET502" , # Do not implicitly `return None` in function able to return non-`None` value
2023-12-26 03:19:13 +00:00
# "RET503", # Missing explicit `return` at the end of function able to return non-`None` value
# "RET504", # Unnecessary assignment to `{name}` before `return` statement
# "RET505", # Unnecessary `{branch}` after `return` statement
# "RET506", # Unnecessary `{branch}` after `raise` statement
2023-12-26 03:15:37 +00:00
"RET507" , # Unnecessary `{branch}` after `continue` statement
"RET508" , # Unnecessary `{branch}` after `break` statement
# flake8-raise ('RSE')
"RSE102" , # Unnecessary parentheses on raised exception
# ruff-specific rules ('RUF')
2023-12-26 03:19:13 +00:00
# "RUF001", # String contains ambiguous {}. Did you mean {}?
2023-12-26 03:15:37 +00:00
"RUF002" , # Docstring contains ambiguous {}. Did you mean {}?
2023-12-26 03:19:13 +00:00
# "RUF003", # Comment contains ambiguous {}. Did you mean {}?
2024-03-14 10:26:30 +00:00
"RUF005" , # Consider `{expression}` instead of concatenation
2023-12-26 03:15:37 +00:00
"RUF006" , # Store a reference to the return value of `asyncio.{method}`
"RUF007" , # Prefer `itertools.pairwise()` over `zip()` when iterating over successive pairs
"RUF008" , # Do not use mutable default values for dataclass attributes
"RUF009" , # Do not perform function call `{name}` in dataclass defaults
"RUF010" , # Use explicit conversion flag
2023-12-26 03:19:13 +00:00
# "RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
2024-01-04 04:06:41 +00:00
"RUF013" , # PEP 484 prohibits implicit `Optional`
2023-12-26 03:19:13 +00:00
# "RUF015", # Prefer `next({iterable})` over single element slice
2024-01-04 04:06:03 +00:00
"RUF016" , # Slice in indexed access to type `{value_type}` uses type `{index_type}` instead of an integer
2024-01-04 04:11:30 +00:00
"RUF017" , # Avoid quadratic list summation
2024-01-04 04:06:03 +00:00
"RUF018" , # Avoid assignment expressions in `assert` statements
2024-01-04 04:08:29 +00:00
"RUF019" , # Unnecessary key check before dictionary access
2024-01-04 04:06:03 +00:00
"RUF020" , # `{never_like} | T` is equivalent to `T`
2023-12-26 03:19:13 +00:00
# "RUF100", # Unused `noqa` directive
2024-01-04 04:06:03 +00:00
"RUF200" , # Failed to parse pyproject.toml: {message}
2023-12-26 03:15:37 +00:00
# flake8-bandit ('S')
2023-12-26 03:19:13 +00:00
# "S101", # Use of `assert` detected
2023-12-26 03:15:37 +00:00
"S102" , # Use of `exec` detected
"S103" , # `os.chmod` setting a permissive mask `{mask:#o}` on file or directory
"S104" , # Possible binding to all interfaces
2023-12-26 03:19:13 +00:00
# "S105", # Possible hardcoded password assigned to: "{}"
2023-12-26 03:15:37 +00:00
"S106" , # Possible hardcoded password assigned to argument: "{}"
"S107" , # Possible hardcoded password assigned to function default: "{}"
"S108" , # Probable insecure usage of temporary file or directory: "{}"
2023-12-26 03:19:13 +00:00
# "S110", # `try`-`except`-`pass` detected, consider logging the exception
2023-12-26 03:15:37 +00:00
"S112" , # `try`-`except`-`continue` detected, consider logging the exception
2023-12-26 03:19:13 +00:00
# "S113", # Probable use of requests call without timeout
# "S301", # `pickle` and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue
2023-12-26 03:15:37 +00:00
"S302" , # Deserialization with the `marshal` module is possibly dangerous
"S303" , # Use of insecure MD2, MD4, MD5, or SHA1 hash function
"S304" , # Use of insecure cipher, replace with a known secure cipher such as AES
"S305" , # Use of insecure cipher mode, replace with a known secure cipher such as AES
"S306" , # Use of insecure and deprecated function (`mktemp`)
2024-02-01 16:11:44 -08:00
"S307" , # Use of possibly insecure function; consider using `ast.literal_eval`
2023-12-26 03:15:37 +00:00
"S308" , # Use of `mark_safe` may expose cross-site scripting vulnerabilities
"S310" , # Audit URL open for permitted schemes. Allowing use of `file:` or custom schemes is often unexpected.
"S311" , # Standard pseudo-random generators are not suitable for cryptographic purposes
"S312" , # Telnet-related functions are being called. Telnet is considered insecure. Use SSH or some other encrypted protocol.
"S313" , # Using `xml` to parse untrusted data is known to be vulnerable to XML attacks; use `defusedxml` equivalents
"S314" , # Using `xml` to parse untrusted data is known to be vulnerable to XML attacks; use `defusedxml` equivalents
"S315" , # Using `xml` to parse untrusted data is known to be vulnerable to XML attacks; use `defusedxml` equivalents
"S316" , # Using `xml` to parse untrusted data is known to be vulnerable to XML attacks; use `defusedxml` equivalents
"S317" , # Using `xml` to parse untrusted data is known to be vulnerable to XML attacks; use `defusedxml` equivalents
"S318" , # Using `xml` to parse untrusted data is known to be vulnerable to XML attacks; use `defusedxml` equivalents
"S319" , # Using `xml` to parse untrusted data is known to be vulnerable to XML attacks; use `defusedxml` equivalents
"S320" , # Using `lxml` to parse untrusted data is known to be vulnerable to XML attacks
"S321" , # FTP-related functions are being called. FTP is considered insecure. Use SSH/SFTP/SCP or some other encrypted protocol.
"S323" , # Python allows using an insecure context via the `_create_unverified_context` that reverts to the previous behavior that does not validate certificates or perform hostname checks.
2023-12-26 03:19:13 +00:00
# "S324", # Probable use of insecure hash functions in `hashlib`: `{string}`
2023-12-26 03:15:37 +00:00
"S501" , # Probable use of `{string}` call with `verify=False` disabling SSL certificate checks
"S506" , # Probable use of unsafe loader `{name}` with `yaml.load`. Allows instantiation of arbitrary objects. Consider `yaml.safe_load`.
"S508" , # The use of SNMPv1 and SNMPv2 is insecure. Use SNMPv3 if able.
"S509" , # You should not use SNMPv3 without encryption. `noAuthNoPriv` & `authNoPriv` is insecure.
"S601" , # Possible shell injection via Paramiko call; check inputs are properly sanitized
"S602" , # `subprocess` call with `shell=True` seems safe, but may be changed in the future; consider rewriting without `shell`
2023-12-26 03:19:13 +00:00
# "S603", # `subprocess` call: check for execution of untrusted input
2023-12-26 03:15:37 +00:00
"S604" , # Function call with `shell=True` parameter identified, security issue
"S605" , # Starting a process with a shell: seems safe, but may be changed in the future; consider rewriting without `shell`
"S606" , # Starting a process without a shell
2023-12-26 03:19:13 +00:00
# "S607", # Starting a process with a partial executable path
2023-12-26 03:15:37 +00:00
"S608" , # Possible SQL injection vector through string-based query construction
"S609" , # Possible wildcard injection in call due to `*` usage
"S612" , # Use of insecure `logging.config.listen` detected
2023-12-26 03:19:13 +00:00
# "S701", # Using jinja2 templates with `autoescape=False` is dangerous and can lead to XSS. Ensure `autoescape=True` or use the `select_autoescape` function.
2024-01-02 02:22:08 +01:00
# "S702", # Mako templates allow HTML and JavaScript rendering by default and are inherently open to XSS attacks
2024-04-15 01:58:20 +01:00
# flake8-simplify ('SIM')
2024-03-14 11:33:17 +00:00
"SIM" , # flake8-simplify
2023-12-26 03:15:37 +00:00
# flake8-self ('SLF')
2023-12-26 03:19:13 +00:00
# NOT YET USED
2024-04-15 01:58:20 +01:00
# flake8-slots ('SLOT')
"SLOT" ,
2023-12-29 09:55:28 +00:00
# flake8-debugger ('T10')
2023-12-26 03:15:37 +00:00
"T100" , # Trace found: `{name}` used
2023-12-29 09:55:28 +00:00
# flake8-print ('T20')
2023-12-26 03:15:37 +00:00
"T201" , # `print` found
"T203" , # `pprint` found
2024-04-15 01:58:20 +01:00
# flake8-type-checking ('TCH')
"TCH" ,
2023-12-26 03:15:37 +00:00
# flake8-todos ('TD')
2023-12-26 03:19:13 +00:00
# "TD001", # Invalid TODO tag: `{tag}`
# "TD003", # Missing issue link on the line following this TODO
# "TD004", # Missing colon in TODO
# "TD005", # Missing issue description after `TODO`
2023-12-26 03:15:37 +00:00
"TD006" , # Invalid TODO capitalization: `{tag}` should be `TODO`
"TD007" , # Missing space after colon in TODO
# flake8-tidy-imports ('TID')
"TID251" , # `{name}` is banned: {message}
"TID252" , # Relative imports from parent modules are banned
2024-01-02 02:22:08 +01:00
"TID253" , # `{name}` is banned at the module level
2024-01-04 02:53:12 +00:00
# flake8-trio ('TRIO')
2024-01-04 04:14:09 +00:00
# Trio is not used in Sphinx
2023-12-26 03:15:37 +00:00
# tryceratops ('TRY')
2023-12-26 03:19:13 +00:00
# NOT YET USED
2024-04-15 01:58:20 +01:00
# pyupgrade ('UP')
"UP" ,
2023-12-26 03:15:37 +00:00
# pycodestyle ('W')
2024-04-22 22:54:53 +01:00
"W" ,
2023-12-26 03:15:37 +00:00
# flake8-2020 ('YTT')
2023-12-29 09:55:28 +00:00
"YTT" ,
2023-12-26 03:09:59 +00:00
]
2024-01-01 23:19:54 +01:00
[ lint . per-file-ignores ]
2024-01-13 21:02:37 +00:00
"doc/*" = [
"ANN" , # documentation doesn't need annotations
]
2024-03-25 11:39:05 +01:00
"doc/conf.py" = [ "INP001" , "W605" ]
2023-12-26 03:09:59 +00:00
"doc/development/tutorials/examples/*" = [ "INP001" ]
# allow print() in the tutorial
2024-04-12 20:35:39 +01:00
"doc/development/tutorials/examples/recipe.py" = [
"FURB118" ,
"T201"
]
2024-01-21 21:25:05 +01:00
"sphinx/domains/**" = [ "FURB113" ]
"tests/test_domains/test_domain_cpp.py" = [ "FURB113" ]
2023-12-26 03:09:59 +00:00
# from .flake8
"sphinx/*" = [ "E241" ]
2024-04-29 03:03:15 +01:00
# whitelist ``print`` for stdout messages
"sphinx/_cli/__init__.py" = [ "T201" ]
2023-12-26 03:09:59 +00:00
# whitelist ``print`` for stdout messages
"sphinx/cmd/build.py" = [ "T201" ]
"sphinx/cmd/make_mode.py" = [ "T201" ]
"sphinx/cmd/quickstart.py" = [ "T201" ]
"sphinx/environment/collectors/toctree.py" = [ "B026" ]
"sphinx/environment/adapters/toctree.py" = [ "B026" ]
# whitelist ``print`` for stdout messages
2024-04-20 00:47:30 +01:00
"sphinx/ext/intersphinx/_cli.py" = [ "T201" ]
2023-12-26 03:09:59 +00:00
# whitelist ``print`` for stdout messages
"sphinx/testing/fixtures.py" = [ "T201" ]
# Ruff bug: https://github.com/astral-sh/ruff/issues/6540
"sphinx/transforms/i18n.py" = [ "PGH004" ]
2024-01-14 21:13:46 +00:00
# Function wrappers
"sphinx/ext/autodoc/importer.py" = [ "D402" ]
"sphinx/util/requests.py" = [ "D402" ]
2023-12-26 03:09:59 +00:00
"tests/*" = [
"E501" ,
2024-01-13 20:48:09 +00:00
"ANN" , # tests don't need annotations
2024-01-14 21:13:46 +00:00
"D402" ,
2023-12-26 03:48:22 +00:00
"T201" , # whitelist ``print`` for tests
2023-12-26 03:09:59 +00:00
]
# these tests need old ``typing`` generic aliases
2024-01-17 02:38:46 +00:00
"tests/test_util/test_util_typing.py" = [ "UP006" , "UP035" ]
"tests/test_util/typing_test_data.py" = [ "FA100" , "UP006" , "UP035" ]
2023-12-26 03:09:59 +00:00
2024-01-13 21:02:37 +00:00
"utils/*" = [
"T201" , # whitelist ``print`` for stdout messages
"ANN" , # utilities don't need annotations
]
2023-12-26 03:09:59 +00:00
2024-01-01 23:19:54 +01:00
[ lint . flake8-quotes ]
2023-12-26 03:09:59 +00:00
inline-quotes = "single"
2024-01-17 02:38:46 +00:00
[ lint . isort ]
forced-separate = [
"tests" ,
]
2024-03-19 10:27:41 +01:00
[ format ]
2024-03-19 15:23:57 +01:00
preview = true
2024-03-19 10:27:41 +01:00
quote-style = "single"
exclude = [
2024-04-29 03:03:15 +01:00
"sphinx/_cli/*" ,
2024-03-19 10:27:41 +01:00
"sphinx/addnodes.py" ,
"sphinx/application.py" ,
2024-04-29 02:07:47 +01:00
"sphinx/builders/*" ,
"sphinx/cmd/*" ,
2024-03-19 10:27:41 +01:00
"sphinx/config.py" ,
2024-04-29 02:07:47 +01:00
"sphinx/directives/*" ,
"sphinx/domains/*" ,
"sphinx/environment/*" ,
"sphinx/ext/*" ,
"sphinx/pycode/*" ,
2024-03-19 10:27:41 +01:00
"sphinx/pygments_styles.py" ,
"sphinx/registry.py" ,
2024-04-29 02:07:47 +01:00
"sphinx/search/*" ,
"sphinx/testing/*" ,
"sphinx/transforms/*" ,
"sphinx/util/*" ,
"sphinx/writers/*" ,
"tests/*" ,
"tests/roots/*" ,
"tests/test_builders/*" ,
"tests/test_config/*" ,
"tests/test_directives/*" ,
"tests/test_domains/*" ,
"tests/test_environment/*" ,
"tests/test_extensions/*" ,
"tests/test_intl/*" ,
"tests/test_markup/*" ,
"tests/test_pycode/*" ,
"tests/test_transforms/*" ,
"tests/test_util/*" ,
"tests/test_writers/*" ,
2024-03-19 10:27:41 +01:00
]