зеркало из https://github.com/docker/docker-py.git
Switch linting from flake8 to ruff
Signed-off-by: Aarni Koskela <akx@iki.fi>
This commit is contained in:
Родитель
8a3402c049
Коммит
9313536601
|
@ -6,16 +6,16 @@ env:
|
|||
DOCKER_BUILDKIT: '1'
|
||||
|
||||
jobs:
|
||||
flake8:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- run: pip install -U flake8
|
||||
- name: Run flake8
|
||||
run: flake8 docker/ tests/
|
||||
python-version: '3.11'
|
||||
- run: pip install -U ruff==0.0.284
|
||||
- name: Run ruff
|
||||
run: ruff docker tests
|
||||
|
||||
unit-tests:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
@ -44,7 +44,7 @@ paragraph in the Docker contribution guidelines.
|
|||
Before we can review your pull request, please ensure that nothing has been
|
||||
broken by your changes by running the test suite. You can do so simply by
|
||||
running `make test` in the project root. This also includes coding style using
|
||||
`flake8`
|
||||
`ruff`
|
||||
|
||||
### 3. Write clear, self-contained commits
|
||||
|
||||
|
|
8
Makefile
8
Makefile
|
@ -46,7 +46,7 @@ build-dind-certs:
|
|||
docker build -t dpy-dind-certs -f tests/Dockerfile-dind-certs .
|
||||
|
||||
.PHONY: test
|
||||
test: flake8 unit-test-py3 integration-dind integration-dind-ssl
|
||||
test: ruff unit-test-py3 integration-dind integration-dind-ssl
|
||||
|
||||
.PHONY: unit-test-py3
|
||||
unit-test-py3: build-py3
|
||||
|
@ -163,9 +163,9 @@ integration-dind-ssl: build-dind-certs build-py3 setup-network
|
|||
|
||||
docker rm -vf dpy-dind-ssl dpy-dind-certs
|
||||
|
||||
.PHONY: flake8
|
||||
flake8: build-py3
|
||||
docker run -t --rm docker-sdk-python3 flake8 docker tests
|
||||
.PHONY: ruff
|
||||
ruff: build-py3
|
||||
docker run -t --rm docker-sdk-python3 ruff docker tests
|
||||
|
||||
.PHONY: docs
|
||||
docs: build-docs
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
# flake8: noqa
|
||||
from .api import APIClient
|
||||
from .client import DockerClient, from_env
|
||||
from .context import Context
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
# flake8: noqa
|
||||
from .client import APIClient
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
# flake8: noqa
|
||||
from .context import Context
|
||||
from .api import ContextAPI
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# flake8: noqa
|
||||
|
||||
from .store import Store
|
||||
from .errors import StoreError, CredentialsNotFound
|
||||
from .constants import *
|
||||
from .constants import * # noqa: F403
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
# flake8: noqa
|
||||
from .unixconn import UnixHTTPAdapter
|
||||
from .ssladapter import SSLHTTPAdapter
|
||||
try:
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
# flake8: noqa
|
||||
from .containers import (
|
||||
ContainerConfig, HostConfig, LogConfig, Ulimit, DeviceRequest
|
||||
)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# flake8: noqa
|
||||
|
||||
from .build import create_archive, exclude_paths, mkbuildcontext, tar
|
||||
from .decorators import check_resource, minimum_version, update_headers
|
||||
from .utils import (
|
||||
|
|
|
@ -3,3 +3,6 @@ requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
|
|||
|
||||
[tool.setuptools_scm]
|
||||
write_to = 'docker/_version.py'
|
||||
|
||||
[tool.ruff.per-file-ignores]
|
||||
"**/__init__.py" = ["F401"]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
setuptools==65.5.1
|
||||
coverage==6.4.2
|
||||
flake8==4.0.1
|
||||
ruff==0.0.284
|
||||
pytest==7.1.2
|
||||
pytest-cov==3.0.0
|
||||
pytest-timeout==2.1.0
|
||||
|
|
6
tox.ini
6
tox.ini
|
@ -1,5 +1,5 @@
|
|||
[tox]
|
||||
envlist = py{37,38,39,310,311}, flake8
|
||||
envlist = py{37,38,39,310,311}, ruff
|
||||
skipsdist=True
|
||||
|
||||
[testenv]
|
||||
|
@ -10,7 +10,7 @@ deps =
|
|||
-r{toxinidir}/test-requirements.txt
|
||||
-r{toxinidir}/requirements.txt
|
||||
|
||||
[testenv:flake8]
|
||||
commands = flake8 docker tests setup.py
|
||||
[testenv:ruff]
|
||||
commands = ruff docker tests setup.py
|
||||
deps =
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
|
|
Загрузка…
Ссылка в новой задаче