Add ruff linting - initial configuration

This commit is contained in:
Matthias 2023-02-22 21:06:07 +01:00
parent 2bc9413be1
commit 549a0e1c44
4 changed files with 33 additions and 0 deletions

View File

@ -98,6 +98,10 @@ jobs:
run: | run: |
isort --check . isort --check .
- name: Ruff - linting
run: |
ruff check .
- name: Mypy - name: Mypy
run: | run: |
mypy freqtrade scripts tests mypy freqtrade scripts tests
@ -194,6 +198,10 @@ jobs:
run: | run: |
isort --check . isort --check .
- name: Ruff - linting
run: |
ruff check .
- name: Mypy - name: Mypy
run: | run: |
mypy freqtrade scripts mypy freqtrade scripts
@ -252,6 +260,10 @@ jobs:
run: | run: |
flake8 flake8
- name: Ruff - linting
run: |
ruff check .
- name: Mypy - name: Mypy
run: | run: |
mypy freqtrade scripts tests mypy freqtrade scripts tests

View File

@ -27,6 +27,12 @@ repos:
name: isort (python) name: isort (python)
# stages: [push] # 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 - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0 rev: v4.4.0
hooks: hooks:

View File

@ -56,3 +56,17 @@ exclude = [
"build_helpers/*.py", "build_helpers/*.py",
] ]
ignore = ["freqtrade/vendor/**"] ignore = ["freqtrade/vendor/**"]
[tool.ruff]
line-length = 100
extend-exclude = [".env"]
extend-select = [
"TID",
"EXE",
"YTT",
# "DTZ",
# "RSE",
# "TCH",
# "PTH",
]

View File

@ -9,6 +9,7 @@
coveralls==3.3.1 coveralls==3.3.1
flake8==6.0.0 flake8==6.0.0
flake8-tidy-imports==4.8.0 flake8-tidy-imports==4.8.0
ruff==0.0.251
mypy==1.0.1 mypy==1.0.1
pre-commit==3.0.4 pre-commit==3.0.4
pytest==7.2.1 pytest==7.2.1