Skip to content

Commit 8996bbb

Browse files
committed
replace black linting/formatting by ruff
1 parent ab0f957 commit 8996bbb

File tree

5 files changed

+7
-19
lines changed

5 files changed

+7
-19
lines changed

.github/workflows/lint.yml

-7
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,6 @@ jobs:
3535
# uses: chartboost/ruff-action@v1
3636
run: ruff check --output-format=github .
3737

38-
- name: format using black
39-
# We could also use the official GitHub Actions integration.
40-
# https://black.readthedocs.io/en/stable/integrations/github_actions.html
41-
# uses: uses: psf/black@stable
42-
run: |
43-
black -S --check --diff .
44-
4538
- name: type-check using mypy
4639
run: |
4740
mypy .

Makefile

-2
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@ docker-shell:
4848
.PHONY: lint-fix
4949
lint-fix:
5050
ruff check --fix ./app
51-
black ./app
5251
# mypy has no fix mode, we run it anyway to report (unfixable) errors
5352
mypy ./app
5453

5554
.PHONY: lint-check
5655
lint-check:
5756
ruff check ./app
58-
black -S --check --diff app
5957
mypy ./app

app/converters/gbfs_lime_remove_stations.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
All rights reserved.
55
"""
66

7-
from typing import List, Union
7+
from typing import Union
88

99
from app.base_converter import BaseConverter
1010

pyproject.toml

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
[tool.black]
2-
line-length = 140
3-
skip-string-normalization = 1
4-
51
[tool.ruff]
62
lint.select = [
73
"E", # pycodestyle errors
@@ -17,11 +13,8 @@ lint.select = [
1713
]
1814

1915
lint.ignore = [
20-
"E501", # line too long, handled by black
2116
"B008", # do not perform function calls in argument defaults
2217
"C901", # too complex
23-
"F401", # imported but unused
24-
"S101", # use of assert detected
2518
]
2619

2720
lint.fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
@@ -53,8 +46,13 @@ line-length = 140
5346

5447
[tool.ruff.lint.per-file-ignores]
5548
"__init__.py" = ["F401"]
49+
"tests/*" = ["S101", "S105", "S106"]
5650

5751
[tool.ruff.lint.flake8-quotes]
5852
inline-quotes = "single"
59-
multiline-quotes = "single"
53+
multiline-quotes = "double"
6054
docstring-quotes = "double"
55+
56+
[tool.ruff.format]
57+
quote-style = "single"
58+

requirements-dev.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
ruff~=0.4.9
2-
black~=24.4.2
32
mypy~=1.10.0
43
types-pyyaml~=6.0.12.12

0 commit comments

Comments
 (0)