/ patches / 0001-Removed-pylint-process-from-github-workflow.patch
0001-Removed-pylint-process-from-github-workflow.patch
 1  From 223f4eea34853e043ab9e00cbcf8fb0fd6451aff Mon Sep 17 00:00:00 2001
 2  From: dherrada <dylan.herrada@adafruit.com>
 3  Date: Tue, 2 Mar 2021 16:46:17 -0500
 4  Subject: [PATCH] Removed pylint process from github workflow
 5  
 6  ---
 7   .github/workflows/build.yml |  8 ++------
 8   .pre-commit-config.yaml     | 15 +++++++++++++++
 9   .pylintrc                   |  2 +-
10   3 files changed, 18 insertions(+), 7 deletions(-)
11  
12  diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
13  index 59baa53..621d5ef 100644
14  --- a/.github/workflows/build.yml
15  +++ b/.github/workflows/build.yml
16  @@ -42,18 +42,14 @@ jobs:
17         # (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
18         run: |
19           source actions-ci/install.sh
20  -    - name: Pip install pylint, Sphinx, pre-commit
21  +    - name: Pip install Sphinx, pre-commit
22         run: |
23  -        pip install --force-reinstall pylint Sphinx sphinx-rtd-theme pre-commit
24  +        pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit
25       - name: Library version
26         run: git describe --dirty --always --tags
27       - name: Pre-commit hooks
28         run: |
29           pre-commit run --all-files
30  -    - name: PyLint
31  -      run: |
32  -        pylint $( find . -path './adafruit*.py' )
33  -        ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" ))
34       - name: Build assets
35         run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
36       - name: Archive bundles
37  diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
38  index 07f886c..354c761 100644
39  --- a/.pre-commit-config.yaml
40  +++ b/.pre-commit-config.yaml
41  @@ -17,3 +17,18 @@ repos:
42       -   id: check-yaml
43       -   id: end-of-file-fixer
44       -   id: trailing-whitespace
45  +-   repo: https://github.com/pycqa/pylint
46  +    rev: pylint-2.7.1
47  +    hooks:
48  +    -   id: pylint
49  +        name: pylint (library code)
50  +        types: [python]
51  +        exclude: "^(docs/|examples/|setup.py$)"
52  +-   repo: local
53  +    hooks:
54  +    -   id: pylint_examples
55  +        name: pylint (examples code)
56  +        description: Run pylint rules on "examples/*.py" files
57  +        entry: /usr/bin/env bash -c
58  +        args: ['([[ ! -d "examples" ]] || for example in $(find . -path "./examples/*.py"); do pylint --disable=missing-docstring,invalid-name $example; done)']
59  +        language: system
60  diff --git a/.pylintrc b/.pylintrc
61  index 5c31f66..9ed669e 100644
62  --- a/.pylintrc
63  +++ b/.pylintrc
64  @@ -250,7 +250,7 @@ ignore-comments=yes
65   ignore-docstrings=yes
66   
67   # Ignore imports when computing similarities.
68  -ignore-imports=no
69  +ignore-imports=yes
70   
71   # Minimum lines number of a similarity.
72   min-similarity-lines=4
73  -- 
74  2.24.3 (Apple Git-128)
75