-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (35 loc) · 1.13 KB
/
flake8_linter_python_files.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Lint Python Files - Flake8
# flake8 to check the syntax of changed files
# but ingore E501 error (line too long) and W503 error (line break before binary operator)
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
fetch-depth: 0 # Ensure the entire history is fetched
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install Flake8
run: pip install flake8
- name: Get Changed Files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
**.py
files_ignore: |
scripts/jobs/parking/**/*.py
- name: Lint Changed Python Files
if: steps.changed-files.outputs.any_changed == 'true'
run: |
CHANGED_FILES="${{ steps.changed-files.outputs.all_changed_files }}"
IFS=' ' read -r -a FILE_ARRAY <<< "$CHANGED_FILES"
for FILE in "${FILE_ARRAY[@]}"
do
flake8 $FILE --ignore=E501,W503
done