Added codespell CI job and fixed existing spelling issues.
Dependency Audit / Dependency Audit (push) Successful in 15s
CI / Formatting (push) Successful in 12s
CI / Linting (push) Successful in 12s
CI / Tests (Python 3.12) (push) Successful in 25s
CI / Tests (Python 3.13) (push) Successful in 24s
CI / Tests (Python 3.14) (push) Successful in 22s
CI / Type Checking (push) Successful in 24s
CI / Spelling (push) Successful in 13s
Dependency Audit / Dependency Audit (push) Successful in 15s
CI / Formatting (push) Successful in 12s
CI / Linting (push) Successful in 12s
CI / Tests (Python 3.12) (push) Successful in 25s
CI / Tests (Python 3.13) (push) Successful in 24s
CI / Tests (Python 3.14) (push) Successful in 22s
CI / Type Checking (push) Successful in 24s
CI / Spelling (push) Successful in 13s
This commit is contained in:
@@ -104,3 +104,24 @@ jobs:
|
||||
|
||||
- name: Check types with Mypy
|
||||
run: uv run mypy .
|
||||
|
||||
spelling:
|
||||
name: Spelling
|
||||
runs-on: logaldeveloper-archlinux
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Cache uv packages
|
||||
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||
with:
|
||||
path: ~/.cache/uv
|
||||
key: uv-${{ hashFiles('uv.lock') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: uv sync
|
||||
|
||||
- name: Check spelling with codespell
|
||||
run: uv run codespell
|
||||
|
||||
@@ -46,6 +46,7 @@ Owlbot is a modular, event-driven chat bot for Owncast.
|
||||
- `uv run ruff check .`: run lint checks.
|
||||
- `uv run mypy .`: run strict type checking.
|
||||
- `uv run pip-audit --skip-editable`: audit dependencies for known vulnerabilities.
|
||||
- `uv run codespell`: check spelling across the project.
|
||||
|
||||
## Creating Modules
|
||||
- Read `docs/Modules.md` first, then focused references:
|
||||
@@ -60,6 +61,7 @@ Before committing any changes, always run the following checks and make sure the
|
||||
2. `uv run ruff check .` -- catch lint violations. Fix any issues before proceeding.
|
||||
3. `uv run mypy .` -- confirm type safety. The project uses strict mode, so all type errors must be resolved.
|
||||
4. `uv run pytest -v --cov --cov-report=` -- run the full test suite and confirm nothing is broken.
|
||||
5. `uv run codespell` -- catch spelling mistakes in code, comments, and documentation.
|
||||
|
||||
Do not commit if any of these fail.
|
||||
|
||||
|
||||
@@ -49,9 +49,9 @@ class PlaceholderError(Exception):
|
||||
# BST = British Summer Time (+1), not Bangladesh/Bougainville
|
||||
# CDT = Central Daylight Time (-5), not Cuba Daylight Time (-4)
|
||||
# CST = Central Standard Time (-6), not China (+8) or Cuba (-5)
|
||||
# ECT = Ecuador Time (-5), not Eastern Caribbean Time (-4)
|
||||
# ECT = Ecuador Time (-5), not Eastern Caribbean Time (-4) # codespell:ignore ect
|
||||
# GST = Gulf Standard Time (+4), not South Georgia Time (-2)
|
||||
# IST = India Standard Time (+5:30), not Irish (+1) or Israel (+2)
|
||||
# IST = India Standard Time (+5:30), not Irish or Israel # codespell:ignore ist
|
||||
# LHST = Lord Howe Standard Time (+10:30), not summer (+11)
|
||||
# MST = Mountain Standard Time (-7), not Malaysia Standard Time (+8)
|
||||
# PST = Pacific Standard Time (-8), not Philippine Standard Time (+8)
|
||||
@@ -112,7 +112,7 @@ TIMEZONE_OFFSETS: dict[str, float] = {
|
||||
"EASST": -5,
|
||||
"EAST": -6,
|
||||
"EAT": 3,
|
||||
"ECT": -5,
|
||||
"ECT": -5, # codespell:ignore ect
|
||||
"EDT": -4,
|
||||
"EEST": 3,
|
||||
"EET": 2,
|
||||
@@ -147,7 +147,7 @@ TIMEZONE_OFFSETS: dict[str, float] = {
|
||||
"IRDT": 4.5,
|
||||
"IRKT": 8,
|
||||
"IRST": 3.5,
|
||||
"IST": 5.5,
|
||||
"IST": 5.5, # codespell:ignore ist
|
||||
"JST": 9,
|
||||
"KALT": 2,
|
||||
"KGT": 6,
|
||||
@@ -194,7 +194,7 @@ TIMEZONE_OFFSETS: dict[str, float] = {
|
||||
"PKT": 5,
|
||||
"PMDT": -2,
|
||||
"PMST": -3,
|
||||
"PONT": 11,
|
||||
"PONT": 11, # codespell:ignore pont
|
||||
"PST": -8,
|
||||
"PWT": 9,
|
||||
"PYST": -3,
|
||||
@@ -213,9 +213,9 @@ TIMEZONE_OFFSETS: dict[str, float] = {
|
||||
"SRT": -3,
|
||||
"SST": -11,
|
||||
"SYOT": 3,
|
||||
"TAHT": -10,
|
||||
"TAHT": -10, # codespell:ignore taht
|
||||
"TFT": 5,
|
||||
"THA": 7,
|
||||
"THA": 7, # codespell:ignore tha
|
||||
"TJT": 5,
|
||||
"TKT": 13,
|
||||
"TLT": 9,
|
||||
@@ -236,14 +236,14 @@ TIMEZONE_OFFSETS: dict[str, float] = {
|
||||
"VOST": 6,
|
||||
"VUT": 11,
|
||||
"WAKT": 12,
|
||||
"WAST": 2,
|
||||
"WAST": 2, # codespell:ignore wast
|
||||
"WAT": 1,
|
||||
"WEST": 1,
|
||||
"WET": 0,
|
||||
"WGST": -2,
|
||||
"WGT": -3,
|
||||
"WIB": 7,
|
||||
"WIT": 9,
|
||||
"WIT": 9, # codespell:ignore wit
|
||||
"WITA": 8,
|
||||
"WST": 8,
|
||||
"YAKT": 9,
|
||||
|
||||
@@ -31,6 +31,7 @@ dev = [
|
||||
"types-PyYAML>=6.0.12.20250915",
|
||||
"ruff>=0.15.1",
|
||||
"pip-audit>=2.10.0",
|
||||
"codespell>=2.4.1",
|
||||
]
|
||||
|
||||
[tool.uv]
|
||||
@@ -122,6 +123,9 @@ ignore = [
|
||||
"owlbot/__main__.py" = ["T201"] # CLI entry point uses print() for user output
|
||||
"tests/**" = ["S101", "S311"] # assert is standard for pytest; random is fine in tests
|
||||
|
||||
[tool.codespell]
|
||||
skip = "owlbot/_version.py,uv.lock"
|
||||
|
||||
[tool.coverage.run]
|
||||
source = ["owlbot"]
|
||||
omit = [
|
||||
|
||||
@@ -618,7 +618,7 @@ class TestCountdownCountup:
|
||||
async def test_invalid_date(
|
||||
self, placeholder_storage: ModuleStorage, placeholder: str, bad_date: str
|
||||
) -> None:
|
||||
"""Placeholders with an unparseable date report an error."""
|
||||
"""Placeholders with an unparsable date report an error."""
|
||||
result = await process(f"$({placeholder} {bad_date})", placeholder_storage)
|
||||
assert result == (
|
||||
f"Invalid $({placeholder}): unrecognized date format, "
|
||||
@@ -628,14 +628,15 @@ class TestCountdownCountup:
|
||||
async def test_fractional_timezone_offset(
|
||||
self, placeholder_storage: ModuleStorage
|
||||
) -> None:
|
||||
"""A fractional timezone offset like IST (UTC+5:30) is applied correctly."""
|
||||
"""Fractional offset like IST (+5:30) is applied.""" # codespell:ignore ist
|
||||
with freeze_time("2026-06-15 12:00:00", tz_offset=0):
|
||||
now = datetime.now(UTC)
|
||||
# Jan 1 2020 12:00:00 AM IST = Dec 31 2019 18:30:00 UTC
|
||||
# IST = Dec 31 2019 18:30:00 UTC # codespell:ignore ist
|
||||
target = datetime(2019, 12, 31, 18, 30, 0, tzinfo=UTC)
|
||||
expected = _format_duration(int((now - target).total_seconds()))
|
||||
result = await process(
|
||||
"$(countup Jan 1 2020 12:00:00 AM IST)", placeholder_storage
|
||||
"$(countup Jan 1 2020 12:00:00 AM IST)", # codespell:ignore ist
|
||||
placeholder_storage,
|
||||
)
|
||||
assert result == expected
|
||||
|
||||
|
||||
@@ -220,6 +220,15 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/0a/4c/925909008ed5a988ccbb72dcc897407e5d6d3bd72410d69e051fc0c14647/charset_normalizer-3.4.4-py3-none-any.whl", hash = "sha256:7a32c560861a02ff789ad905a2fe94e3f840803362c84fecf1851cb4cf3dc37f", size = 53402, upload-time = "2025-10-14T04:42:31.76Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "codespell"
|
||||
version = "2.4.1"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/15/e0/709453393c0ea77d007d907dd436b3ee262e28b30995ea1aa36c6ffbccaf/codespell-2.4.1.tar.gz", hash = "sha256:299fcdcb09d23e81e35a671bbe746d5ad7e8385972e65dbb833a2eaac33c01e5", size = 344740, upload-time = "2025-01-28T18:52:39.411Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/20/01/b394922252051e97aab231d416c86da3d8a6d781eeadcdca1082867de64e/codespell-2.4.1-py3-none-any.whl", hash = "sha256:3dadafa67df7e4a3dbf51e0d7315061b80d265f9552ebd699b3dd6834b47e425", size = 344501, upload-time = "2025-01-28T18:52:37.057Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "colorama"
|
||||
version = "0.4.6"
|
||||
@@ -840,6 +849,7 @@ dependencies = [
|
||||
|
||||
[package.dev-dependencies]
|
||||
dev = [
|
||||
{ name = "codespell" },
|
||||
{ name = "freezegun" },
|
||||
{ name = "mypy" },
|
||||
{ name = "pip-audit" },
|
||||
@@ -861,6 +871,7 @@ requires-dist = [
|
||||
|
||||
[package.metadata.requires-dev]
|
||||
dev = [
|
||||
{ name = "codespell", specifier = ">=2.4.1" },
|
||||
{ name = "freezegun", specifier = ">=1.5.5" },
|
||||
{ name = "mypy", specifier = ">=1.18.1" },
|
||||
{ name = "pip-audit", specifier = ">=2.10.0" },
|
||||
|
||||
Reference in New Issue
Block a user