@@ -68,10 +68,10 @@ where = ["src"]
6868write_to = " src/stratify/_version.py"
6969local_scheme = " dirty-tag"
7070
71- [tool .black ]
72- target-version = [" py310" , " py311" , " py312" ]
73- line-length = 88
74- include = ' \.pyi?$'
71+ # [tool.black]
72+ # target-version = ["py310", "py311", "py312"]
73+ # line-length = 88
74+ # include = '\.pyi?$'
7575
7676[tool .isort ]
7777profile = " black"
@@ -88,3 +88,169 @@ ignore = [
8888[tool .pytest .ini_options ]
8989addopts = " -ra -v --doctest-modules"
9090testpaths = [" src/stratify" ]
91+
92+ [tool .mypy ]
93+ disable_error_code = [" call-arg" , " no-untyped-def" , " no-untyped-call" , " attr-defined" , " misc" , " index" , " var-annotated" , " assignment" ]
94+ enable_error_code = [" ignore-without-code" , " truthy-bool" , " redundant-expr" ]
95+ warn_unreachable = true
96+ strict = true
97+ # exclude = [
98+ # No common agreement yet
99+ # NOTE: these exclusions must also appear in pre-commit-config.yaml.
100+ # https://stackoverflow.com/questions/77350979/running-pre-commits-excluding-a-directory-for-multiples-hooks/77352664#77352664
101+ # ]
102+ # NOTE: Non-permanent disabling should be done via the ".mypy.ini" file.
103+ # disable_error_code = No common agreement yet
104+
105+ [tool .numpydoc_validation ]
106+ checks = [
107+ " all" , # Enable all numpydoc validation rules, apart from the following:
108+
109+ # -> Docstring text (summary) should start in the line immediately
110+ # after the opening quotes (not in the same line, or leaving a
111+ # blank line in between)
112+ " GL01" , # Permit summary line on same line as docstring opening quotes.
113+
114+ # -> Closing quotes should be placed in the line after the last text
115+ # in the docstring (do not close the quotes in the same line as
116+ # the text, or leave a blank line between the last text and the
117+ # quotes)
118+ " GL02" , # Permit a blank line before docstring closing quotes.
119+
120+ # -> Double line break found; please use only one blank line to
121+ # separate sections or paragraphs, and do not leave blank lines
122+ # at the end of docstrings
123+ " GL03" , # Ignoring.
124+
125+ " GL08" ,
126+
127+ " PR01" ,
128+ " PR02" ,
129+ " PR10" ,
130+ " RT04" ,
131+ " SS06" ,
132+
133+
134+ # -> See Also section not found
135+ " SA01" , # Not all docstrings require a "See Also" section.
136+
137+ # -> No extended summary found
138+ " ES01" , # Not all docstrings require an "Extended Summary" section.
139+
140+ # -> No examples section found
141+ " EX01" , # Not all docstrings require an "Examples" section.
142+
143+ # -> No Yields section found
144+ " YD01" , # Not all docstrings require a "Yields" section.
145+
146+ # Record temporarily ignored checks below; will be reviewed at a later date:
147+
148+ ]
149+ exclude = [
150+ ' \.__eq__$' ,
151+ ' \.__ne__$' ,
152+ ' \.__repr__$' ,
153+ ]
154+
155+ [tool .ruff ]
156+ line-length = 88
157+
158+ [tool .ruff .format ]
159+ preview = false
160+
161+ [tool .ruff .lint ]
162+ ignore = [
163+ # NOTE: Non-permanent exclusions should be added to the ".ruff.toml" file.
164+ " ERA001" ,
165+ " RUF005" ,
166+ " D100" ,
167+ " B028" ,
168+ " D101" ,
169+ " RUF012" ,
170+ " ANN201" ,
171+ " D102" ,
172+ " T201" ,
173+ " C419" ,
174+ " D104" ,
175+ " D106" ,
176+ " ANN202" ,
177+ " SLF001" ,
178+ " N801" ,
179+ " D205" ,
180+ " PT009" ,
181+ " PT027" ,
182+ " ANN001" ,
183+ " ARG002" ,
184+ " ARG003" ,
185+ " ANN002" ,
186+ " ANN204" ,
187+ " D103" ,
188+ " FBT002" ,
189+ " ANN003" ,
190+ " RET504" ,
191+ " C405" ,
192+ " PLR2004" ,
193+
194+
195+ # flake8-commas (COM)
196+ # https://docs.astral.sh/ruff/rules/#flake8-commas-com
197+ " COM812" , # Trailing comma missing.
198+ " COM819" , # Trailing comma prohibited.
199+
200+ # flake8-implicit-str-concat (ISC)
201+ # https://docs.astral.sh/ruff/rules/single-line-implicit-string-concatenation/
202+ # NOTE: This rule may cause conflicts when used with "ruff format".
203+ " ISC001" , # Implicitly concatenate string literals on one line.
204+ ]
205+ preview = false
206+ select = [
207+ " ALL" ,
208+ # list specific rules to include that is skipped using numpy convention.
209+ " D212" , # Multi-line docstring summary should start at the first line
210+ ]
211+
212+ [tool .ruff .lint .isort ]
213+ force-sort-within-sections = true
214+ # Change to match specific package name:
215+ known-first-party = [" iris" ]
216+
217+ [tool .ruff .lint .per-file-ignores ]
218+ # All test scripts
219+
220+ # Change to match specific package path:
221+ "lib/iris/tests/*.py" = [
222+ # https://docs.astral.sh/ruff/rules/undocumented-public-module/
223+ " D100" , # Missing docstring in public module
224+ " D205" , # 1 blank line required between summary line and description
225+ " D401" , # 1 First line of docstring should be in imperative mood
226+ ]
227+
228+ [tool .ruff .lint .pydocstyle ]
229+ convention = " numpy"
230+
231+ [tool .codespell ]
232+ ignore-words-list = " ND,Nd"
233+
234+ [tool .repo-review ]
235+ # These are a list of the currently failing tests to be fixed later:
236+ ignore = [
237+ " PY004" , # Has docs folder
238+ " PP302" , # Sets a minimum pytest to at least 6
239+ " PP304" , # Sets the log level in pytest
240+ " PP305" , # Specifies xfail_strict
241+ " PP306" , # Specifies strict config
242+ " PP307" , # Specifies strict markers
243+ " PP308" ,
244+ " PP309" , # Filter warnings specified
245+ " PY007" , # Supports an easy task runner (nox or tox)
246+ " PP003" , # Does not list wheel as a build-dep
247+ " PC111" , # Uses blacken-docs
248+ " PC140" , # Uses a type checker
249+ " PC160" , # Uses a spell checker
250+ " PC170" , # Uses PyGrep hooks (only needed if rST present)
251+ " PC180" , # Uses a markdown formatter
252+ " PC190" , # Uses Ruff
253+ " MY100" , # Uses MyPy (pyproject config)
254+ " RF001" , # Has Ruff config
255+ " RTD100" # Uses ReadTheDocs (pyproject config)
256+ ]
0 commit comments