Skip to content

Commit bde93f1

Browse files
committed
Use ruff for import sorting
1 parent be3ef77 commit bde93f1

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ repos:
33
# Ruff version.
44
rev: v0.12.8
55
hooks:
6+
- id: ruff
7+
args: ["check", "--select", "I", "--fix"]
68
# Run the formatter.
79
- id: ruff-format
8-
- repo: https://github.com/asottile/reorder_python_imports
9-
rev: v3.15.0
10-
hooks:
11-
- id: reorder-python-imports

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ line-length = 88
7070
lint.select = ["E", "F", "I", "N", "W", "B", "C4", "UP"]
7171
lint.ignore = ["E501", "B008", "I001"]
7272

73+
[tool.ruff.lint.isort]
74+
force-single-line = true
75+
7376
[tool.pytest.ini_options]
7477
testpaths = ["tests"]
7578
python_files = ["test_*.py"]

src/isnt_that_odd/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Command-line interface for the isn't that odd library."""
2+
23
import random
34
import sys
45
import time

tests/test_cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
"""Tests for the CLI functionality."""
2+
23
from unittest.mock import patch
34

45
from click.testing import CliRunner
6+
57
from isnt_that_odd.cli import cli
68
from isnt_that_odd.cli import parse_number
79

tests/test_core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
"""Tests for the core functionality of isnt_that_odd."""
2+
23
from unittest.mock import Mock
34
from unittest.mock import patch
45

56
import pytest
7+
68
from isnt_that_odd.core import EvenChecker
79
from isnt_that_odd.core import EvenResponse
810
from isnt_that_odd.core import is_even

0 commit comments

Comments
 (0)