-
Notifications
You must be signed in to change notification settings - Fork 0
/
ruff.toml
69 lines (63 loc) · 3.91 KB
/
ruff.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
line-length = 88
indent-width = 4
exclude = ["build", "dist", "env", ".venv"]
[format]
quote-style = "double"
indent-style = "space"
[lint]
ignore = [
"PLR0913",
"TCH001",
"COM812",
"ISC001",
"TCH002",
"S603"# https://github.com/astral-sh/ruff/issues/4045
]
select = [
# Rules reference: https://docs.astral.sh/ruff/rules/
# Code Style / Formatting
"E", # pycodestyle: checks adherence to PEP 8 conventions including spacing, indentation, and line length
"W", # pycodestyle: checks adherence to PEP 8 conventions including spacing, indentation, and line length
"A", # flake8-builtins: prevents shadowing of Python built-in names
"C", # Convention: ensures code adheres to specific style and formatting conventions
"COM", # flake8-commas: enforces the correct use of trailing commas
"ERA", # eradicate: detects commented-out code that should be removed
"I", # isort: ensures imports are sorted in a consistent manner
"ICN", # flake8-import-conventions: enforces import conventions for better readability
"N", # pep8-naming: enforces PEP 8 naming conventions for classes, functions, and variables
"NPY", # NumPy: enforces best practices for using the NumPy library
"PD", # pandas-vet: enforces best practices for using the pandas library
"PT", # flake8-pytest-style: enforces best practices and style conventions for pytest tests
"PTH", # flake8-use-pathlib: encourages the use of pathlib over os.path for file system operations
"Q", # flake8-quotes: enforces consistent use of single or double quotes
"TCH", # flake8-type-checking: enforces type checking practices and standards
"TID", # flake8-tidy-imports: enforces tidy and well-organized imports
"RUF022", # flake8-ruff: enforce sorting of __all__ in modules
# Code Structure / Complexity
"C4", # flake8-comprehensions: improves readability and performance of list, set, and dict comprehensions
"C90", # mccabe: checks for overly complex code using cyclomatic complexity
"ISC", # flake8-implicit-str-concat: prevents implicit string concatenation
"PIE", # flake8-pie: identifies and corrects common code inefficiencies and mistakes
"R", # Refactor: suggests improvements to code structure and readability
"SIM", # flake8-simplify: simplifies complex expressions and improves code readability
# Code Security / Bug Prevention
"ARG", # flake8-unused-arguments: detects unused function and method arguments
"ASYNC", # flake8-async: identifies incorrect or inefficient usage patterns in asynchronous code
"B", # flake8-bugbear: detects common programming mistakes and potential bugs
"BLE", # flake8-blind-except: prevents blind exceptions that catch all exceptions without handling
"E", # Error: detects and reports errors in the code
"F", # Pyflakes: detects unused imports, shadowed imports, undefined variables, and various formatting errors in string operations
"INP", # flake8-no-pep420: prevents implicit namespace packages by requiring __init__.py
"PGH", # pygrep-hooks: detects deprecated and dangerous code patterns
"PL", # Pylint: comprehensive source code analyzer for enforcing coding standards and detecting errors
"RSE", # flake8-raise: ensures exceptions are raised correctly
"S", # flake8-bandit: detects security issues and vulnerabilities in the code
"SLF", # flake8-self: prevents incorrect usage of the self argument in class methods
"T10", # flake8-debugger: detects the presence of debugging tools such as pdb
"T20", # flake8-print: detects print statements left in the code
"UP", # pyupgrade: automatically upgrades syntax for newer versions of Python
"W", # Warning: provides warnings about potential issues in the code
"YTT", # flake8-2020: identifies code that will break with future Python releases
# Code Documentation
"FIX", # flake8-fixme: detects FIXMEs and other temporary comments that should be resolved
]