diff --git a/.github/workflows/github-action-lint.yaml b/.github/workflows/github-action-lint.yaml index ec2f99b..b98de55 100644 --- a/.github/workflows/github-action-lint.yaml +++ b/.github/workflows/github-action-lint.yaml @@ -17,6 +17,9 @@ jobs: run: | python -m pip install --upgrade pip pip install -e ".[lint]" - - name: Lint with flake8 + - name: Lint with ruff run: | - flake8 src tests --show-source --statistics + ruff check --output-format=github src tests + - name: Format with ruff + run: | + ruff format --check src tests diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e5c3127..49c8553 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,14 +5,11 @@ repos: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - - repo: https://github.com/psf/black - rev: 22.8.0 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.14 hooks: - - id: black - - repo: https://github.com/pycqa/flake8 - rev: 5.0.4 - hooks: - - id: flake8 + - id: ruff + - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy rev: "4daa14b" hooks: diff --git a/pyproject.toml b/pyproject.toml index 6c7072a..5e39706 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,12 +15,7 @@ requires-python = ">=3.9" dependencies = ["fastapi ~= 0.108", "uvicorn[standard]", "geopandas ~= 0.14", "pyarrow ~= 14.0"] [project.optional-dependencies] -lint = [ - "flake8 ~= 5.0", - "flake8-bandit ~= 4.1", - "flake8-docstrings ~= 1.6", - "flake8-black ~= 0.3", -] +lint = ["ruff ~= 0.1"] type = ["mypy ~= 1.7.1", "types-requests ~= 2.28", "pandas-stubs ~= 1.5"] test = ["pytest ~= 7.1", "coverage ~= 6.5", "pytest-cov ~= 4.0", "httpx"] doc = [ @@ -33,7 +28,6 @@ dev = [ "ifk-sweden-map[type]", "ifk-sweden-map[test]", "ifk-sweden-map[doc]", - "black ~= 22.8", "pre-commit ~= 2.20", "ipykernel" ]