Skip to content

Commit f298795

Browse files
authored
Merge pull request #18 from brews/tune_ruff
Tune ruff config, using xarray's setup to start
2 parents 0eaa5c7 + 41aa7df commit f298795

4 files changed

Lines changed: 40 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
- Improved README.
1919
- Improved CONTRIBUTING.
2020
- Add project URLs to package metadata.
21+
- Various improvement to internal code formatting and style.
2122

2223
## [0.1.0] - 2026-05-06
2324

pyproject.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,34 @@ dev = [
2626
{ include-group = "tests" },
2727
"prek>=0.3.13",
2828
]
29+
30+
[tool.ruff.lint]
31+
extend-select = [
32+
"YTT", # flake8-2020
33+
"B", # flake8-bugbear
34+
"C4", # flake8-comprehensions
35+
"ISC", # flake8-implicit-str-concat
36+
"PIE", # flake8-pie
37+
"TID", # flake8-tidy-imports (absolute imports)
38+
"PYI", # flake8-pyi
39+
"SIM", # flake8-simplify
40+
"FLY", # flynt
41+
"I", # isort
42+
"PERF", # Perflint
43+
"W", # pycodestyle warnings
44+
"PGH", # pygrep-hooks
45+
"PLC", # Pylint Convention
46+
"PLE", # Pylint Errors
47+
"PLR", # Pylint Refactor
48+
"PLW", # Pylint Warnings
49+
"UP", # pyupgrade
50+
"FURB", # refurb
51+
"RUF",
52+
]
53+
54+
[tool.ruff.lint.isort]
55+
known-first-party = ["isku"]
56+
57+
[tool.ruff.lint.flake8-tidy-imports]
58+
# Disallow all relative imports.
59+
ban-relative-imports = "all"

src/isku/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1+
from collections.abc import Callable
12
from dataclasses import dataclass
2-
from typing import Protocol, Callable
3+
from typing import Protocol
34

45
import xarray as xr
56

6-
77
__all__ = [
8+
"ExtractionWorkflow",
9+
"GridWeightingRegions",
10+
"ProjectionWorkflow",
11+
"RegionExtractor",
812
"build_extraction_workflow",
9-
"extract_regions",
1013
"build_projection_workflow",
14+
"extract_regions",
1115
"project",
12-
"GridWeightingRegions",
13-
"ExtractionWorkflow",
14-
"RegionExtractor",
15-
"ProjectionWorkflow",
1616
]
1717

1818

tests/smoke_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55
import xarray as xr
6+
67
import isku
78

89

0 commit comments

Comments
 (0)