From 2a6c2510269792d26160056cb6ec24e534330ee2 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 26 Apr 2023 11:15:51 -0400 Subject: [PATCH 1/4] Add github action to codespell main on push and PRs --- .github/workflows/codespell.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..243ba8c --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,19 @@ +--- +name: Codespell + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Codespell + uses: codespell-project/actions-codespell@v1 From d2ba69a4b80c7493219975c75929a5efb36079c5 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 26 Apr 2023 11:15:51 -0400 Subject: [PATCH 2/4] Add rudimentary codespell config --- .codespellrc | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..9ec0d7c --- /dev/null +++ b/.codespellrc @@ -0,0 +1,4 @@ +[codespell] +skip = .git,*.pdf,*.svg +# +# ignore-words-list = From 9c6ba892ec128294ad0600c83911373e39ac0f89 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 26 Apr 2023 11:16:16 -0400 Subject: [PATCH 3/4] ignore falsy which is Pythony jargon --- .codespellrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.codespellrc b/.codespellrc index 9ec0d7c..82766e8 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,4 +1,3 @@ [codespell] skip = .git,*.pdf,*.svg -# -# ignore-words-list = +ignore-words-list = falsy From 2cbe9b843365627af0964d8d2445f7cc4222bc26 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 26 Apr 2023 11:16:20 -0400 Subject: [PATCH 4/4] [DATALAD RUNCMD] run codespell throughout === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- README.md | 2 +- chevron/renderer.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8c9de75..d63492d 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ chevron supports lambdas import chevron def first(text, render): - # return only first occurance of items + # return only first occurrence of items result = render(text) return [ x.strip() for x in result.split(" || ") if x.strip() ][0] diff --git a/chevron/renderer.py b/chevron/renderer.py index 65a00f6..7c8db35 100644 --- a/chevron/renderer.py +++ b/chevron/renderer.py @@ -59,7 +59,7 @@ def _get_key(key, scopes, warn, keep, def_ldel, def_rdel): # Loop through the scopes for scope in scopes: try: - # For every dot seperated key + # For every dot separated key for child in key.split('.'): # Move into the scope try: @@ -185,7 +185,7 @@ def render(template='', data={}, partials_path='.', partials_ext='mustache', A string containing the rendered template. """ - # If the template is a seqeuence but not derived from a string + # If the template is a sequence but not derived from a string if isinstance(template, Sequence) and \ not isinstance(template, string_type): # Then we don't need to tokenize it @@ -371,7 +371,7 @@ def render(template='', data={}, partials_path='.', partials_ext='mustache', # then remove the spaces from the end part_out = part_out.rstrip(' \t') - # Add the partials output to the ouput + # Add the partials output to the output if python3: output += part_out else: # python 2