-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy path.ruff.toml
70 lines (64 loc) · 2.71 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
70
extend = "pyproject.toml"
exclude = [
".git",
"__pycache__",
"docs",
".eggs",
"build",
"dist",
".tox",
".eggs",
]
line-length = 100
target-version = "py311"
[format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true
[lint]
select = [
"F", # Pyflakes (part of default flake8)
"E", # pycodestyle (part of default flake8)
"W", # pycodestyle (part of default flake8)
#"D", # docstrings, see also numpydoc pre-commit action
"N", # pep8-naming (naming conventions)
"A", # flake8-builtins (prevent shadowing of builtins)
#"ARG", # flake8-unused-arguments (prevent unused arguments)
"B", # flake8-bugbear (miscellaneous best practices to avoid bugs)
"C4", # flake8-comprehensions (best practices for comprehensions)
"ICN", # flake8-import-conventions (enforce import conventions)
"INP", # flake8-no-pep420 (prevent use of PEP420, i.e. implicit name spaces)
"ISC", # flake8-implicit-str-concat (conventions for concatenating long strings)
"LOG", # flake8-logging
"NPY", # numpy-specific rules
"PGH", # pygrep-hooks (ensure appropriate usage of noqa and type-ignore)
"PTH", # flake8-use-pathlib (enforce using Pathlib instead of os)
"S", # flake8-bandit (security checks)
"SLF", # flake8-self (prevent using private class members outside class)
"SLOT", # flake8-slots (require __slots__ for immutable classes)
"T20", # flake8-print (prevent print statements in code)
"TRY", # tryceratops (best practices for try/except blocks)
"UP", # pyupgrade (simplified syntax allowed by newer Python versions)
"YTT", # flake8-2020 (prevent some specific gotchas from sys.version)
]
ignore = [
"D100", # missing docstring in public module
"E741", # ambiguous variable name (O/0, l/I, etc.)
"UP008", # use super() instead of super(class, self). no harm being explicit
"UP015", # unnecessary open(file, "r"). no harm being explicit
"TRY003", # prevents custom exception messages not defined in exception itself.
"ISC001", # single line implicit string concatenation. formatter recommends ignoring this.
"PTH123", # use Path.open instead of open
"UP038", # isinstance with | instead of ,
# longer term fix
"S101", # asserts are used in many non-test places
"SLF001", # private member access, this is overly restrictive
]
[lint.pydocstyle]
convention = "numpy"
[lint.flake8-annotations]
ignore-fully-untyped = true # Turn of annotation checking for fully untyped code
[lint.per-file-ignores]
"**/test_*.py" = ["S101", "SLF001", "B011"]
"tests/**" = ["INP001"]
"src/stdatamodels/jwst/datamodels/darkMIRI.py" = ["N999"]