forked from abrignoni/ALEAPP
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.31 KB
/
python_lint.yml
File metadata and controls
44 lines (37 loc) · 1.31 KB
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
42
43
44
name: Python Lint Check
on:
pull_request:
paths:
- '**.py' # only trigger on python files
jobs:
lint-changed-files:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Required to fetch the base branch for comparison
fetch-depth: 0
- name: Get changed Python files
id: changed-files-py
uses: tj-actions/changed-files@v46 # This action finds changed files
with:
files: |
**.py
- name: Set up Python
if: steps.changed-files-py.outputs.any_changed == 'true'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Pylint
if: steps.changed-files-py.outputs.any_changed == 'true'
run: python -m pip install pylint
- name: Install dependencies
if: steps.changed-files-py.outputs.any_changed == 'true'
run: python -m pip install -r requirements.txt
- name: Run on changed files
if: steps.changed-files-py.outputs.any_changed == 'true'
run: |
echo "Linting the following files:"
echo "${{ steps.changed-files-py.outputs.all_changed_files }}"
PYTHONPATH=. pylint ${{ steps.changed-files-py.outputs.all_changed_files }} --disable=C,R