Skip to content

Commit

Permalink
Merge remote-tracking branch 'github/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
vanessa-rodrigues authored and amaanq committed Dec 22, 2024
2 parents a42411d + 1124c18 commit 56a32b4
Show file tree
Hide file tree
Showing 49 changed files with 1,135 additions and 1,127 deletions.
16 changes: 12 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ root = true

[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

[*.{json,toml,yml,gyp}]
indent_style = space
Expand All @@ -13,14 +11,18 @@ indent_size = 2
indent_style = space
indent_size = 2

[*.rs]
[*.scm]
indent_style = space
indent_size = 4
indent_size = 2

[*.{c,cc,h}]
indent_style = space
indent_size = 4

[*.rs]
indent_style = space
indent_size = 4

[*.{py,pyi}]
indent_style = space
indent_size = 4
Expand All @@ -36,3 +38,9 @@ indent_size = 8
[Makefile]
indent_style = tab
indent_size = 8

[parser.c]
indent_size = 2

[{alloc,array,parser}.h]
indent_size = 2
20 changes: 0 additions & 20 deletions .eslintrc.js

This file was deleted.

34 changes: 28 additions & 6 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
* text=auto eol=lf

examples/crlf-line-endings.py eol=crlf
examples/python2-grammar-crlf.py eol=crlf
examples/python3-grammar-crlf.py eol=crlf

# Generated source files
src/*.json linguist-generated
src/parser.c linguist-generated
src/tree_sitter/* linguist-generated

bindings/** linguist-generated
# C bindings
bindings/c/* linguist-generated
CMakeLists.txt linguist-generated
Makefile linguist-generated

# Rust bindings
bindings/rust/* linguist-generated
Cargo.toml linguist-generated
Cargo.lock linguist-generated

# Node.js bindings
bindings/node/* linguist-generated
binding.gyp linguist-generated
package.json linguist-generated
package-lock.json linguist-generated

# Python bindings
bindings/python/** linguist-generated
setup.py linguist-generated
Makefile linguist-generated
pyproject.toml linguist-generated

# Go bindings
bindings/go/* linguist-generated
go.mod linguist-generated
go.sum linguist-generated

# Swift bindings
bindings/swift/** linguist-generated
Package.swift linguist-generated
Package.resolved linguist-generated
31 changes: 10 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
push:
branches: ["*"]
branches: [master]
paths:
- grammar.js
- src/**
Expand Down Expand Up @@ -43,32 +43,21 @@ jobs:
- name: Run tests
uses: tree-sitter/parser-test-action@v2
with:
test-rust: ${{runner.os == 'Linux'}}
test-rust: true
test-node: true
test-python: true
test-go: true
test-swift: true
- name: Parse examples
uses: tree-sitter/parse-action@v4
with:
files: |
examples/**/*.py
!examples/cpython/Lib/test/test_annotationlib.py
!examples/cpython/Lib/test/test_type_params.py
!examples/cpython/Lib/test/test_compile.py
!examples/cpython/Tools/build/generate_re_casefix.py
!examples/cpython/Lib/test/test_annotationlib.py
!examples/cpython/Lib/test/test_type_params.py
invalid-files: |
examples/cpython/Lib/test/tokenizedata/badsyntax_3131.py
fuzz:
name: Fuzz parser
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Check for scanner changes
id: scanner-changes
run: |-
if git diff --quiet HEAD^ -- src/scanner.c; then
printf 'changed=false\n' >> "$GITHUB_OUTPUT"
else
printf 'changed=true\n' >> "$GITHUB_OUTPUT"
fi
- name: Fuzz parser
uses: tree-sitter/fuzz-action@v4
if: steps.scanner-changes.outputs.changed == 'true'
19 changes: 19 additions & 0 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Fuzz Parser

on:
push:
branches: [master]
paths:
- src/scanner.c
pull_request:
paths:
- src/scanner.c

jobs:
fuzz:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run fuzzer
uses: tree-sitter/fuzz-action@v4
26 changes: 26 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint

on:
push:
branches: [master]
paths:
- grammar.js
pull_request:
paths:
- grammar.js

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
cache: npm
node-version: ${{vars.NODE_VERSION}}
- name: Install modules
run: npm ci --legacy-peer-deps
- name: Run ESLint
run: npm run lint
20 changes: 16 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
name: Publish package
name: Publish packages

on:
push:
tags: ["*"]

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
permissions:
contents: write
id-token: write
attestations: write

jobs:
github:
uses: tree-sitter/workflows/.github/workflows/release.yml@main
with:
generate: true
attestations: true
npm:
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
secrets:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
with:
generate: true
crates:
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
secrets:
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}}
with:
generate: true
pypi:
uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main
secrets:
PYPI_API_TOKEN: ${{secrets.PYPI_API_TOKEN}}
with:
generate: true
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
# Rust artifacts
Cargo.lock
target/

# Node artifacts
build/
prebuilds/
node_modules/
*.tgz

# Swift artifacts
.build/

# Go artifacts
go.sum
_obj/

# Python artifacts
Expand All @@ -36,3 +33,8 @@ dist/
*.wasm
*.obj
*.o

# Archives
*.tar.gz
*.tgz
*.zip
17 changes: 0 additions & 17 deletions .npmignore

This file was deleted.

60 changes: 60 additions & 0 deletions CMakeLists.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 56a32b4

Please sign in to comment.