Skip to content

Commit

Permalink
ci: replace isort with ruff (#910)
Browse files Browse the repository at this point in the history
  • Loading branch information
epenet authored Nov 3, 2024
1 parent 9c708a2 commit 84081f6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 34 deletions.
16 changes: 1 addition & 15 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 5 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ pytest-benchmark = '^4.0.0'
pytest-xdist = '^3.1.0'

[tool.poetry.group.dev.dependencies]
isort = '^5.12.0'
black = '^24.1.0'
mypy = '^1.0.1'
py-githooks = '^1.1.1'
Expand Down Expand Up @@ -79,20 +78,6 @@ exclude = '''
)
'''

[tool.isort]
force_grid_wrap = 2
known_first_party = 'syrupy'
profile = 'black'
skip = '''
.eggs,
.mypy_cache,
.venv,
syrupy.venv,
.poetry,
build,
dist,
'''

[tool.pytest.ini_options]
addopts = '-p syrupy -p pytester -p no:legacypath --doctest-modules'
testpaths = ['tests']
Expand All @@ -104,6 +89,11 @@ source = ['./src']
[tool.coverage.report]
exclude_lines = ['pragma: no-cover', 'if TYPE_CHECKING:', '@abstractmethod']

[tool.ruff.lint]
extend-select = [
"I", # isort
]

[build-system]
requires = ['poetry-core>=1.9.0']
build-backend = 'poetry.core.masonry.api'
6 changes: 4 additions & 2 deletions src/syrupy/extensions/amber/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
from syrupy.exceptions import TaintedSnapshotError
from syrupy.extensions.base import AbstractSyrupyExtension

from .serializer import AmberDataSerializerSorted # noqa: F401 # re-exported
from .serializer import AmberDataSerializer
from .serializer import ( # noqa: F401
AmberDataSerializer,
AmberDataSerializerSorted, # re-exported
)

if TYPE_CHECKING:
from syrupy.types import SerializableData
Expand Down
3 changes: 1 addition & 2 deletions tasks/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
from .utils import ctx_run

lint_commands = {
"isort": lambda fix: f"python -m isort {'' if fix else '--check'} .",
"black": lambda fix: f"python -m black {'' if fix else '--check'} .",
"flake8": lambda _: "python -m flake8 src tests benchmarks *.py",
"mypy": lambda _: "python -m mypy --strict src benchmarks",
"ruff": lambda _: "python -m ruff check",
"ruff": lambda fix: f"python -m ruff check {'--fix' if fix else ''} .",
}


Expand Down

0 comments on commit 84081f6

Please sign in to comment.