diff options
author | Christian Breunig <christian@breunig.cc> | 2024-04-04 20:21:08 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-04-04 20:30:58 +0200 |
commit | faa153524f04ebe8ab5f12d7afe6df2a6eb3728a (patch) | |
tree | 762ccc134807183b93280b071ae47070ad5bce1a /.github | |
parent | 9b4a3bc54ec6d2ff8e435add5e2de995a54dfc6a (diff) | |
download | vyos-1x-faa153524f04ebe8ab5f12d7afe6df2a6eb3728a.tar.gz vyos-1x-faa153524f04ebe8ab5f12d7afe6df2a6eb3728a.zip |
Makefile: improve "unused-imports" target
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/unused-imports.yml | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/.github/workflows/unused-imports.yml b/.github/workflows/unused-imports.yml index 83098ddf6..e716a9c01 100644 --- a/.github/workflows/unused-imports.yml +++ b/.github/workflows/unused-imports.yml @@ -1,29 +1,20 @@ name: Check for unused imports using Pylint -on: - pull_request_target: - types: [opened, reopened, ready_for_review, locked] +on: push + # pull_request_target: + # types: [opened, reopened, ready_for_review, locked] jobs: - build: + Check-Unused-Imports: runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.11"] steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pylint - - name: Analysing the code with pylint - run: | - tmp=$(git ls-files *.py | xargs pylint | grep W0611 | wc -l) - if [[ $tmp -gt 0 ]]; then - echo "Found $tmp occurrence of unused Python import statements!" - exit 1 - fi - exit 0 + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: 3.11 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pylint + - name: Analysing the code with pylint + run: make unused-imports |