-
Notifications
You must be signed in to change notification settings - Fork 96
Expand file tree
/
Copy pathruff.toml
More file actions
108 lines (95 loc) · 4.31 KB
/
ruff.toml
File metadata and controls
108 lines (95 loc) · 4.31 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Set the maximum line length to 105.
line-length = 105
extend-exclude = [
".git/**", # skip everything under .git
"tests/deprecated/**", # skip that entire directory tree
"runs/**", # skip anything under runs/
"*.ipynb", # skip all Jupyter notebooks
"*.rst", # skip ReST docs
"src/*",
"dep/*",
".venv/**",
"arkouda/_version.py", # This is a generated file
"*__init__.py",
]
# This should match the lowest supported version:
target-version = "py310"
[format]
quote-style = "double"
[lint]
# Enabled rule groups (select = [...]) and their meanings:
# ---------------------------------------------------------
# E - pycodestyle: general code style (whitespace, indentation, etc.)
# F - pyflakes: static analysis (undefined names, unused imports, etc.)
# I - isort: import sorting and grouping
# D - pydocstyle: docstring formatting and structure
# W - pycodestyle warnings (less common than E)
# A - flake8-builtins: avoid shadowing Python built-ins (e.g., `list`, `str`)
# B - flake8-bugbear: common bugs, unsafe patterns, and best practices
# C4 - flake8-comprehensions: suggest better list/set/dict comprehension patterns
# EM - flake8-errmsg: enforce raw strings or constants in exception messages
# ERA - eradicate: detect commented-out/dead code
# N - pep8-naming: enforce naming conventions for functions, classes, etc.
# PGH - pygrep-hooks: regex-based anti-patterns (e.g., TODOs, secrets, fixes)
# PIE - flake8-pie: miscellaneous Python best practices and bug prevention
# PL - pylint: subset of useful Pylint rules
# PT - flake8-pytest-style: pytest-specific idioms and anti-patterns
# PTH - flake8-use-pathlib: prefer pathlib over os.path/file operations
# RET - flake8-return: catch inconsistent or redundant return statements
# RUF - Ruff-native: Ruff-specific rules for clarity, safety, and idioms
# SIM - flake8-simplify: overly complex, redundant, or verbose code
# SLF - flake8-self: warns on accessing private members of other classes
# T20 - flake8-print: flag `print()` statements in production code
# UP - pyupgrade: recommend modern Python syntax (e.g., f-strings, `|` for union)
# YTT - flake8-2020: flag outdated or fragile Python version checks
# E501 - enforces maximum line length
select = ["E", "F", "D", "W", "A", "B", "C4", "EM", "ERA", "I", "N", "PGH", "PIE", "PL", "PT", "PTH", "RET","RUF", "SIM", "SLF", "T20", "UP", "YTT", "E501"]
fixable = ["I","D"]
ignore = [
"D100","D101","D102","D103","D105","D205","D401",
"A004","A002","A001",
"B905","B904","B028","B006","B007","B009","B010","B012","B033",
"C409","C419","C408","C416","C417","C401",
"EM102","EM101","EM103",
"ERA001",
"N803","N801","N815","N802","N816","N807","N818",
"PGH004","PGH003",
"PIE810","PIE808","PIE790",
"PLR0913","PLR0911","PLR0912","PLR0915","PLR1711","PLR1714","PLR2004","PLR5501","PLW2901","PLW0642","PLW0211","PLR1716","PLW0603","PLC0205",
"PT006","PT007","PT018",
"PTH100","PTH103","PTH107","PTH109","PTH110","PTH113","PTH111","PTH112","PTH118","PTH123","PTH207","PTH122","PTH120","PTH119","PTH208",
"RET501","RET505","RET504","RET506","RET503","RET507",
"RUF010","RUF022","RUF002","RUF046","RUF005","RUF007","RUF015","RUF100","RUF021","RUF023","RUF012","RUF059",
"SIM105","SIM108","SIM102","SIM201","SIM110","SIM101","SIM114","SIM118","SIM300","SIM401","SIM910","SIM103","SIM115",
"SLF001",
"UP038","UP024","UP032","UP045","UP007","UP006","UP035","UP031","UP015","UP037","UP034","UP018"
]
[lint.pep8-naming]
# These functions are allowed to be camelCase:
ignore-names = [
# These are kept to align with NumPy/Pandas:
"mT","XOR","AND","OR","T",
# These are deprecated and will be eventually removed:
"isSupportedDtype",
"isSupportedDType",
"isSupportedInt",
"isSupportedFloat",
"isSupportedNumber",
"isSupportedBool",
"getArkoudaLogger",
"getArkoudaClientLogger",
"enableVerbose",
"disableVerbose",
"BitVectorizer",
"globalGeneratorExists",
"getGlobalGenerator",
"changeLogLevel",
"getHandler",]
[lint.isort]
known-first-party = ["arkouda"]
combine-as-imports = false
lines-after-imports = 2
lines-between-types = 1
force-single-line = false
[lint.pydocstyle]
convention = "numpy" # <-- This enforces NumPy-style docstrings