Skip to content

Commit 28ea954

Browse files
authored
Merge pull request #11 from FoamyGuy/pylint_to_precommit
pylint to precommit
2 parents 88fd196 + 5178dab commit 28ea954

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,9 @@ jobs:
4747
pip install --force-reinstall pylint Sphinx sphinx-rtd-theme pre-commit
4848
- name: Library version
4949
run: git describe --dirty --always --tags
50-
#- name: Pre-commit hooks
51-
# run: |
52-
# pre-commit run --all-files
53-
- name: PyLint
50+
- name: Pre-commit hooks
5451
run: |
55-
pylint $( find . -path './adafruit*.py' )
56-
([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" ))
52+
pre-commit run --all-files
5753
- name: Build assets
5854
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
5955
- name: Build docs

.pre-commit-config.yaml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
repos:
66
- repo: https://github.com/python/black
7-
rev: latest
7+
rev: 20.8b1
88
hooks:
99
- id: black
1010
- repo: https://github.com/fsfe/reuse-tool
11-
rev: latest
11+
rev: v0.12.1
1212
hooks:
1313
- id: reuse
1414
- repo: https://github.com/pre-commit/pre-commit-hooks
@@ -17,3 +17,18 @@ repos:
1717
- id: check-yaml
1818
- id: end-of-file-fixer
1919
- id: trailing-whitespace
20+
- repo: https://github.com/pycqa/pylint
21+
rev: pylint-2.7.1
22+
hooks:
23+
- id: pylint
24+
name: pylint (library code)
25+
types: [python]
26+
exclude: "^(docs/|examples/|setup.py$)"
27+
- repo: local
28+
hooks:
29+
- id: pylint_examples
30+
name: pylint (examples code)
31+
description: Run pylint rules on "examples/*.py" files
32+
entry: /usr/bin/env bash -c
33+
args: ['([[ ! -d "examples" ]] || for example in $(find . -path "./examples/*.py"); do pylint --disable=missing-docstring,invalid-name $example; done)']
34+
language: system

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ ignore-comments=yes
250250
ignore-docstrings=yes
251251

252252
# Ignore imports when computing similarities.
253-
ignore-imports=no
253+
ignore-imports=yes
254254

255255
# Minimum lines number of a similarity.
256256
min-similarity-lines=4

0 commit comments

Comments
 (0)