diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..b2316674 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,25 @@ +# Codespell configuration is within pyproject.toml +--- +name: Codespell + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Annotate locations with typos + uses: codespell-project/codespell-problem-matcher@v1 + - name: Codespell + uses: codespell-project/actions-codespell@v2 diff --git a/pyproject.toml b/pyproject.toml index 3779012f..381ef9b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,13 +85,20 @@ exclude_lines = [ "if TYPE_CHECKING:", ] +[tool.codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = '.git*' +check-hidden = true +# ignore-regex = '' +# ignore-words-list = '' + [tool.ruff] line-length = 88 indent-width = 4 [tool.ruff.lint] ignore = [ # Avoid use of `from __future__ import annotations` - # becaues it causes problem with Typer + # because it causes problem with Typer "FA100" ] [tool.ruff.lint.per-file-ignores] @@ -103,7 +110,6 @@ ignore = [ "PLR6301", "S", "TID252", - # Allow access to protected members in tests "SLF001", -] \ No newline at end of file +] diff --git a/src/pydantic2linkml/gen_linkml.py b/src/pydantic2linkml/gen_linkml.py index be392611..16b5d255 100644 --- a/src/pydantic2linkml/gen_linkml.py +++ b/src/pydantic2linkml/gen_linkml.py @@ -118,7 +118,7 @@ def to_sorted_lst( self._sb = SchemaBuilder(name, id_) # This changes to True after this generator generates a schema - # (for preventing issues caused by accidental re-use + # (for preventing issues caused by accidental reuse # of this generator). See class docstring for more info. self._used = False @@ -326,7 +326,7 @@ def attach_note(note: str) -> None: overridden_field_slot_rep, overriding_field_slot_rep ) except SlotExtensionError as e: - # Attache needed note + # Attach needed note missing_substr = ( f"lacks meta slots: {e.missing_meta_slots} " if e.missing_meta_slots @@ -387,7 +387,7 @@ def __init__(self, field_schema: FieldSchema): self._schema_type_to_method = self._build_schema_type_to_method() # This changes to True after this generator generates a slot schema - # (for preventing issues caused by accidental re-use + # (for preventing issues caused by accidental reuse # of this generator). See class docstring for more info. self._used: bool = False