-
Notifications
You must be signed in to change notification settings - Fork 262
/
ruff.toml
76 lines (72 loc) · 2.77 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
71
72
73
74
75
76
include = ["src/fairchem/core/**/*.py", "src/fairchem/data/oc/**/*.py", "tests/**/*.py"]
line-length = 88
[lint]
select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"E", # pycodestyle error
"EXE", # flake8-executable
"F", # pyflakes
"FA", # flake8-future-annotations
"FBT003", # boolean-positional-value-in-call
"FLY", # flynt
"I", # isort
"ICN", # flake8-import-conventions
"PD", # pandas-vet
"PERF", # perflint
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PYI", # flakes8-pyi
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # Ruff-specific rules
"SIM", # flake8-simplify
"SLOT", # flake8-slots
"TCH", # flake8-type-checking
"TID", # tidy imports
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"W", # pycodestyle warning
"YTT", # flake8-2020
]
ignore = [
"PLR", # Design related pylint codes
"E501", # Line too long
"B028", # No explicit stacklevel
"EM101", # Exception must not use a string literal
"EM102", # Exception must not use an f-string literal
"G004", # f-string in Logging statement
"RUF015", # Prefer next(iter())
"RET505", # Unnecessary `elif` after `return`
"PT004", # Fixture does not return anthing
"B017", # pytest.raises
"PT011", # pytest.raises
"PT012", # pytest.raises"
"E741", # ambigous variable naming, i.e. one letter
"FBT003", # boolean positional variable in function call
"PERF203", # `try`-`except` within a loop incurs performance overhead (no overhead in Py 3.11+)
"EXE002", # The file is executable but no shebang is present (not sure why some files come up as this)
"PLC2401", # non ASCII characters
]
unfixable = [
"T20", # Removes print statements
"F841", # Removes unused variables
]
[lint.isort]
known-first-party = ["fairchem.core"]
required-imports = ["from __future__ import annotations"]
[lint.pydocstyle]
convention = "google"
[lint.per-file-ignores]
# Ignore `E402` (import violations) in all `__init__.py` files, and in `path/to/file.py`.
"src/fairchem/core/__init__.py" = ["I002"]
"src/fairchem/core/conf.py" = ["I002"]
"src/fairchem/core/common/*" = ["PLW0603"] # Using the global statement to update [] is discouraged
"src/fairchem/core/scripts/*" = ["PLW0603"] # Using the global statement to update [] is discouraged
"src/fairchem/core/models/*" = ["PERF401"] # Use a list comprehension to create a transformed list
"src/fairchem/core/models/gemnet*" = ["B023"] # Function definition does not bind loop variable `first_sph`
# Ignore `E402` (import violations) in all `__init__.py` files, and in `path/to/file.py`.
"src/fairchem/data/oc/core/__init__.py" = ["F401"]
"src/fairchem/data/oc/utils/__init__.py" = ["F401"]