Skip to content

Commit

Permalink
Add codespell (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored Feb 21, 2024
1 parent 0ed4f1a commit 28ab99e
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 6 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,29 @@ on:
workflow_dispatch:

jobs:
codespell:
name: codespell
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
- name: 🚀 Check code for common misspellings
run: poetry run pre-commit run codespell --all-files

ruff:
name: Ruff
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ repos:
language: system
types: [yaml]
entry: poetry run check-yaml
- id: codespell
name: ✅ Check code for common misspellings
language: system
types: [text]
exclude: ^poetry\.lock$
entry: poetry run codespell
args:
- --ignore-words-list=nd
- id: detect-private-key
name: 🕵️ Detect Private Keys
language: system
Expand Down
19 changes: 18 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pytest-asyncio = "^0.23"
ruff = "^0.2.2"
pre-commit = "^3.6.2"
pre-commit-hooks = "^4.5.0"
codespell = "^2.2.6"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
4 changes: 2 additions & 2 deletions roombapy/remote_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def _internal_on_connect(self, client, userdata, flags, rc):
"Connected to Roomba %s, response code = %s", self.address, rc
)
connection_error = MQTT_ERROR_MESSAGES.get(rc)
# If response code(rc) is 0 then connection was succesfull.
# If response code(rc) is 0 then connection was successful.
if rc != 0 and connection_error is None:
self.log.warning(
"Unknown connection error: ID=%s."
Expand All @@ -135,7 +135,7 @@ def _internal_on_disconnect(self, client, userdata, rc):
"Disconnected from Roomba %s, response code = %s", self.address, rc
)
connection_error = MQTT_ERROR_MESSAGES.get(rc)
# If response code(rc) is 0 then connection was succesfull.
# If response code(rc) is 0 then connection was successful.
if rc != 0 and connection_error is None:
self.log.warning(
"Unknown disconnection error: ID=%s."
Expand Down
6 changes: 3 additions & 3 deletions roombapy/roomba.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Roomba:
password() class above (or can be auto discovered)
Most of the underlying info was obtained from here:
https://github.com/koalazak/dorita980 many thanks!
The values received from the Roomba as stored in a dictionay called
The values received from the Roomba as stored in a dictionary called
master_state, and can be accessed at any time, the contents are live, and
will build with time after connection.
This is not needed if the forward to mqtt option is used, as the events will
Expand Down Expand Up @@ -297,8 +297,8 @@ def decode_payload(self, topic, payload):
def decode_topics(self, state, prefix=None):
"""Decode json data dict and publish as individual topics.
Publish to brokerFeedback/topic the keys are concatinated with _
to make one unique topic name strings are expressely converted
Publish to brokerFeedback/topic the keys are concatenated with _
to make one unique topic name strings are expressively converted
to strings to avoid unicode representations
"""
for key, value in state.items():
Expand Down

0 comments on commit 28ab99e

Please sign in to comment.