Skip to content

Commit

Permalink
ci: replace black with ruff formatter (#916)
Browse files Browse the repository at this point in the history
  • Loading branch information
epenet authored Nov 13, 2024
1 parent 46d2e4d commit 05abd5a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 117 deletions.
89 changes: 1 addition & 88 deletions poetry.lock

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

31 changes: 4 additions & 27 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]
black = '^24.1.0'
mypy = '^1.0.1'
py-githooks = '^1.1.1'
twine = '^5.1.1'
Expand All @@ -48,32 +47,6 @@ setuptools-scm = '^8.0.0'
debugpy = '^1.6.6'
ruff = '>=0.7.0'

[tool.black]
line-length = 88
target-version = ['py310']
include = '\.pyi?$'
exclude = '''
(
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.hg
| \.mypy_cache
| \.tox
| \.vscode
| \.venv
| \.poetry
| syrupy.venv
| _build
| buck-out
| build
| dist
)/
| foo.py # also separately exclude a file named foo.py in
# the root of the project
)
'''

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

[tool.ruff]
line-length = 88
target-version = "py38"

[tool.ruff.lint]
extend-select = [
"A", # flake8-builtins
Expand Down
1 change: 0 additions & 1 deletion src/syrupy/patches/pycharm_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def patch_pycharm_diff() -> Iterator[None]:

@wraps(old_init)
def new_init(self: "EqualsAssertionError", *args: Any, **kwargs: Any) -> None:

# Extract the __init__ arguments as originally passed in order to
# process them later
parameters = old_init_signature.bind(self, *args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion tasks/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from .utils import ctx_run

lint_commands = {
"black": lambda fix: f"python -m black {'' if fix else '--check'} .",
"mypy": lambda _: "python -m mypy --strict src benchmarks",
"ruff": lambda fix: f"python -m ruff check {'--fix' if fix else ''} .",
"ruff-format": lambda fix: f"python -m ruff format {'' if fix else '--diff'} .",
}


Expand Down

0 comments on commit 05abd5a

Please sign in to comment.