Skip to content

Commit 7b9dbde

Browse files
authored
Merge pull request #8 from candleindark/codespell
Add GitHub Action workflow for running codespell
2 parents d25591a + 273e76f commit 7b9dbde

File tree

3 files changed

+37
-6
lines changed

3 files changed

+37
-6
lines changed

.github/workflows/codespell.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Codespell configuration is within pyproject.toml
2+
---
3+
name: Codespell
4+
5+
on:
6+
push:
7+
branches: [main]
8+
pull_request:
9+
branches: [main]
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
codespell:
16+
name: Check for spelling errors
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
- name: Annotate locations with typos
23+
uses: codespell-project/codespell-problem-matcher@v1
24+
- name: Codespell
25+
uses: codespell-project/actions-codespell@v2

pyproject.toml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,20 @@ exclude_lines = [
8585
"if TYPE_CHECKING:",
8686
]
8787

88+
[tool.codespell]
89+
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
90+
skip = '.git*'
91+
check-hidden = true
92+
# ignore-regex = ''
93+
# ignore-words-list = ''
94+
8895
[tool.ruff]
8996
line-length = 88
9097
indent-width = 4
9198
[tool.ruff.lint]
9299
ignore = [
93100
# Avoid use of `from __future__ import annotations`
94-
# becaues it causes problem with Typer
101+
# because it causes problem with Typer
95102
"FA100"
96103
]
97104
[tool.ruff.lint.per-file-ignores]
@@ -103,7 +110,6 @@ ignore = [
103110
"PLR6301",
104111
"S",
105112
"TID252",
106-
107113
# Allow access to protected members in tests
108114
"SLF001",
109-
]
115+
]

src/pydantic2linkml/gen_linkml.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def to_sorted_lst(
118118
self._sb = SchemaBuilder(name, id_)
119119

120120
# This changes to True after this generator generates a schema
121-
# (for preventing issues caused by accidental re-use
121+
# (for preventing issues caused by accidental reuse
122122
# of this generator). See class docstring for more info.
123123
self._used = False
124124

@@ -326,7 +326,7 @@ def attach_note(note: str) -> None:
326326
overridden_field_slot_rep, overriding_field_slot_rep
327327
)
328328
except SlotExtensionError as e:
329-
# Attache needed note
329+
# Attach needed note
330330
missing_substr = (
331331
f"lacks meta slots: {e.missing_meta_slots} "
332332
if e.missing_meta_slots
@@ -387,7 +387,7 @@ def __init__(self, field_schema: FieldSchema):
387387
self._schema_type_to_method = self._build_schema_type_to_method()
388388

389389
# This changes to True after this generator generates a slot schema
390-
# (for preventing issues caused by accidental re-use
390+
# (for preventing issues caused by accidental reuse
391391
# of this generator). See class docstring for more info.
392392
self._used: bool = False
393393

0 commit comments

Comments
 (0)