From 796df583d192390b70522d13261eaae3ebe010e9 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 14 Feb 2024 16:35:23 -0500 Subject: [PATCH 1/4] Add github action to codespell master on push and PRs --- .github/workflows/codespell.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 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 00000000..22650fda --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,23 @@ +# Codespell configuration is within pyproject.toml +--- +name: Codespell + +on: + push: + branches: [master] + pull_request: + branches: [master] + +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 From 58b434c602a0f06814e51485023265d43c172d5a Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 14 Feb 2024 16:35:23 -0500 Subject: [PATCH 2/4] codespell: move configuration to pyproject, boost its version in pre-commit Centralization of configuration would let use codespell just as is without pre-commit. Also it seems that new typos were found -- adding one more skip --- .pre-commit-config.yaml | 6 ++++-- pyproject.toml | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4dfc25f5..e3725f31 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,9 @@ repos: exclude: '(^tests/.*\.lark|\.svg)$' - repo: https://github.com/codespell-project/codespell - rev: v2.2.2 + # Configuration for codespell is in pyproject.toml + rev: v2.2.6 hooks: - id: codespell - args: ["-L", "nd,iif,ot,datas"] + additional_dependencies: + - tomli diff --git a/pyproject.toml b/pyproject.toml index 8e40e13d..4d3a5bc3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,3 +95,9 @@ exclude_lines = [ ] [tool.pyright] include = ["lark"] + +[tool.codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = '.git,*.pdf,*.svg' +check-hidden = true +ignore-words-list = 'nd,iif,ot,datas,foor' From 3bc6da1909372145f087a00da08509d86bf946eb Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 14 Feb 2024 16:42:35 -0500 Subject: [PATCH 3/4] [DATALAD RUNCMD] run codespell throughout fixing typo automagically === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- docs/_static/sppf/sppf.html | 2 +- examples/composition/main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_static/sppf/sppf.html b/docs/_static/sppf/sppf.html index c2fd532a..7278d419 100644 --- a/docs/_static/sppf/sppf.html +++ b/docs/_static/sppf/sppf.html @@ -161,7 +161,7 @@

Structural Properties

Packed nodes $(t,k)$ have one or two children. The right child is a symbol node $(x,k,i)$ and the left child (if it exists) is a symbol or intermediate node with label $(s,j,k)$, where $j \leq k \leq i$. Packed nodes have always exactly one parent which is a symbol node or intermediate node.

-

It is useful to observe that the SPPF is a bipartite graph, with on the one hand the set of intermediate and symbol nodes and on the other hand the set of packed nodes. Therefore edges always go from a node of the first type to a node of the second type, or the other way round. As a consequence, cyles in the SPPF are always of even length.

+

It is useful to observe that the SPPF is a bipartite graph, with on the one hand the set of intermediate and symbol nodes and on the other hand the set of packed nodes. Therefore edges always go from a node of the first type to a node of the second type, or the other way round. As a consequence, cycles in the SPPF are always of even length.

Transformation to an abstract syntax tree

diff --git a/examples/composition/main.py b/examples/composition/main.py index 4c803f5a..1cf42668 100644 --- a/examples/composition/main.py +++ b/examples/composition/main.py @@ -15,7 +15,7 @@ The resulting transformer can evaluate both JSON and CSV in the parse tree. The methods of each transformer are renamed into their appropriate namespace, using the given prefix. - This approach allows full re-use: the transformers don't need to care if their grammar is used directly, + This approach allows full reuse: the transformers don't need to care if their grammar is used directly, or being imported, or who is doing the importing. """ From e24cef6d6b2483634510cd7ca59923afbf6bce89 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 14 Feb 2024 16:44:04 -0500 Subject: [PATCH 4/4] TMP: add a typo and see if CI pre-commit picks it up --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8b865966..433e44ed 100644 --- a/README.md +++ b/README.md @@ -194,3 +194,4 @@ Questions about code are best asked on [gitter](https://gitter.im/lark-parser/Lo For anything else, I can be reached by email at erezshin at gmail com. -- [Erez](https://github.com/erezsh) +Installating pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy