Skip to content

Commit 1151dba

Browse files
authored
Merge pull request #93 from d-v-b/chore/stronger-linting
chore/stronger linting
2 parents bacb58e + c05faf4 commit 1151dba

52 files changed

Lines changed: 696 additions & 1187 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pre-commit-config.yaml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,11 @@ repos:
44
hooks:
55
- id: validate-pyproject
66

7-
- repo: https://github.com/PyCQA/isort
8-
rev: 6.0.1
9-
hooks:
10-
- id: isort
11-
language_version: python
12-
137
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.13.1
8+
rev: v0.14.3
159
hooks:
16-
- id: ruff
17-
args: ["--fix"]
10+
- id: ruff-check
11+
args: ["--fix", "--show-fixes"]
1812
- id: ruff-format
1913

2014
- repo: https://github.com/pre-commit/mirrors-mypy

pyproject.toml

Lines changed: 55 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ dependencies = [
4747
dev = [
4848
"pytest>=7.0.0",
4949
"pytest-cov>=4.0.0",
50-
"black>=23.0.0",
51-
"isort>=5.12.0",
52-
"flake8>=6.0.0",
53-
"flake8-docstrings>=1.7.0",
5450
"mypy>=1.0.0",
5551
"pre-commit>=3.0.0",
5652
"bandit[toml]>=1.7.0",
@@ -92,32 +88,62 @@ include = ["eopf_geozarr*"]
9288
[tool.setuptools.package-data]
9389
"*" = ["*.md", "*.txt", "*.yml", "*.yaml"]
9490

95-
[tool.black]
91+
[tool.ruff]
9692
line-length = 100
97-
target-version = ['py310', 'py311', 'py312']
98-
include = '\.pyi?$'
99-
extend-exclude = '''
100-
/(
101-
# directories
102-
\.eggs
103-
| \.git
104-
| \.hg
105-
| \.mypy_cache
106-
| \.tox
107-
| \.venv
108-
| build
109-
| dist
110-
)/
111-
'''
112-
113-
[tool.isort]
114-
profile = "black"
115-
line_length = 100
116-
multi_line_output = 3
117-
include_trailing_comma = true
118-
force_grid_wrap = 0
119-
use_parentheses = true
120-
ensure_newline_before_comments = true
93+
force-exclude = true
94+
extend-exclude = [
95+
".bzr",
96+
".direnv",
97+
".eggs",
98+
".git",
99+
".mypy_cache",
100+
".nox",
101+
".pants.d",
102+
".ruff_cache",
103+
".venv",
104+
"__pypackages__",
105+
"_build",
106+
"buck-out",
107+
"build",
108+
"dist",
109+
"venv",
110+
"docs",
111+
]
112+
113+
[tool.ruff.lint]
114+
extend-select = [
115+
"ANN", # flake8-annotations
116+
"B", # flake8-bugbear
117+
"C4", # flake8-comprehensions
118+
"EXE", # flake8-executable
119+
"FA", # flake8-future-annotations
120+
"FLY", # flynt
121+
"FURB", # refurb
122+
"G", # flake8-logging-format
123+
"I", # isort
124+
"ISC", # flake8-implicit-str-concat
125+
"LOG", # flake8-logging
126+
"PERF", # Perflint
127+
"PIE", # flake8-pie
128+
"PGH", # pygrep-hooks
129+
"PT", # flake8-pytest-style
130+
"PYI", # flake8-pyi
131+
"RET", # flake8-return
132+
"RSE", # flake8-raise
133+
"RUF",
134+
"SIM", # flake8-simplify
135+
"SLOT", # flake8-slots
136+
"TC", # flake8-type-checking
137+
"TRY", # tryceratops
138+
"UP", # pyupgrade
139+
"W", # pycodestyle warnings
140+
]
141+
142+
ignore = [
143+
"ANN001", # Missing type annotation for function argument - too strict for pytest fixtures
144+
"ANN401", # Dynamically typed Any - acceptable for **kwargs patterns
145+
"TRY003", # Long exception messages outside class - common pattern
146+
]
121147

122148
[tool.mypy]
123149
python_version = "3.11"

src/eopf_geozarr/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818

1919
__all__ = [
2020
"__version__",
21-
"create_geozarr_dataset",
22-
"setup_datatree_metadata_geozarr_spec_compliant",
23-
"iterative_copy",
24-
"consolidate_metadata",
2521
"async_consolidate_metadata",
26-
"downsample_2d_array",
2722
"calculate_aligned_chunk_size",
23+
"consolidate_metadata",
24+
"create_geozarr_dataset",
25+
"downsample_2d_array",
2826
"is_grid_mapping_variable",
27+
"iterative_copy",
28+
"setup_datatree_metadata_geozarr_spec_compliant",
2929
"validate_existing_band_data",
3030
]

0 commit comments

Comments
 (0)