diff options
author | Daniil Baturin <daniil@vyos.io> | 2024-04-04 15:09:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-04 15:09:55 +0200 |
commit | 7f077a0dfc410d974f891e34f0726809d4b1a5b1 (patch) | |
tree | 637bdf33a0e87ae735ecd3f19ab120863b3f30be /.github/workflows | |
parent | d729069c58c0a670e1f57d6d12c57a41e330742b (diff) | |
parent | ca84e6845e6cfeb5f4f5798594b390afb735901f (diff) | |
download | vyos-1x-7f077a0dfc410d974f891e34f0726809d4b1a5b1.tar.gz vyos-1x-7f077a0dfc410d974f891e34f0726809d4b1a5b1.zip |
Merge pull request #3241 from c-po/spring-cleaning-sagitta
T6199: spring cleaning - drop unused Python imports (backport #3240)
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/unused-imports.yml | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/.github/workflows/unused-imports.yml b/.github/workflows/unused-imports.yml new file mode 100644 index 000000000..83098ddf6 --- /dev/null +++ b/.github/workflows/unused-imports.yml @@ -0,0 +1,29 @@ +name: Check for unused imports using Pylint +on: + pull_request_target: + types: [opened, reopened, ready_for_review, locked] + +jobs: + build: + 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 |