-
Notifications
You must be signed in to change notification settings - Fork 10
54 lines (46 loc) · 1.84 KB
/
pylint.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
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Pylint
on:
pull_request:
types: [opened, synchronize, reopened, edited, ready_for_review]
jobs:
pylint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Retrieve full commit history for proper diff.
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: python -m pip install pylint
- name: Create Pylintrc file
run: |
echo "[MASTER]" > .pylintrc
echo "max-line-length=120" >> .pylintrc
echo "disable=" >> .pylintrc
echo " C0103, # variable naming style" >> .pylintrc
echo " logging-format-interpolation, # prefer % formatting" >> .pylintrc
echo " broad-except, # catch all exceptions" >> .pylintrc
echo " too-many-locals, # relax constraints" >> .pylintrc
echo " too-few-public-methods," >> .pylintrc
echo " too-many-instance-attributes," >> .pylintrc
echo " too-many-arguments," >> .pylintrc
echo " import-error," >> .pylintrc
echo " attribute-defined-outside-init," >> .pylintrc
echo " redefined-outer-name" >> .pylintrc
- name: Get Python changed files
id: changed-py-files
uses: tj-actions/changed-files@v45
with:
files: |
*.py
**/*.py
- name: Run pylint if Python files changed
if: steps.changed-py-files.outputs.any_changed == 'true'
run: |
echo "One or more Python files have changed."
echo "List of changed files: ${{ steps.changed-py-files.outputs.all_changed_files }}"
python -m pylint --rcfile=.pylintrc ${{ steps.changed-py-files.outputs.all_changed_files }}