Skip to content

Commit 078c67e

Browse files
authored
update(tooling): bump git hooks and add ruff as dev dependencies (#374)
2 parents ac99c8a + b1b34f9 commit 078c67e

17 files changed

+39
-28
lines changed

.pre-commit-config.yaml

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
exclude: ".venv|__pycache__|tests/dev/|tests/fixtures/"
1+
exclude: ".venv|build|dist|__pycache__|tests/dev/|tests/fixtures/"
22
fail_fast: false
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
55
rev: v5.0.0
66
hooks:
77
- id: check-added-large-files
8-
args: ["--maxkb=500"]
8+
args:
9+
- --maxkb=500
910
- id: check-ast
1011
- id: check-builtin-literals
1112
- id: check-case-conflict
@@ -15,45 +16,65 @@ repos:
1516
- id: end-of-file-fixer
1617
- id: fix-byte-order-marker
1718
- id: fix-encoding-pragma
18-
args: [--remove]
19+
args:
20+
- --remove
1921
- id: name-tests-test
20-
args: [--pytest-test-first]
22+
args:
23+
- --pytest-test-first
2124
- id: trailing-whitespace
22-
args: [--markdown-linebreak-ext=md]
25+
args:
26+
- --markdown-linebreak-ext=md
2327

2428
- repo: https://github.com/asottile/pyupgrade
2529
rev: v3.19.1
2630
hooks:
2731
- id: pyupgrade
2832
args:
29-
- "--py39-plus"
33+
- --py39-plus
3034

3135
- repo: https://github.com/astral-sh/ruff-pre-commit
3236
rev: "v0.11.4"
3337
hooks:
3438
- id: ruff
35-
args: ["--fix-only", "--target-version=py39"]
39+
args:
40+
- --fix
41+
- --target-version=py39
42+
types_or:
43+
- python
44+
- pyi
45+
- id: ruff-format
46+
args:
47+
- --line-length=88
48+
- --target-version=py39
49+
types_or:
50+
- python
51+
- pyi
3652

3753
- repo: https://github.com/psf/black
3854
rev: 25.1.0
3955
hooks:
4056
- id: black
41-
args: ["--target-version=py39"]
57+
args:
58+
- --target-version=py39
4259

4360
- repo: https://github.com/pycqa/isort
4461
rev: 6.0.1
4562
hooks:
4663
- id: isort
47-
args: ["--profile", "black", "--filter-files"]
64+
args:
65+
- --profile
66+
- black
67+
- --filter-files
4868

4969
- repo: https://github.com/pycqa/flake8
5070
rev: 7.2.0
5171
hooks:
5272
- id: flake8
5373
language: python
5474
files: ^dicogis/.*\.py$
55-
types: [python]
56-
args: ["--config=setup.cfg", "--select=E9,F63,F7,F82"]
75+
args:
76+
- --config=setup.cfg
77+
- --select=E9,F63,F7,F82
5778

5879
ci:
5980
autofix_prs: true

dicogis/export/to_json.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# ########## Libraries #############
77
# ##################################
88

9-
109
# Standard library
1110
import json
1211
import logging

dicogis/export/to_xlsx.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,7 @@ def store_error(
473473
worksheet[f"C{row_index}"].style = "Warning Text"
474474
# gdal info
475475
worksheet[f"Q{row_index}"] = (
476-
f"{metadataset.processing_error_type}: "
477-
f"{metadataset.processing_error_msg}"
476+
f"{metadataset.processing_error_type}: {metadataset.processing_error_msg}"
478477
)
479478
worksheet[f"Q{row_index}"].style = "Warning Text"
480479
logger.debug(

dicogis/georeaders/read_vector_flat_dataset.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ def infos_dataset(
7878
dataset_type=self.dataset_type,
7979
)
8080
elif self.dataset_type == "flat_database":
81-
8281
metadataset = MetaDatabaseFlat(
8382
path=source_path,
8483
name=source_path.stem,

dicogis/listing/geodata_listing.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ def find_geodata_files(
9999
li_geoj: list[str] = []
100100
li_geotiff: list[str] = []
101101
li_gxt: list[str] = []
102-
li_vectors: list[str] = []
103102
li_dxf: list[str] = []
104103
li_dwg: list[str] = []
105104
li_dgn: list[str] = []

dicogis/models/metadataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def as_markdown_description(self) -> str:
115115
if self.files_dependencies:
116116
description += (
117117
"- Related files: "
118-
+ f"{', '.join([str(filepath.resolve()) for filepath in self.files_dependencies])}\n"
118+
+ f"{', '.join([str(filepath.resolve()) for filepath in self.files_dependencies])}\n"
119119
)
120120

121121
if isinstance(self, MetaVectorDataset) and self.feature_attributes:

dicogis/ui/tab_database.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# ########## Libraries #############
1313
# ##################################
1414

15-
1615
# Standard library
1716
import logging
1817
from tkinter import IntVar, StringVar, Tk, Toplevel

dicogis/ui/tab_files.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# ########## Libraries #############
1313
# ##################################
1414

15-
1615
# Standard library
1716
import logging
1817
import threading

dicogis/ui/tab_settings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# ########## Libraries #############
1313
# ##################################
1414

15-
1615
# Standard library
1716
import logging
1817
from os import environ, getenv

dicogis/utils/formatters.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
"""Helpers to format text and variables."""
44

5-
65
# standard library
76
import logging
87
from functools import lru_cache

0 commit comments

Comments
 (0)