Skip to content

Commit 5f89587

Browse files
Adding configuration to ensure pylint failures are detected anytime someone makes a local commit and when a new PR is raised against main branch.
1 parent 3e3433d commit 5f89587

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/pylint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Pylint Style Check
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**.py'
7+
8+
jobs:
9+
pylint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.10" # Adjust to match your target environment
18+
cache: 'pip'
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
24+
25+
- name: Run Pylint
26+
run: |
27+
# Use the repository's .pylintrc rules on all python files
28+
pylint $(git ls-files '*.py')

.pre-commit-config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
9+
- repo: local
10+
hooks:
11+
- id: pylint
12+
name: pylint
13+
entry: pylint
14+
language: system
15+
types: [python]
16+
require_serial: true
17+
# Optional: You can list specific files to exclude here if needed
18+
# exclude: ^tests/

0 commit comments

Comments
 (0)