Skip to content

Commit

Permalink
skip linting if no Python files edited
Browse files Browse the repository at this point in the history
  • Loading branch information
reepoi committed Jun 26, 2023
1 parent 5d9d48e commit 8c6c36a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ jobs:
- name: Setup Flake8 output matcher for PR annotations
run: echo '::add-matcher::.github/workflows/flake8-pr-annotation-matcher.json'
- name: Get names of changed files
id: changed-files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: echo CHANGED_FILENAMES=$(gh pr view --repo pvlib/pvlib-python ${{ env.PR_NUMBER }} --json files -q '.files[].path | select(endswith(".py"))')
>> ${{ github.env }}
run: echo CHANGED_FILES=$(gh pr view ${{ env.PR_NUMBER }} --repo pvlib/pvlib-python --json files -q '.files[].path | select(endswith(".py"))')
>> $GITHUB_OUTPUT
- name: Run Flake8 linter
if: ${{ steps.changed-files.outputs.CHANGED_FILES }} != ''
run: flake8
${{ env.CHANGED_FILENAMES }}
${{ steps.changed-files.outputs.CHANGED_FILES }}
--exclude pvlib/version.py
--ignore E201,E241,E226,W503,W504
--max-line-length 79

0 comments on commit 8c6c36a

Please sign in to comment.