From b33485d28a8a6c284489c0a7e011d503c4bf4f0d Mon Sep 17 00:00:00 2001 From: Tom Bland Date: Thu, 24 Oct 2024 16:11:50 +0100 Subject: [PATCH] Apply codespell, ignoring "heterogenous" --- .codespell_ignore.txt | 2 ++ .pre-commit-config.yaml | 5 +++++ CODE_OF_CONDUCT.md | 2 +- docs/config_tutorial.md | 2 +- src/IAO_dicts/IAO_FINAL_MAPPING.txt | 2 +- src/abbreviation.py | 2 +- src/utils.py | 2 +- 7 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 .codespell_ignore.txt diff --git a/.codespell_ignore.txt b/.codespell_ignore.txt new file mode 100644 index 0000000..25c406e --- /dev/null +++ b/.codespell_ignore.txt @@ -0,0 +1,2 @@ +tabl +heterogenous diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 197e420..503f1f5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,3 +28,8 @@ repos: hooks: - id: markdownlint-fix args: [--disable, MD013, MD033, MD036, MD041, MD040, --] + - repo: https://github.com/codespell-project/codespell + rev: v2.3.0 + hooks: + - id: codespell + args: [-I, .codespell_ignore.txt] diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index d8c9452..12f8570 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -5,7 +5,7 @@ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, +identity and expression, level of experience, education, socioeconomic status, nationality, personal appearance, race, religion, or sexual identity and orientation. diff --git a/docs/config_tutorial.md b/docs/config_tutorial.md index bde6ed8..b4ddea1 100644 --- a/docs/config_tutorial.md +++ b/docs/config_tutorial.md @@ -105,7 +105,7 @@ the HTML is generated from each source without having to define exact matches fo The second example identifies all `header` elements ranging from `

` to `

`. Auto-CORPus will process all matching headers at the same time. -Within the first example, notice the use of "\\\d" instead of the usual "\d" for identifying any digit. This is due to the regex pattern being defined within the config which is a JSON file. For further informaion about escapaing special characters within JSON have a look at [this guide by tutorials point](https://www.tutorialspoint.com/json_simple/json_simple_escape_characters.htm). +Within the first example, notice the use of "\\\d" instead of the usual "\d" for identifying any digit. This is due to the regex pattern being defined within the config which is a JSON file. For further information about escapaing special characters within JSON have a look at [this guide by tutorials point](https://www.tutorialspoint.com/json_simple/json_simple_escape_characters.htm).

Submitting/editing config files

diff --git a/src/IAO_dicts/IAO_FINAL_MAPPING.txt b/src/IAO_dicts/IAO_FINAL_MAPPING.txt index 60bb458..101174f 100644 --- a/src/IAO_dicts/IAO_FINAL_MAPPING.txt +++ b/src/IAO_dicts/IAO_FINAL_MAPPING.txt @@ -114,7 +114,7 @@ experimental design methods section / materials section experimental methods methods section experimental procedures methods section experimental section methods section -extented data supplementary material section +extended data supplementary material section figures and tables supplementary material section financial support funding source declaration section footnotes footnote section diff --git a/src/abbreviation.py b/src/abbreviation.py index 445b009..bc33453 100644 --- a/src/abbreviation.py +++ b/src/abbreviation.py @@ -34,7 +34,7 @@ def __conditions(self, candidate): viable = False if len(candidate.split()) > 2: viable = False - if candidate.islower(): # customize funcition discard all lower case candidate + if candidate.islower(): # customize function discard all lower case candidate viable = False if not re2.search(r"\p{L}", candidate): # \p{L} = All Unicode letter viable = False diff --git a/src/utils.py b/src/utils.py index 7174cb7..b0107fb 100644 --- a/src/utils.py +++ b/src/utils.py @@ -195,7 +195,7 @@ def handle_defined_by(config, soup): if new_matches: new_matches = [x for x in new_matches if x.text] if "xpath" in bsAttrs: - if type(bsAttrs["xpath"]) is list: + if isinstance(bsAttrs["xpath"], list): for path in bsAttrs["xpath"]: xpath_matches = fromstring(str(soup)).xpath(path) if xpath_matches: