Skip to content

Commit

Permalink
Add more static code analysis (#69)
Browse files Browse the repository at this point in the history
* Add isort, flake8 and bandit

* Add codespell

* Sort files
  • Loading branch information
Santobert authored Jan 18, 2021
1 parent 2707c69 commit 3e555f9
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ jobs:
python-version: "3.8"
architecture: "x64"
- run: pip install -r requirements.txt
- run: codespell
- run: black --check .
- run: isort --check --diff .
- run: pylint pybotvac
- run: flake8 pybotvac
- run: bandit -r pybotvac
2 changes: 1 addition & 1 deletion pybotvac/neato.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ class Neato(Vendor):
name = "neato"
endpoint = "https://beehive.neatocloud.com/"
auth_endpoint = "https://apps.neatorobotics.com/oauth2/authorize"
token_endpoint = "https://beehive.neatocloud.com/oauth2/token"
token_endpoint = "https://beehive.neatocloud.com/oauth2/token" # nosec
scope = ["public_profile", "control_robots", "maps"]
cert_path = os.path.join(os.path.dirname(__file__), "cert", "neatocloud.com.crt")
2 changes: 1 addition & 1 deletion pybotvac/robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(

# pylint: disable=anomalous-backslash-in-string
self._url = "{endpoint}/vendors/{vendor_name}/robots/{serial}/messages".format(
endpoint=re.sub(":\d+", "", endpoint), # Remove port number
endpoint=re.sub(":\d+", "", endpoint), # noqa: W605, Remove port number
vendor_name=vendor.name,
serial=self.serial,
)
Expand Down
2 changes: 1 addition & 1 deletion pybotvac/vorwerk.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Vorwerk(Vendor):
name = "vorwerk"
endpoint = "https://beehive.ksecosys.com/"
passwordless_endpoint = "https://mykobold.eu.auth0.com/passwordless/start"
token_endpoint = "https://mykobold.eu.auth0.com/oauth/token"
token_endpoint = "https://mykobold.eu.auth0.com/oauth/token" # nosec
scope = ["openid", "email", "profile", "read:current_user", "offline_access"]
audience = "https://mykobold.eu.auth0.com/userinfo"
source = "vorwerk_auth0"
6 changes: 5 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
urllib3
requests
requests_oauthlib
bandit>=1
black
pylint
codespell>=2
flake8>=3
isort>=5
pylint>=2.6
19 changes: 19 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[codespell]
skip = ./.git,./.mypy_cache,./.vscode,./venv

[flake8]
exclude = .vscode,venv
max-line-length = 88
ignore =
F401, # Import error, pylint covers this
# Formatting errors that are covered by black
D202,
E203,
E501,
W503,
W504,

[isort]
profile=black
multi_line_output = 3
src_paths=pybotvac, sample

0 comments on commit 3e555f9

Please sign in to comment.