Skip to content

Commit 9313536

Browse files
committed
Switch linting from flake8 to ruff
Signed-off-by: Aarni Koskela <[email protected]>
1 parent 8a3402c commit 9313536

File tree

13 files changed

+20
-22
lines changed

13 files changed

+20
-22
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ env:
66
DOCKER_BUILDKIT: '1'
77

88
jobs:
9-
flake8:
9+
lint:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v3
1313
- uses: actions/setup-python@v4
1414
with:
15-
python-version: '3.x'
16-
- run: pip install -U flake8
17-
- name: Run flake8
18-
run: flake8 docker/ tests/
15+
python-version: '3.11'
16+
- run: pip install -U ruff==0.0.284
17+
- name: Run ruff
18+
run: ruff docker tests
1919

2020
unit-tests:
2121
runs-on: ubuntu-latest

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ paragraph in the Docker contribution guidelines.
4444
Before we can review your pull request, please ensure that nothing has been
4545
broken by your changes by running the test suite. You can do so simply by
4646
running `make test` in the project root. This also includes coding style using
47-
`flake8`
47+
`ruff`
4848

4949
### 3. Write clear, self-contained commits
5050

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ build-dind-certs:
4646
docker build -t dpy-dind-certs -f tests/Dockerfile-dind-certs .
4747

4848
.PHONY: test
49-
test: flake8 unit-test-py3 integration-dind integration-dind-ssl
49+
test: ruff unit-test-py3 integration-dind integration-dind-ssl
5050

5151
.PHONY: unit-test-py3
5252
unit-test-py3: build-py3
@@ -163,9 +163,9 @@ integration-dind-ssl: build-dind-certs build-py3 setup-network
163163

164164
docker rm -vf dpy-dind-ssl dpy-dind-certs
165165

166-
.PHONY: flake8
167-
flake8: build-py3
168-
docker run -t --rm docker-sdk-python3 flake8 docker tests
166+
.PHONY: ruff
167+
ruff: build-py3
168+
docker run -t --rm docker-sdk-python3 ruff docker tests
169169

170170
.PHONY: docs
171171
docs: build-docs

docker/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# flake8: noqa
21
from .api import APIClient
32
from .client import DockerClient, from_env
43
from .context import Context

docker/api/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
# flake8: noqa
21
from .client import APIClient

docker/context/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
# flake8: noqa
21
from .context import Context
32
from .api import ContextAPI

docker/credentials/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# flake8: noqa
1+
22
from .store import Store
33
from .errors import StoreError, CredentialsNotFound
4-
from .constants import *
4+
from .constants import * # noqa: F403

docker/transport/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# flake8: noqa
21
from .unixconn import UnixHTTPAdapter
32
from .ssladapter import SSLHTTPAdapter
43
try:

docker/types/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# flake8: noqa
21
from .containers import (
32
ContainerConfig, HostConfig, LogConfig, Ulimit, DeviceRequest
43
)

docker/utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# flake8: noqa
1+
22
from .build import create_archive, exclude_paths, mkbuildcontext, tar
33
from .decorators import check_resource, minimum_version, update_headers
44
from .utils import (

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
33

44
[tool.setuptools_scm]
55
write_to = 'docker/_version.py'
6+
7+
[tool.ruff.per-file-ignores]
8+
"**/__init__.py" = ["F401"]

test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
setuptools==65.5.1
22
coverage==6.4.2
3-
flake8==4.0.1
3+
ruff==0.0.284
44
pytest==7.1.2
55
pytest-cov==3.0.0
66
pytest-timeout==2.1.0

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{37,38,39,310,311}, flake8
2+
envlist = py{37,38,39,310,311}, ruff
33
skipsdist=True
44

55
[testenv]
@@ -10,7 +10,7 @@ deps =
1010
-r{toxinidir}/test-requirements.txt
1111
-r{toxinidir}/requirements.txt
1212

13-
[testenv:flake8]
14-
commands = flake8 docker tests setup.py
13+
[testenv:ruff]
14+
commands = ruff docker tests setup.py
1515
deps =
1616
-r{toxinidir}/test-requirements.txt

0 commit comments

Comments
 (0)