Skip to content

Commit

Permalink
Add codespell config and workflow and fix a few typos (#129)
Browse files Browse the repository at this point in the history
* Add github action to codespell main on push and PRs

* Add rudimentary codespell config

* ignore all resources and sie variable and OGER name

* [DATALAD RUNCMD] run codespell throughout but ignore fail

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w || :",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^

* [DATALAD RUNCMD] Do interactive fixing of typos

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w -i 3 -C 2",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
  • Loading branch information
yarikoptic authored Feb 26, 2024
1 parent 6186a49 commit 8428e9c
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 6 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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: Codespell
uses: codespell-project/actions-codespell@v2
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ that you can use as a starting point.

## How to Request an Enhancement

We welcome request for enhancements and you can make these requestes via the issue tracker. Please be sure to provide
We welcome request for enhancements and you can make these requests via the issue tracker. Please be sure to provide
sufficient context to what the enhancement is trying to address, its utility, and how it's likely to be useful to you
and the broader community.

Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,10 @@ extract-schema = "schema_automator.utils.schema_extractor:cli"
[tool.poetry.extras]
docs = ["Sphinx", "sphinx-pdj-theme", "sphinxcontrib-mermaid"]
mariadb = ["mariadb"]

[tool.codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = '.git,*.lock,resources'
check-hidden = true
ignore-regex = '\bOGER\b'
ignore-words-list = 'sie'
2 changes: 1 addition & 1 deletion schema_automator/annotators/enum_annotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def get_ols_term_annotations(iri_param, ontology_param, session_param, ols_terms
default=2, show_default=True)
@click.option('--max_cosine',
help="""how much of a cosine distance will you tolerate
when comparing an enum name to a term lable or synonym?""",
when comparing an enum name to a term label or synonym?""",
default=0.05, show_default=True)
@click.option('--query_field_string',
help="""do you want to define a custom list of fields to search in?
Expand Down
2 changes: 1 addition & 1 deletion schema_automator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def import_owl(owlfile, output, **args):
@click.option('--identifier', '-I', help="Slot to use as identifier")
@click.option('--model-uri', help="Model URI prefix")
@click.option('--metamodel-mappings',
help="Path to metamodel mappings YAML dicitonary")
help="Path to metamodel mappings YAML dictionary")
@click.option('--output', '-o', help="Path to saved yaml schema")
def import_rdfs(rdfsfile, output, metamodel_mappings, **args):
"""
Expand Down
2 changes: 1 addition & 1 deletion schema_automator/generalizers/csv_data_generalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class CsvDataGeneralizer(Generalizer):
"""If number if distinct values divided by total number of values is greater than this, then the column is considered an enum"""

enum_strlen_threshold: int = 30
"""Maximimum length of a string to be considered a permissible enum value"""
"""Maximum length of a string to be considered a permissible enum value"""

max_enum_size: int = 50
"""Max number of permissible values for a column to be considered an enum"""
Expand Down
4 changes: 2 additions & 2 deletions schema_automator/metamodels/dosdp/dosdp_linkml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ classes:
inlined: true
range: VarDeclaration
list_vars:
description: A dictionary of variables refering to lists of owl classes. Key
description: A dictionary of variables referring to lists of owl classes. Key
= variable name, value = variable range of items in list specified as a
valid OWL data-type.
data_vars:
Expand Down Expand Up @@ -522,7 +522,7 @@ slots:
description: 'A dictionary of OWL annotation properties key : label; value : short
form id'
list_vars:
description: A dictionary of variables refering to lists of owl classes. Key =
description: A dictionary of variables referring to lists of owl classes. Key =
variable name, value = variable range of items in list specified as a valid
OWL data-type.
data_vars:
Expand Down

0 comments on commit 8428e9c

Please sign in to comment.