From cb053af33caafdb5f8318e51620ca664f683e201 Mon Sep 17 00:00:00 2001 From: Taku Fukada Date: Fri, 22 Mar 2024 13:52:10 +0900 Subject: [PATCH] Bump ruff to 0.3 --- japanese_grids/algorithms/create_grid_square.py | 6 ++---- japanese_grids/algorithms/create_legacy_grid.py | 6 ++---- pyproject.toml | 5 ++++- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/japanese_grids/algorithms/create_grid_square.py b/japanese_grids/algorithms/create_grid_square.py index 6b27a07..e0e9fbe 100644 --- a/japanese_grids/algorithms/create_grid_square.py +++ b/japanese_grids/algorithms/create_grid_square.py @@ -245,7 +245,6 @@ def processAlgorithm( ) # Generate square patches - count = 0 total_count = estimate_total_count( extent=extent_bbox, primary="primary" in sinks, @@ -255,7 +254,7 @@ def processAlgorithm( quarter="quarter" in sinks, eighth="eighth" in sinks, ) - for kind, code, bbox in iter_patch( + for count, (kind, code, bbox) in enumerate(iter_patch( extent=extent_bbox, primary="primary" in sinks, secondary="secondary" in sinks, @@ -263,7 +262,7 @@ def processAlgorithm( half="half" in sinks, quarter="quarter" in sinks, eighth="eighth" in sinks, - ): + )): if feedback.isCanceled(): return {} @@ -286,7 +285,6 @@ def processAlgorithm( sink = sinks[kind] sink.addFeature(feat, QgsFeatureSink.FastInsert) - count += 1 feedback.setProgress(100) diff --git a/japanese_grids/algorithms/create_legacy_grid.py b/japanese_grids/algorithms/create_legacy_grid.py index 87c4a5f..37bbda2 100644 --- a/japanese_grids/algorithms/create_legacy_grid.py +++ b/japanese_grids/algorithms/create_legacy_grid.py @@ -396,7 +396,6 @@ def processAlgorithm( ) # Generate square patches - count = 0 total_count = estimate_total_count( extent=extent_bbox, lv50000="lv50000" in sinks, @@ -406,14 +405,14 @@ def processAlgorithm( lv500="lv500" in sinks, ) prefix = _PLANE_RECTANGULAR_PLANES[plane_rectangular_no]["prefix"] - for kind, code, bbox in iter_patch( + for count, (kind, code, bbox) in enumerate(iter_patch( extent=extent_bbox, lv50000="lv50000" in sinks, lv5000="lv5000" in sinks, lv2500="lv2500" in sinks, lv1000="lv1000" in sinks, lv500="lv500" in sinks, - ): + )): if feedback.isCanceled(): return {} @@ -436,7 +435,6 @@ def processAlgorithm( sink = sinks[kind] sink.addFeature(feat, QgsFeatureSink.FastInsert) - count += 1 feedback.setProgress(100) diff --git a/pyproject.toml b/pyproject.toml index 34ac3f5..30ddd63 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,6 +28,9 @@ addopts = ["--import-mode=importlib"] # filterwarnings = "ignore::DeprecationWarning" [tool.ruff] +target-version = "py38" + +[tool.ruff.lint] select = [ "F", "E", @@ -46,7 +49,7 @@ select = [ "RUF", ] ignore = ["N802", "E501", "RUF001"] -target-version = "py38" + [tool.coverage.run] source = ['japanese_grids']