diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cfc8ac3b6..4cff9ef7a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,6 +98,10 @@ jobs: run: | isort --check . + - name: Ruff - linting + run: | + ruff check . + - name: Mypy run: | mypy freqtrade scripts tests @@ -194,6 +198,10 @@ jobs: run: | isort --check . + - name: Ruff - linting + run: | + ruff check . + - name: Mypy run: | mypy freqtrade scripts @@ -252,6 +260,10 @@ jobs: run: | flake8 + - name: Ruff - linting + run: | + ruff check . + - name: Mypy run: | mypy freqtrade scripts tests diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 57ce81b8c..58f526ce9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,6 +27,12 @@ repos: name: isort (python) # stages: [push] + - repo: https://github.com/charliermarsh/ruff-pre-commit + # Ruff version. + rev: 'v0.0.251' + hooks: + - id: ruff + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: diff --git a/pyproject.toml b/pyproject.toml index 82d4ceaf8..7da2a2200 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,3 +56,17 @@ exclude = [ "build_helpers/*.py", ] ignore = ["freqtrade/vendor/**"] + + +[tool.ruff] +line-length = 100 +extend-exclude = [".env"] +extend-select = [ + "TID", + "EXE", + "YTT", + # "DTZ", + # "RSE", + # "TCH", + # "PTH", +] diff --git a/requirements-dev.txt b/requirements-dev.txt index 32b7cfcc5..287cb8ae9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -9,6 +9,7 @@ coveralls==3.3.1 flake8==6.0.0 flake8-tidy-imports==4.8.0 +ruff==0.0.251 mypy==1.0.1 pre-commit==3.0.4 pytest==7.2.1