From 58fa7843674072af62a0fdc1722f9d22a4d1a718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Tue, 31 Dec 2024 18:14:42 +0100 Subject: [PATCH] Unify lint workflows --- .github/workflows/black.yml | 52 ---------------------- .github/workflows/{pylint.yml => lint.yml} | 47 +++++++++++++++---- 2 files changed, 39 insertions(+), 60 deletions(-) delete mode 100644 .github/workflows/black.yml rename .github/workflows/{pylint.yml => lint.yml} (55%) diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml deleted file mode 100644 index 254b059..0000000 --- a/.github/workflows/black.yml +++ /dev/null @@ -1,52 +0,0 @@ ---- -name: Lint Code Base (black) - -defaults: - run: - # To load bashrc - shell: bash -ieo pipefail {0} - -on: - pull_request: - branches: [master, dev] - schedule: - # run CI every day even if no PRs/merges occur - - cron: '0 12 * * *' - -jobs: - build: - name: Lint Code Base (black) - runs-on: ubuntu-latest - - permissions: - contents: read - packages: read - # To report GitHub Actions status checks - statuses: write - - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: Set up Python 3.8 - uses: actions/setup-python@v5 - with: - python-version: 3.8 - - - name: Install dependencies - run: | - mkdir -p .github/linters - cp pyproject.toml .github/linters - - - name: Black - uses: super-linter/super-linter/slim@v7.2.1 - if: always() - env: - # run linter on everything to catch preexisting problems - VALIDATE_ALL_CODEBASE: true - DEFAULT_BRANCH: master - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # Run only black - VALIDATE_PYTHON_BLACK: true - PYTHON_BLACK_CONFIG_FILE: pyproject.toml - FILTER_REGEX_EXCLUDE: .*tests/.*.(json|zip|sol) diff --git a/.github/workflows/pylint.yml b/.github/workflows/lint.yml similarity index 55% rename from .github/workflows/pylint.yml rename to .github/workflows/lint.yml index 4d36bea..df53232 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/lint.yml @@ -1,5 +1,5 @@ --- -name: Lint Code Base (pylint) +name: Lint Code Base defaults: run: @@ -13,17 +13,17 @@ on: # run CI every day even if no PRs/merges occur - cron: '0 12 * * *' +permissions: + contents: read + packages: read + # To report GitHub Actions status checks + statuses: write + jobs: - build: + pylint: name: Lint Code Base (pylint) runs-on: ubuntu-latest - permissions: - contents: read - packages: read - # To report GitHub Actions status checks - statuses: write - steps: - name: Checkout Code uses: actions/checkout@v4 @@ -55,3 +55,34 @@ jobs: VALIDATE_PYTHON_PYLINT: true PYTHON_PYLINT_CONFIG_FILE: pyproject.toml FILTER_REGEX_EXCLUDE: .*tests/.*.(json|zip|sol) + + black: + name: Lint Code Base (black) + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Set up Python 3.8 + uses: actions/setup-python@v5 + with: + python-version: 3.8 + + - name: Install dependencies + run: | + mkdir -p .github/linters + cp pyproject.toml .github/linters + + - name: Black + uses: super-linter/super-linter/slim@v7.2.1 + if: always() + env: + # run linter on everything to catch preexisting problems + VALIDATE_ALL_CODEBASE: true + DEFAULT_BRANCH: master + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Run only black + VALIDATE_PYTHON_BLACK: true + PYTHON_BLACK_CONFIG_FILE: pyproject.toml + FILTER_REGEX_EXCLUDE: .*tests/.*.(json|zip|sol)