Skip to content

Commit

Permalink
Add pre-commit with pylint check (#3)
Browse files Browse the repository at this point in the history
This PR sets up pre-commit for a smooth developer flow:
- Adds pre-commit with a pylint check
  We can extend this further with additional checks.
- Fix the issues detected by the pylint check
- Add a github action to run pre-commit on each PR and on merges to main
  • Loading branch information
PhilippeMoussalli committed Mar 8, 2023
1 parent c507831 commit 8fe6f2c
Show file tree
Hide file tree
Showing 15 changed files with 118 additions and 753 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test pipeline
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip install poetry==1.4.0
poetry install
- name: Test with pre-commit
run: poetry run pre-commit run --all-files --show-diff-on-failure
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ci:
autoupdate_branch: "main"
autoupdate_schedule: monthly
repos:
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
files: "^express/"
args:
[
"-rn", # Only display messages
"-sn", # Don't display the score
"--disable=fixme"
]
Loading

0 comments on commit 8fe6f2c

Please sign in to comment.