Skip to content

Commit 6d179b2

Browse files
authored
Merge pull request #391 from GeoStat-Framework/pylint-to-ruff
Replace pylint with ruff
2 parents 1edd2b9 + 240a5dd commit 6d179b2

34 files changed

+52
-163
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,17 @@ jobs:
3333
pip install -v --editable '.[lint,test]'
3434
pip install "coveralls>=3.0.0"
3535
36-
- name: black check
36+
- name: ruff linter
3737
run: |
38-
python -m black --check --diff --color .
38+
python -m ruff check src/gstools/
3939
40-
- name: black preview
40+
- name: ruff import check
4141
run: |
42-
python -m black --preview --diff --color .
42+
python -m ruff check --select I --diff src/gstools/
4343
44-
- name: isort check
44+
- name: ruff format check
4545
run: |
46-
python -m isort --check --diff --color .
47-
48-
- name: pylint check
49-
run: |
50-
python -m pylint src/gstools/
46+
python -m ruff format --diff src/gstools/
5147
5248
- name: coveralls check
5349
run: |

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to **GSTools** will be documented in this file.
44

5+
## [Unreleased] - ?
6+
7+
### Changes
8+
9+
- replace pylint, black, and isort with ruff [#391](https://github.com/GeoStat-Framework/GSTools/pull/391)
10+
511
## [1.7.0] - Morphic Mint - 2025-04
612

713
### Enhancements

CONTRIBUTING.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ with your idea or suggestion and we'd love to discuss about it.
2929

3030
- Fork the repo on [GitHub](https://github.com/GeoStat-Framework/GSTools)
3131
- Add yourself to AUTHORS.md (if you want to).
32-
- We use [black](https://github.com/psf/black) and [isort](https://github.com/PyCQA/isort) to format our code.
33-
Please use the scripts `black .` and `isort .` after you have written your code.
32+
- We use [Ruff](https://github.com/psf/black) to check and format the code.
33+
Please use the scripts `ruff check src/gstools`,
34+
`ruff check --select I --fix src/gstools/`, and
35+
`ruff format --diff src/gstools/` after you have written your code.
3436
- Add some tests if possible.
3537
- Add an example showing your new feature in one of the examples sub-folders if possible.
3638
Follow this [Sphinx-Gallary guide](https://sphinx-gallery.github.io/stable/syntax.html#embed-rst-in-your-example-python-files).

pyproject.toml

Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,7 @@ plotting = [
7373
]
7474
rust = ["gstools_core>=1.0.0"]
7575
test = ["pytest-cov>=3"]
76-
lint = [
77-
"black>=24",
78-
"pylint",
79-
"isort[colors]",
80-
]
76+
lint = ["ruff"]
8177

8278
[project.urls]
8379
Changelog = "https://github.com/GeoStat-Framework/GSTools/blob/main/CHANGELOG.md"
@@ -107,21 +103,9 @@ include = [
107103
[tool.hatch.build.targets.wheel]
108104
packages = ["src/gstools"]
109105

110-
[tool.isort]
111-
profile = "black"
112-
multi_line_output = 3
113-
line_length = 79
114-
115-
[tool.black]
106+
[tool.ruff]
116107
line-length = 79
117-
target-version = [
118-
"py38",
119-
"py39",
120-
"py310",
121-
"py311",
122-
"py312",
123-
"py313",
124-
]
108+
target-version = "py38"
125109

126110
[tool.coverage]
127111
[tool.coverage.run]
@@ -140,32 +124,3 @@ target-version = [
140124
"def __repr__",
141125
"def __str__",
142126
]
143-
144-
[tool.pylint]
145-
[tool.pylint.main]
146-
extension-pkg-whitelist = [
147-
"numpy",
148-
"scipy",
149-
"gstools_core",
150-
]
151-
ignore = "_version.py"
152-
load-plugins = [
153-
"pylint.extensions.no_self_use",
154-
]
155-
156-
[tool.pylint.message_control]
157-
disable = [
158-
"R0801",
159-
]
160-
161-
[tool.pylint.reports]
162-
output-format = "colorized"
163-
164-
[tool.pylint.design]
165-
max-args = 20
166-
max-locals = 50
167-
max-branches = 30
168-
max-statements = 85
169-
max-attributes = 30
170-
max-public-methods = 80
171-
max-positional-arguments=20

src/gstools/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@
236236
"Krige",
237237
"SRF",
238238
"CondSRF",
239+
"PGS",
239240
"rotated_main_axes",
240241
"generate_grid",
241242
"generate_st_grid",

src/gstools/config.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77

88
NUM_THREADS = None
99

10-
# pylint: disable=W0611
1110
try: # pragma: no cover
12-
import gstools_core
11+
import gstools_core # noqa: F401
1312

1413
_GSTOOLS_CORE_AVAIL = True
1514
USE_GSTOOLS_CORE = True

src/gstools/covmodel/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
SumModel
1111
"""
1212

13-
# pylint: disable=C0103, R0201, E1101, C0302, W0613, W0231
1413
import copy
1514

1615
import numpy as np

src/gstools/covmodel/fit.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
fit_variogram
1010
"""
1111

12-
# pylint: disable=C0103, W0632
1312
import numpy as np
1413
from scipy.optimize import curve_fit
1514

src/gstools/covmodel/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
JBessel
2323
"""
2424

25-
# pylint: disable=C0103, C0302, E1101, R0201
2625
import warnings
2726

2827
import numpy as np

src/gstools/covmodel/plot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
plot_spectral_rad_pdf
2626
"""
2727

28-
# pylint: disable=C0103, C0415, E1130
2928
import numpy as np
3029

3130
from gstools.tools.geometric import generate_grid

0 commit comments

Comments
 (0)