Skip to content

Commit

Permalink
CI/Dev: Add pylint for code quality and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lah7 committed Jul 17, 2024
1 parent 398b494 commit f3a550d
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 4 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Lint

on: [push, pull_request]

jobs:
pylint:
name: Python
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
architecture: 'x64'

- name: Cache Dependencies
uses: actions/cache@v4
with:
path: venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements.txt') }}

- name: Install Dependencies
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- name: Check Python code for errors
run: |
source venv/bin/activate
pylint --errors-only --rcfile=.pylintrc \
--check-quote-consistency=y \
--disable=R \
*.py
5 changes: 5 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[MESSAGES CONTROL]
disable=line-too-long,too-many-instance-attributes,too-many-arguments

[STRING]
check-quote-consistency=yes
15 changes: 11 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@
"-p",
"test_*.py"
],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true,
"pylint.args": [
"--disable=line-too-long",
"--rcfile=.pylintrc",
],
"python.analysis.autoImportCompletions": true
// "pylint.severity": {
// "convention": "Information",
// "refactor": "Information",
// "warning": "Warning",
// "error": "Error",
// "fatal": "Error",
// },
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true,
"python.analysis.autoImportCompletions": true,
}
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ requests

# Build only
cx_Freeze
pylint

0 comments on commit f3a550d

Please sign in to comment.