Skip to content

Commit

Permalink
lint non-test files and test files differently
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Apr 12, 2024
1 parent d795e0e commit ababf7f
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .github/workflows/test-python-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,28 @@ jobs:

- name: 🔎 Check Static Code
working-directory: ${{ inputs.working-directory }}
run: if ! pipenv run pylint --rcfile=${{ env.PYPROJECT_TOML }} $(git ls-files '${{ inputs.source-path }}/*.py'); then exit 1; fi
run: |
if ! pipenv run pylint --rcfile=${{ env.PYPROJECT_TOML }} $(
git ls-files \
'${{ inputs.source-path }}/*.py' \
'${{ inputs.source-path }}/**/*.py' \
':!${{ inputs.source-path }}/test_*.py' \
':!${{ inputs.source-path }}/**/test_*.py' \
':!${{ inputs.source-path }}/*_test.py' \
':!${{ inputs.source-path }}/**/*_test.py'
)
then exit 1
fi
if ! pipenv run pylint --rcfile=${{ env.PYPROJECT_TOML }} --disable=duplicate-code $(
git ls-files \
'${{ inputs.source-path }}/test_*.py' \
'${{ inputs.source-path }}/**/test_*.py' \
'${{ inputs.source-path }}/*_test.py' \
'${{ inputs.source-path }}/**/*_test.py'
)
then exit 1
fi
- name: 🔎 Check Django Migrations
if: inputs.check-django-migrations
Expand Down

0 comments on commit ababf7f

Please sign in to comment.