From 5cbc3678259b16a4453917bef6d7096caffb1b4f Mon Sep 17 00:00:00 2001 From: Patrick Loeber <98830383+ploeber@users.noreply.github.com> Date: Wed, 4 Sep 2024 14:42:45 +0200 Subject: [PATCH] add ruff.toml --- .github/workflows/lint.yml | 5 +++-- ruff.toml | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 ruff.toml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index dbfe409..fe17721 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -23,7 +23,7 @@ jobs: - uses: chartboost/ruff-action@v1 with: version: 0.3.5 - args: 'format --check' + args: 'format --check --config ./ruff.toml' ruff-isort: needs: [ ] @@ -33,7 +33,7 @@ jobs: - uses: chartboost/ruff-action@v1 with: version: 0.3.5 - args: '--select I' + args: '--select I --config ./ruff.toml' ruff: needs: [] @@ -43,6 +43,7 @@ jobs: - uses: chartboost/ruff-action@v1 with: version: 0.3.5 + args: '--config ./ruff.toml' # Only run ruff on changed files changed-files: 'true' diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..b89bcb3 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,10 @@ +[lint] + +# Enable default rules plus S101 (check for asserts). +select = ["E4", "E7", "E9", "F", "S101"] + +[lint.per-file-ignores] +# Ignore import violations in all init files. +"__init__.py" = ["E402"] +# Ignore assert checks in all test files. +"**/*test*.py" = ["S101"] \ No newline at end of file