Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Check spelling with codespell

on: [push, pull_request]

jobs:
codespell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# codespell version should be kept in sync with .pre-commit-config.yml
- run: pip install --user codespell==2.4.1 tomli
- run: codespell

8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ repos:
hooks:
- id: ruff
id: ruff-format

- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
# version should be kept in sync with .github/workflows/codespell.yml & micropython repo
hooks:
- id: codespell
additional_dependencies:
- tomli
2 changes: 1 addition & 1 deletion micropython/bluetooth/aioble/aioble/central.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ async def _connect(
_connecting.add(device)

# Event will be set in the connected IRQ, and then later
# re-used to notify disconnection.
# reused to notify disconnection.
connection._event = connection._event or asyncio.ThreadSafeFlag()

try:
Expand Down
2 changes: 1 addition & 1 deletion micropython/bluetooth/aioble/aioble/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ async def read(self, timeout_ms=1000):
self._register_with_connection()
# This will be set by the done IRQ.
self._read_status = None
# This will be set by the result and done IRQs. Re-use if possible.
# This will be set by the result and done IRQs. Reuse if possible.
self._read_event = self._read_event or asyncio.ThreadSafeFlag()

# Issue the read.
Expand Down
2 changes: 1 addition & 1 deletion micropython/espflash/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
esp = espflash.ESPFlash(reset, gpio0, uart)
# Enter bootloader download mode, at 115200
esp.bootloader()
# Can now chage to higher/lower baudrate
# Can now change to higher/lower baudrate
esp.set_baudrate(921600)
# Must call this first before any flash functions.
esp.flash_attach()
Expand Down
2 changes: 1 addition & 1 deletion micropython/senml/examples/custom_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Coordinates(SenmlRecord):
def __init__(self, name, **kwargs):
"""overriding the init function so we can initiate the 3 senml records that will represent lat,lon, alt"""
self._lat = SenmlRecord(
"lattitude", unit=SenmlUnits.SENML_UNIT_DEGREES_LATITUDE
"latitude", unit=SenmlUnits.SENML_UNIT_DEGREES_LATITUDE
) # create these before calling base constructor so that all can be init correctly from constructor
self._lon = SenmlRecord("longitude", unit=SenmlUnits.SENML_UNIT_DEGREES_LONGITUDE)
self._alt = SenmlRecord("altitude", unit=SenmlUnits.SENML_UNIT_METER)
Expand Down
2 changes: 1 addition & 1 deletion micropython/senml/senml/senml_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def _build_rec_dict(self, naming_map, appendTo):
elif isinstance(self._value, bytearray):
if (
naming_map["vd"] == "vd"
): # neeed to make a distinction between json (needs base64) and cbor (needs binary)
): # need to make a distinction between json (needs base64) and cbor (needs binary)
result[naming_map["vd"]] = binascii.b2a_base64(self._value, newline=False).decode(
"utf8"
)
Expand Down
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
[tool.codespell]
count = ""
ignore-regex = '\b[A-Z]{3}\b'
ignore-words-list = "ans,asend,deques,dout,emac,extint,hsi,iput,mis,notin,numer,ser,shft,synopsys,technic,ure,curren,te,bu,curch,ist,clen,henc,shttp,unstall,ody"
quiet-level = 3
skip = """
./.git,\
**/test_*.py,\
**/html.entities/html/entities.py,\
"""

[tool.ruff]
extend-exclude = [
"python-stdlib",
Expand Down
2 changes: 1 addition & 1 deletion python-ecosys/requests/manifest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
metadata(version="0.10.2", pypi="requests")
metadata(version="0.10.3", pypi="requests")

package("requests")
6 changes: 3 additions & 3 deletions python-ecosys/requests/requests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ def request(
import binascii

username, password = auth
formated = b"{}:{}".format(username, password)
formated = str(binascii.b2a_base64(formated)[:-1], "ascii")
headers["Authorization"] = "Basic {}".format(formated)
formatted = b"{}:{}".format(username, password)
formatted = str(binascii.b2a_base64(formatted)[:-1], "ascii")
headers["Authorization"] = "Basic {}".format(formatted)

try:
proto, dummy, host, path = url.split("/", 3)
Expand Down
1 change: 1 addition & 0 deletions python-stdlib/hmac/test_hmac.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# codespell:ignore
import hmac

# Uncomment to use micropython-lib hashlib (supports sha512)
Expand Down
4 changes: 2 additions & 2 deletions unix-ffi/email.parser/email/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self, _class=Message, policy=compat32):
textual representation of the message.

The string must be formatted as a block of RFC 2822 headers and header
continuation lines, optionally preceeded by a `Unix-from' header. The
continuation lines, optionally preceded by a `Unix-from' header. The
header block is terminated either by the end of the string or by a
blank line.

Expand Down Expand Up @@ -85,7 +85,7 @@ def __init__(self, *args, **kw):
textual representation of the message.

The input must be formatted as a block of RFC 2822 headers and header
continuation lines, optionally preceeded by a `Unix-from' header. The
continuation lines, optionally preceded by a `Unix-from' header. The
header block is terminated either by the end of the input or by a
blank line.

Expand Down
2 changes: 1 addition & 1 deletion unix-ffi/html.parser/html/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def parse_endtag(self, i):
tagname = namematch.group().lower()
# consume and ignore other stuff between the name and the >
# Note: this is not 100% correct, since we might have things like
# </tag attr=">">, but looking for > after tha name should cover
# </tag attr=">">, but looking for > after the name should cover
# most of the cases and is much simpler
gtpos = rawdata.find(">", namematch.end())
self.handle_endtag(tagname)
Expand Down
4 changes: 2 additions & 2 deletions unix-ffi/http.client/http/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,10 +1038,10 @@ def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0):
self.putheader("Accept-Encoding", "identity")

# we can accept "chunked" Transfer-Encodings, but no others
# NOTE: no TE header implies *only* "chunked"
# NOTE: no 'TE' header implies *only* "chunked"
# self.putheader('TE', 'chunked')

# if TE is supplied in the header, then it must appear in a
# if 'TE' is supplied in the header, then it must appear in a
# Connection header.
# self.putheader('Connection', 'TE')

Expand Down
Loading