-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code style cleanup with black, flake8 and isort (#77)
* Test for membership should be 'not in' (Flake8 rule E713) * Whitespace fixes (various Flake8 rules) * Don't import unused functions getProperties and getAttribute (Flake8 rule F401) * Don't use f-string when there's no placeholder (Flake8 rule F541) * Do not use bare 'except' (Flake8 rule E722) * Run black and add it to pre-commit * Use lazy % formatting in logging functions * Add flake8 to pre-commit * Add use of pre-commit to development docs * Run pre-commit in GitHub Actions workflow * Run isort * Specify encoding when opening file (Pylint rule W1514) * Remove useless super() delegation (Pylint rule W0246) * Remove useless super() delegation (Pylint rule W0246) * Add docstrings to classes and methods * Use PascalCase naming style for classes * Use snake_case for variable and argument names * Explicitly re-raise new exception from other one for better tracebacks (Pylint rule W0707) * Remove unneeded run invocation from ble_gateway.py
- Loading branch information
1 parent
e398a5e
commit 22d5eb1
Showing
8 changed files
with
484 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: check | ||
|
||
on: | ||
push: | ||
branches: | ||
- development | ||
pull_request: | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
- name: Set up Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: "3.11" | ||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 22.10.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 5.0.4 | ||
hooks: | ||
- id: flake8 | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.