Skip to content

Commit 66201b8

Browse files
reformat with ruff
1 parent 0139da1 commit 66201b8

3 files changed

Lines changed: 32 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Install dependencies
3131
run: |
3232
python -m pip install -U pip
33-
python -m pip install -U build flake8 pytest
33+
python -m pip install -U build pytest ruff
3434
python -m pip install -r requirements.txt
3535
python -m pip install -r test/requirements.txt
3636
@@ -54,7 +54,8 @@ jobs:
5454
5555
- name: Run linter
5656
run: |
57-
flake8 dropbox example test
57+
ruff check dropbox example test
58+
ruff format --check dropbox example test
5859
5960
- name: Run unit tests
6061
run: |

pyproject.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,28 @@ parentdir_prefix_version = "dropbox-"
4848

4949
[tool.pytest.ini_options]
5050
norecursedirs = [".tox", ".venv", ".venv-*", "stone"]
51+
52+
[tool.ruff]
53+
line-length = 100
54+
target-version = "py311"
55+
56+
[tool.ruff.lint]
57+
select = ["E4", "E7", "E9", "F"]
58+
ignore = [
59+
"E128",
60+
"E301",
61+
"E302",
62+
"E305",
63+
"E402",
64+
"W503",
65+
"W504",
66+
]
67+
68+
[tool.ruff.lint.per-file-ignores]
69+
"dropbox/stone_base.py" = ["F401", "F403"]
70+
"dropbox/stone_validators.py" = ["F401", "F403"]
71+
"dropbox/stone_serializers.py" = ["F401", "F403"]
72+
73+
[tool.ruff.format]
74+
quote-style = "double"
75+
line-ending = "auto"

tox.ini

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,6 @@
33
envlist = py{311,312,313,py3},check,lint,docs,test_unit,coverage
44
skip_missing_interpreters = true
55

6-
[flake8]
7-
8-
# See <https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes>
9-
ignore = E128,E301,E302,E305,E402,W503,W504
10-
max-line-length = 100
11-
per-file-ignores =
12-
dropbox/stone_base.py: F401, F403
13-
dropbox/stone_validators.py: F401, F403
14-
dropbox/stone_serializers.py: F401, F403
15-
166

177
[testenv:test_integration]
188

@@ -47,11 +37,12 @@ usedevelop = true
4737

4838

4939
[testenv:lint]
50-
description = format the code base to adhere to our styles, and complain about what we cannot do automatically
40+
description = check code with Ruff
5141
commands =
52-
flake8 dropbox example test
42+
ruff check dropbox example test
43+
ruff format --check dropbox example test
5344
deps =
54-
flake8
45+
ruff
5546
-rtest/requirements.txt
5647

5748
usedevelop = true

0 commit comments

Comments
 (0)