diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 59baa53..3baf502 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,10 +50,6 @@ jobs: - name: Pre-commit hooks run: | pre-commit run --all-files - - name: PyLint - run: | - pylint $( find . -path './adafruit*.py' ) - ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" )) - name: Build assets run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location . - name: Archive bundles diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aab5f1c..354c761 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,11 +4,11 @@ repos: - repo: https://github.com/python/black - rev: stable + rev: 20.8b1 hooks: - id: black - repo: https://github.com/fsfe/reuse-tool - rev: latest + rev: v0.12.1 hooks: - id: reuse - repo: https://github.com/pre-commit/pre-commit-hooks @@ -17,3 +17,18 @@ repos: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace +- repo: https://github.com/pycqa/pylint + rev: pylint-2.7.1 + hooks: + - id: pylint + name: pylint (library code) + types: [python] + exclude: "^(docs/|examples/|setup.py$)" +- repo: local + hooks: + - id: pylint_examples + name: pylint (examples code) + description: Run pylint rules on "examples/*.py" files + entry: /usr/bin/env bash -c + args: ['([[ ! -d "examples" ]] || for example in $(find . -path "./examples/*.py"); do pylint --disable=missing-docstring,invalid-name $example; done)'] + language: system diff --git a/.pylintrc b/.pylintrc index 5c31f66..9ed669e 100644 --- a/.pylintrc +++ b/.pylintrc @@ -250,7 +250,7 @@ ignore-comments=yes ignore-docstrings=yes # Ignore imports when computing similarities. -ignore-imports=no +ignore-imports=yes # Minimum lines number of a similarity. min-similarity-lines=4 diff --git a/adafruit_rgbled.py b/adafruit_rgbled.py index 5cafe21..cb46dd0 100644 --- a/adafruit_rgbled.py +++ b/adafruit_rgbled.py @@ -20,7 +20,7 @@ * Adafruit's SimpleIO library: https://github.com/adafruit/Adafruit_CircuitPython_SimpleIO """ -from pulseio import PWMOut +from pwmio import PWMOut from simpleio import map_range __version__ = "0.0.0-auto.0" @@ -33,15 +33,15 @@ class RGBLED: :param red_pin: The physical pin connected to a red LED anode. :type ~microcontroller.Pin: Microcontroller's red_pin. - :type pulseio.PWMOut: PWMOut object associated with red_pin. + :type pwmio.PWMOut: PWMOut object associated with red_pin. :type PWMChannel: PCA9685 PWM channel associated with red_pin. :param green_pin: The physical pin connected to a green LED anode. :type ~microcontroller.Pin: Microcontroller's green_pin. - :type pulseio.PWMOut: PWMOut object associated with green_pin. + :type pwmio.PWMOut: PWMOut object associated with green_pin. :type PWMChannel: PCA9685 PWM channel associated with green_pin. :param blue_pin: The physical pin connected to a blue LED anode. :type ~microcontroller.Pin: Microcontroller's blue_pin. - :type pulseio.PWMOut: PWMOut object associated with blue_pin. + :type pwmio.PWMOut: PWMOut object associated with blue_pin. :type PWMChannel: PCA9685 PWM channel associated with blue_pin. :param bool invert_pwm: False if the RGB LED is common cathode, true if the RGB LED is common anode. diff --git a/docs/conf.py b/docs/conf.py index e34b856..c73f9b6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -25,7 +25,7 @@ # Uncomment the below if you use native CircuitPython modules such as # digitalio, micropython and busio. List the modules you use. Without it, the # autodoc module docs will fail to generate with a warning. -autodoc_mock_imports = ["pulseio"] +autodoc_mock_imports = ["pwmio"] intersphinx_mapping = {