From 47651d9d4e3bd1708dfb1cb1d67dae2a906dfe14 Mon Sep 17 00:00:00 2001 From: Jonathan Ehwald Date: Sun, 12 Nov 2023 16:36:39 +0100 Subject: [PATCH] Migrate to ruff format (#35) --- .github/workflows/lint.yml | 4 ++-- .pre-commit-config.yaml | 8 +++---- Makefile | 8 +++---- poetry.lock | 44 +------------------------------------- pyproject.toml | 1 - 5 files changed, 10 insertions(+), 55 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0b36fa4..b09e016 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -33,6 +33,6 @@ jobs: run: poetry install --no-interaction - name: Lint run: | - poetry run ruff aiogqlc tests - poetry run black aiogqlc tests --check + poetry run ruff check aiogqlc tests + poetry run ruff format --check aiogqlc tests poetry run mypy aiogqlc diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e41ef37..9f153b8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,15 +1,13 @@ repos: - - repo: https://github.com/psf/black - rev: 23.7.0 - hooks: - - id: black - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.5 hooks: - id: ruff + - id: ruff-format + args: [--check] - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.5.1 hooks: - id: mypy additional_dependencies: - - 'strawberry-graphql==0.213.0' + - "strawberry-graphql==0.213.0" diff --git a/Makefile b/Makefile index eada805..e081e5a 100644 --- a/Makefile +++ b/Makefile @@ -5,13 +5,13 @@ dev: .PHONY: format format: - poetry run ruff aiogqlc tests --fix - poetry run black aiogqlc tests + poetry run ruff check --fix aiogqlc tests + poetry run ruff format aiogqlc tests .PHONY: lint lint: - poetry run ruff aiogqlc tests - poetry run black aiogqlc tests --check + poetry run ruff check aiogqlc tests + poetry run ruff format --check aiogqlc tests poetry run mypy aiogqlc .PHONY: test diff --git a/poetry.lock b/poetry.lock index 0fcf0b2..47bbf3e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -184,48 +184,6 @@ setuptools = {version = "*", markers = "python_version >= \"3.12\""} [package.extras] dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] -[[package]] -name = "black" -version = "23.11.0" -description = "The uncompromising code formatter." -optional = false -python-versions = ">=3.8" -files = [ - {file = "black-23.11.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:dbea0bb8575c6b6303cc65017b46351dc5953eea5c0a59d7b7e3a2d2f433a911"}, - {file = "black-23.11.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:412f56bab20ac85927f3a959230331de5614aecda1ede14b373083f62ec24e6f"}, - {file = "black-23.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d136ef5b418c81660ad847efe0e55c58c8208b77a57a28a503a5f345ccf01394"}, - {file = "black-23.11.0-cp310-cp310-win_amd64.whl", hash = "sha256:6c1cac07e64433f646a9a838cdc00c9768b3c362805afc3fce341af0e6a9ae9f"}, - {file = "black-23.11.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cf57719e581cfd48c4efe28543fea3d139c6b6f1238b3f0102a9c73992cbb479"}, - {file = "black-23.11.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:698c1e0d5c43354ec5d6f4d914d0d553a9ada56c85415700b81dc90125aac244"}, - {file = "black-23.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:760415ccc20f9e8747084169110ef75d545f3b0932ee21368f63ac0fee86b221"}, - {file = "black-23.11.0-cp311-cp311-win_amd64.whl", hash = "sha256:58e5f4d08a205b11800332920e285bd25e1a75c54953e05502052738fe16b3b5"}, - {file = "black-23.11.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:45aa1d4675964946e53ab81aeec7a37613c1cb71647b5394779e6efb79d6d187"}, - {file = "black-23.11.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:4c44b7211a3a0570cc097e81135faa5f261264f4dfaa22bd5ee2875a4e773bd6"}, - {file = "black-23.11.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2a9acad1451632021ee0d146c8765782a0c3846e0e0ea46659d7c4f89d9b212b"}, - {file = "black-23.11.0-cp38-cp38-win_amd64.whl", hash = "sha256:fc7f6a44d52747e65a02558e1d807c82df1d66ffa80a601862040a43ec2e3142"}, - {file = "black-23.11.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7f622b6822f02bfaf2a5cd31fdb7cd86fcf33dab6ced5185c35f5db98260b055"}, - {file = "black-23.11.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:250d7e60f323fcfc8ea6c800d5eba12f7967400eb6c2d21ae85ad31c204fb1f4"}, - {file = "black-23.11.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5133f5507007ba08d8b7b263c7aa0f931af5ba88a29beacc4b2dc23fcefe9c06"}, - {file = "black-23.11.0-cp39-cp39-win_amd64.whl", hash = "sha256:421f3e44aa67138ab1b9bfbc22ee3780b22fa5b291e4db8ab7eee95200726b07"}, - {file = "black-23.11.0-py3-none-any.whl", hash = "sha256:54caaa703227c6e0c87b76326d0862184729a69b73d3b7305b6288e1d830067e"}, - {file = "black-23.11.0.tar.gz", hash = "sha256:4c68855825ff432d197229846f971bc4d6666ce90492e5b02013bcaca4d9ab05"}, -] - -[package.dependencies] -click = ">=8.0.0" -mypy-extensions = ">=0.4.3" -packaging = ">=22.0" -pathspec = ">=0.9.0" -platformdirs = ">=2" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} - -[package.extras] -colorama = ["colorama (>=0.4.3)"] -d = ["aiohttp (>=3.7.4)"] -jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] -uvloop = ["uvloop (>=0.15.2)"] - [[package]] name = "certifi" version = "2023.7.22" @@ -1664,4 +1622,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "4aaf8dad875d1a08cf90d36f0a2d714aca1eaa4068d4f5099013e150fa133e3d" +content-hash = "187848874f4915e0d1adfdd9b73b6d0e33ed15932ad7700d059d678d15de5444" diff --git a/pyproject.toml b/pyproject.toml index 45e76fa..c53e2c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,6 @@ python = "^3.8" aiohttp = "^3.6.0" [tool.poetry.group.dev.dependencies] -black = "^23.7.0" pre-commit = "^3.4.0" pytest = "^7.4.1" pytest-cov = "^4.1.0"