Skip to content

Commit

Permalink
replace black with ruff formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
lovvskillz committed Jan 31, 2024
1 parent 41d216d commit 64e5fd5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 31 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/code-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 2 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
23 changes: 1 addition & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 64e5fd5

Please sign in to comment.