From 64e5fd52c8d171442762a793c224d983a4202251 Mon Sep 17 00:00:00 2001 From: lovvskillz <14542790+lovvskillz@users.noreply.github.com> Date: Wed, 31 Jan 2024 18:39:37 +0100 Subject: [PATCH] replace black with ruff formatter --- .github/workflows/code-format.yml | 11 ++++++++--- .pre-commit-config.yaml | 8 ++------ pyproject.toml | 23 +---------------------- 3 files changed, 11 insertions(+), 31 deletions(-) diff --git a/.github/workflows/code-format.yml b/.github/workflows/code-format.yml index 8096dd7..2c8cf73 100644 --- a/.github/workflows/code-format.yml +++ b/.github/workflows/code-format.yml @@ -3,13 +3,18 @@ name: Code Format on: [push, pull_request] jobs: - ruff: + ruff-check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: chartboost/ruff-action@v1 - lint: + with: + version: 0.1.15 + ruff-format: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: psf/black@stable + - uses: chartboost/ruff-action@v1 + with: + version: 0.1.15 + args: format diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 96323c2..1414718 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,16 +1,12 @@ fail_fast: true repos: - - repo: https://github.com/psf/black - rev: 22.8.0 - hooks: - - id: black - language_version: python3.11 - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.272 + rev: v0.1.15 hooks: - id: ruff args: [ --fix ] + - id: ruff-format - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 hooks: diff --git a/pyproject.toml b/pyproject.toml index 5024edb..aa98246 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,35 +19,14 @@ httpx = { version = "^0.23.0", optional = true } async = ["httpx"] [tool.poetry.group.dev.dependencies] -black = "^23.7.0" pre-commit = "^3.3.3" types-requests = "^2.28.11.4" pytest = "^7.4.0" -ruff = "^0.0.278" +ruff = "^0.1.15" [tool.poetry.scripts] discord_webhook = "discord_webhook.__main__:main" -[tool.black] -line-length = 88 -preview = true -target-version = ["py311"] -include = '\.pyi?$' -exclude = ''' -/( - \.git - | \.hg - | \.mypy_cache - | \.tox - | \.venv - | _build - | buck-out - | build - | dist - | frontend -)/ -''' - [tool.ruff] line-length = 88 ignore = ["E501"]