Skip to content

Commit 27f32a9

Browse files
committed
Update pre-commit; replace black by ruff-format
1 parent ab59468 commit 27f32a9

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

.pre-commit-config.yaml

+7-8
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,23 @@ default_language_version:
22
python: python3
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.5.0
5+
rev: v4.6.0
66
hooks:
77
- id: end-of-file-fixer
88
- id: check-yaml
99
- id: check-toml
1010
- id: trailing-whitespace
11-
- repo: https://github.com/psf/black
12-
rev: 23.12.1
13-
hooks:
14-
- id: black
15-
args: ['--target-version', 'py38']
1611
- repo: https://github.com/astral-sh/ruff-pre-commit
17-
rev: v0.1.13
12+
rev: v0.6.2
1813
hooks:
14+
# Run the linter.
1915
- id: ruff
2016
args: [--fix, --exit-non-zero-on-fix]
17+
# Run the formatter.
18+
- id: ruff-format
19+
2120
- repo: https://github.com/codespell-project/codespell
22-
rev: v2.2.6
21+
rev: v2.3.0
2322
hooks:
2423
- id: codespell
2524
additional_dependencies:

tests/test_cli.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from unittest import mock
44

55
import pytest
6+
67
from ucumvert.cli import main_cli, run_cli_app
78

89

tests/test_parser.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
with Path(datadir / "ucum_examples.tsv").open(encoding="utf8") as f:
1111
ucum_examples_valid = {}
12-
for line in f.readlines():
12+
for line in f:
1313
if line.startswith("Row #"):
1414
continue
1515
line_no, unit = line.split("\t")[:2]

tests/test_ucum.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
23
import ucumvert
34
from ucumvert.xml_util import get_metric_units, get_non_metric_units, get_prefixes
45

tests/test_ucum_pint.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from lark import LarkError
33
from pint import UnitRegistry
44
from test_parser import ucum_examples_valid
5+
56
from ucumvert import (
67
PintUcumRegistry,
78
UcumToPintStrTransformer,

0 commit comments

Comments
 (0)