Skip to content

Commit

Permalink
Merge pull request #8 from candleindark/codespell
Browse files Browse the repository at this point in the history
Add GitHub Action workflow for running codespell
  • Loading branch information
candleindark authored Nov 11, 2024
2 parents d25591a + 273e76f commit 7b9dbde
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 9 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -103,7 +110,6 @@ ignore = [
"PLR6301",
"S",
"TID252",

# Allow access to protected members in tests
"SLF001",
]
]
6 changes: 3 additions & 3 deletions src/pydantic2linkml/gen_linkml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 7b9dbde

Please sign in to comment.