-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathpyproject.toml
134 lines (112 loc) · 4.43 KB
/
pyproject.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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
[tool.ruff]
line-length = 88
target-version = "py310"
[tool.ruff.format]
preview = false
[tool.ruff.lint]
ignore = [
# NOTE: Non-permanent exclusions should be added to the ".ruff.toml" file.
# flake8-commas (COM)
# https://docs.astral.sh/ruff/rules/#flake8-commas-com
"COM812", # Trailing comma missing.
"COM819", # Trailing comma prohibited.
# flake8-implicit-str-concat (ISC)
# https://docs.astral.sh/ruff/rules/single-line-implicit-string-concatenation/
# NOTE: This rule may cause conflicts when used with "ruff format".
"ISC001", # Implicitly concatenate string literals on one line.
]
preview = false
select = [
"ALL",
# list specific rules to include that is skipped using numpy convention.
"D212", # Multi-line docstring summary should start at the first line
]
[tool.ruff.lint.isort]
force-sort-within-sections = true
known-first-party = ["iris"]
[tool.ruff.lint.per-file-ignores]
# Test script.
"run_test.py" = [
# https://docs.astral.sh/ruff/rules/undocumented-public-module/
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D205", # 1 blank line required between summary line and description
"D401", # 1 First line of docstring should be in imperative mood
"ANN", # https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"S101", # Use of assert detected
]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.numpydoc_validation]
checks = [
"all", # Enable all numpydoc validation rules, apart from the following:
# -> Docstring text (summary) should start in the line immediately
# after the opening quotes (not in the same line, or leaving a
# blank line in between)
"GL01", # Permit summary line on same line as docstring opening quotes.
# -> Closing quotes should be placed in the line after the last text
# in the docstring (do not close the quotes in the same line as
# the text, or leave a blank line between the last text and the
# quotes)
"GL02", # Permit a blank line before docstring closing quotes.
# -> Double line break found; please use only one blank line to
# separate sections or paragraphs, and do not leave blank lines
# at the end of docstrings
"GL03", # Ignoring.
# -> See Also section not found
"SA01", # Not all docstrings require a "See Also" section.
# -> No extended summary found
"ES01", # Not all docstrings require an "Extended Summary" section.
# -> No examples section found
"EX01", # Not all docstrings require an "Examples" section.
# -> No Yields section found
"YD01", # Not all docstrings require a "Yields" section.
]
exclude = [
'\.__eq__$',
'\.__ne__$',
'\.__repr__$',
]
[tool.mypy]
# See https://mypy.readthedocs.io/en/stable/config_file.html
ignore_missing_imports = true
warn_unused_configs = true
warn_unreachable = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
exclude = [
"^run_test\\.py$",
]
strict = true
[tool.pytest.ini_options]
# configure settings as recommended by repo-review:
addopts = ["-ra", "--strict-config", "--strict-markers"]
filterwarnings = ["error"]
log_cli = "True"
log_cli_level = "INFO"
minversion = "6.0"
testpaths = "./run_test.py"
xfail_strict = "True"
[tool.repo-review]
ignore = [
# https://learn.scientific-python.org/development/guides/style/#PC170
"PC170", # Uses PyGrep hooks
# https://learn.scientific-python.org/development/guides/style/#PC180
"PC180", # Uses prettier
# https://learn.scientific-python.org/development/guides/gha-basic/
"GH", # TODO: switch to GitHub Actions
# test-iris-imagehash is very simple, and not a package, which exempts the
# following rules.
# https://learn.scientific-python.org/development/guides/style/#PP002
"PP002", # Build-system
# https://learn.scientific-python.org/development/guides/style/#PP003
"PP003", # Wheel dependency
# https://learn.scientific-python.org/development/guides/style/#PY004
"PY004", # Docs folder
# https://learn.scientific-python.org/development/guides/style/#PY007
"PY007", # Nox/tox
# https://learn.scientific-python.org/development/guides/style/#RF003
"RF003", # Ruff src directory
# https://learn.scientific-python.org/development/guides/docs/#readthedocsyaml
"RTD", # ReadTheDocs
]