Skip to content

Commit 64e5fd5

Browse files
committed
replace black with ruff formatter
1 parent 41d216d commit 64e5fd5

File tree

3 files changed

+11
-31
lines changed

3 files changed

+11
-31
lines changed

.github/workflows/code-format.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@ name: Code Format
33
on: [push, pull_request]
44

55
jobs:
6-
ruff:
6+
ruff-check:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v3
1010
- uses: chartboost/ruff-action@v1
11-
lint:
11+
with:
12+
version: 0.1.15
13+
ruff-format:
1214
runs-on: ubuntu-latest
1315
steps:
1416
- uses: actions/checkout@v3
15-
- uses: psf/black@stable
17+
- uses: chartboost/ruff-action@v1
18+
with:
19+
version: 0.1.15
20+
args: format

.pre-commit-config.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
fail_fast: true
22

33
repos:
4-
- repo: https://github.com/psf/black
5-
rev: 22.8.0
6-
hooks:
7-
- id: black
8-
language_version: python3.11
94
- repo: https://github.com/astral-sh/ruff-pre-commit
10-
rev: v0.0.272
5+
rev: v0.1.15
116
hooks:
127
- id: ruff
138
args: [ --fix ]
9+
- id: ruff-format
1410
- repo: https://github.com/pre-commit/pre-commit-hooks
1511
rev: v4.3.0
1612
hooks:

pyproject.toml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,14 @@ httpx = { version = "^0.23.0", optional = true }
1919
async = ["httpx"]
2020

2121
[tool.poetry.group.dev.dependencies]
22-
black = "^23.7.0"
2322
pre-commit = "^3.3.3"
2423
types-requests = "^2.28.11.4"
2524
pytest = "^7.4.0"
26-
ruff = "^0.0.278"
25+
ruff = "^0.1.15"
2726

2827
[tool.poetry.scripts]
2928
discord_webhook = "discord_webhook.__main__:main"
3029

31-
[tool.black]
32-
line-length = 88
33-
preview = true
34-
target-version = ["py311"]
35-
include = '\.pyi?$'
36-
exclude = '''
37-
/(
38-
\.git
39-
| \.hg
40-
| \.mypy_cache
41-
| \.tox
42-
| \.venv
43-
| _build
44-
| buck-out
45-
| build
46-
| dist
47-
| frontend
48-
)/
49-
'''
50-
5130
[tool.ruff]
5231
line-length = 88
5332
ignore = ["E501"]

0 commit comments

Comments
 (0)