diff --git a/.github/ISSUE_TEMPLATE/other.md b/.github/ISSUE_TEMPLATE/other.md index 1c8fcda2..a8f765fc 100644 --- a/.github/ISSUE_TEMPLATE/other.md +++ b/.github/ISSUE_TEMPLATE/other.md @@ -6,5 +6,3 @@ labels: '' assignees: '' --- - - diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 21450d6f..9624cd9c 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -1,7 +1,7 @@ name: Python type check on: [push, pull_request] jobs: - build: + type: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -9,3 +9,11 @@ jobs: submodules: recursive - name: Lint with mypy run: pipx run tox -e type + + pre-commit: + name: Format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v2.0.3 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f15e487f..5d06f090 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,14 +6,14 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11-dev", "pypy-3.7"] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.7"] steps: - uses: actions/checkout@v3 with: submodules: recursive - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/.gitignore b/.gitignore index b30399ed..26275e4b 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ tags /dist /build docs/_build -docs/examples \ No newline at end of file +docs/examples diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..2852d8ed --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,32 @@ +# To use: +# +# pre-commit run -a +# +# Or: +# +# pre-commit install # (runs every time you commit in git) +# +# To update this file: +# +# pre-commit autoupdate +# +# See https://github.com/pre-commit/pre-commit + +repos: +# Standard hooks +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: "v4.2.0" + hooks: + - id: check-added-large-files + - id: check-case-conflict + - id: check-merge-conflict + - id: check-symlinks + - id: check-toml + - id: check-yaml + - id: debug-statements + - id: end-of-file-fixer + exclude: '(^tests/.*\.lark|\.svg)$' + - id: mixed-line-ending + - id: requirements-txt-fixer + - id: trailing-whitespace + exclude: '(^tests/.*\.lark|\.svg)$' diff --git a/CHANGELOG.md b/CHANGELOG.md index 22f4b8c1..7e94cf99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,4 +10,4 @@ v1.0 - `use_accepts` in `UnexpectedInput.match_examples()` is now True by default -- `v_args(meta=True)` now gives meta as the first argument. i.e. `(meta, children)` \ No newline at end of file +- `v_args(meta=True)` now gives meta as the first argument. i.e. `(meta, children)` diff --git a/LICENSE b/LICENSE index efcb9665..aaf210b1 100644 --- a/LICENSE +++ b/LICENSE @@ -16,4 +16,3 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/README.md b/README.md index 23184f7a..4468243b 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ Lark is great at handling ambiguity. Here is the result of parsing the phrase "f - Grammar composition - Import terminals and rules from other grammars - Standard library of terminals (strings, numbers, names, etc.) - Import grammars from Nearley.js ([read more](/docs/tools.md#importing-grammars-from-nearleyjs)) - - Extensive test suite [](https://codecov.io/gh/lark-parser/lark) + - Extensive test suite [](https://codecov.io/gh/lark-parser/lark) - Type annotations (MyPy support) - And much more! @@ -193,4 +193,3 @@ 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) - diff --git a/docs/Makefile b/docs/Makefile index 58127b42..ff51a731 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -17,4 +17,4 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/_static/sppf/sppf.html b/docs/_static/sppf/sppf.html index c9c3d218..c2fd532a 100644 --- a/docs/_static/sppf/sppf.html +++ b/docs/_static/sppf/sppf.html @@ -209,4 +209,4 @@