-
Notifications
You must be signed in to change notification settings - Fork 13
/
.ruff.toml
78 lines (74 loc) · 1.83 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
77
78
target-version = "py310"
line-length = 110
exclude = [
".git,",
"__pycache__",
"build",
"dkist/version.py",
"dkist/_dev/",
]
[lint]
select = [
"F",
"E",
"W",
"UP",
"C4",
"ICN",
"G",
"INP",
"PT",
"Q",
"RSE",
"RET",
"TID",
"PTH",
"NPY",
"RUF",
]
extend-ignore = [
# pycodestyle (E, W)
"E501", # LineTooLong # TODO! fix
"E702",
"E711",
"E741",
"F405",
"F403",
"F821",
"F841",
# pytest (PT)
"PT001", # Always use pytest.fixture()
"PT004", # Fixtures which don't return anything should have leading _
"PT007", # Parametrize should be lists of tuples # TODO! fix
"PT011", # Too broad exception assert # TODO! fix
"PT023", # Always use () on pytest decorators
# pyupgrade
"UP038", # Use | in isinstance - not compatible with models and is slower
# Returns (RET)
"RET502", # Do not implicitly return None in function able to return non-None value
"RET503", # Missing explicit return at the end of function able to return non-None value
# Pathlib (PTH)
"PTH123", # open() should be replaced by Path.open()
# Ruff
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"RUF013", # PEP 484 prohibits implicit `Optional`
"RUF015", # Prefer `next(iter(...))` over single element slice
]
[lint.per-file-ignores]
# Part of configuration, not a package.
"setup.py" = ["INP001"]
"conftest.py" = ["INP001"]
"docs/conf.py" = [
"E402" # Module imports not at top of file
]
"docs/*.py" = [
"INP001", # Implicit-namespace-package. The examples are not a package.
]
"__init__.py" = ["E402", "F401", "F403"]
"test_*.py" = ["B011", "D", "E402", "PGH001", "S101"]
"dkist/logger.py" = ["PTH"]
[lint.flake8-import-conventions.extend-aliases]
"astropy.units" = "u"
"sunpy.net.attrs" = "a"
[lint.pydocstyle]
convention = "numpy"