Skip to content

Commit 01694d5

Browse files
Replace flake8 and black with ruff
1 parent 248f532 commit 01694d5

3 files changed

Lines changed: 28 additions & 3 deletions

File tree

geonode/harvesting/harvesters/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
from geonode.base import enumerations
3131
from geonode.base.models import ResourceBase
32+
from geonode.harvesting.models import HarvestableResource
3233
from geonode.resource.registry import resource_manager_registry
3334
from geonode.storage.manager import storage_manager
3435

geonode/harvesting/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
from django.utils.translation import gettext_lazy as _
3333

3434
from geonode import celery_app
35+
from geonode.harvesting.harvesters.base import BaseHarvesterWorker
3536

3637
from .config import get_setting
3738

pyproject.toml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,7 @@ version = {attr = "geonode.__version__"}
190190

191191

192192
[tool.ruff]
193-
line-length = 88
194-
target-version = "py312"
193+
195194
exclude = [
196195
"geonode/*/migrations/*",
197196
"geonode/**/settings.py",
@@ -203,12 +202,36 @@ exclude = [
203202
"node_modules",
204203
]
205204

205+
# Same as Black.
206+
line-length = 88
207+
indent-width = 4
208+
209+
target-version = "py312"
210+
211+
206212
[tool.ruff.lint]
207213
# E and F are the standard Flake8 rules
208-
select = ["E", "F", "W", "I"]
214+
select = ["E4", "E7", "E9", "F"]
209215
ignore = ["E203", "E731"]
216+
fixable = ["ALL"]
217+
unfixable = []
218+
219+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
210220

211221
[tool.ruff.lint.isort]
212222
# This makes it behave like modern Black-compatible isort
213223
combine-as-imports = true
214224
lines-after-imports = 2
225+
226+
[tool.ruff.format]
227+
# Like Black, use double quotes for strings.
228+
quote-style = "double"
229+
230+
# Like Black, indent with spaces, rather than tabs.
231+
indent-style = "space"
232+
233+
# Like Black, respect magic trailing commas.
234+
skip-magic-trailing-comma = false
235+
236+
# Like Black, automatically detect the appropriate line ending.
237+
line-ending = "auto"

0 commit comments

Comments
 (0)