From 951e6ce47aa99fa063a69c8d1964d85bf350c823 Mon Sep 17 00:00:00 2001 From: Piotr Jurkiewicz Date: Mon, 26 Aug 2024 23:25:01 +0200 Subject: [PATCH] Add ruff automated test --- .github/workflows/python-test.yml | 18 ++++++++- ruff.toml | 67 +++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 ruff.toml diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index c7df67d..1b6cda9 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -10,14 +10,28 @@ on: branches: ['master'] jobs: - build: + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install pip and ruff + run: | + python -m pip install --upgrade pip + pip install ruff==0.6.2 + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Run ruff + run: ruff check --output-format=github flow_models + + build: runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: ['3.9', '3.10', '3.11', '3.12', '3.13.0-rc.1', '3.x', 'pypy3.10'] - steps: - uses: actions/checkout@v3 - name: Checkout submodule diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..ce81510 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,67 @@ +line-length = 220 +target-version = "py312" + +[lint] +select = ["ALL"] + +ignore = [ + "ANN001", + "ANN002", + "ANN003", + "ANN201", + "ANN202", + "ANN204", + "ARG005", + "B007", + "B028", + "BLE001", + "C901", + "D100", + "D101", + "D102", + "D103", + "D104", + "D105", + "D107", + "D202", + "D212", + "D413", + "E501", + "EM101", + "EM102", + "ERA001", + "EXE001", + "FBT002", + "FIX002", + "I001", + "ICN001", + "PD010", + "PD901", + "PERF401", + "PERF403", + "PLR09", + "PLR2004", + "PLR5501", + "PLW2901", + "PTH123", + "Q000", + "RET504", + "RET505", + "RET506", + "RUF012", + "S101", + "S301", + "S307", + "S311", + "S324", + "S603", + "S607", + "SIM108", + "SIM115", + "SLF001", + "TD002", + "TD003", + "T201", + "TRY003", + "TRY004" +]