Skip to content

Commit 56a32b4

Browse files
vanessa-rodriguesamaanq
authored andcommitted
Merge remote-tracking branch 'github/master'
2 parents a42411d + 1124c18 commit 56a32b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1135
-1127
lines changed

.editorconfig

+12-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ root = true
22

33
[*]
44
charset = utf-8
5-
insert_final_newline = true
6-
trim_trailing_whitespace = true
75

86
[*.{json,toml,yml,gyp}]
97
indent_style = space
@@ -13,14 +11,18 @@ indent_size = 2
1311
indent_style = space
1412
indent_size = 2
1513

16-
[*.rs]
14+
[*.scm]
1715
indent_style = space
18-
indent_size = 4
16+
indent_size = 2
1917

2018
[*.{c,cc,h}]
2119
indent_style = space
2220
indent_size = 4
2321

22+
[*.rs]
23+
indent_style = space
24+
indent_size = 4
25+
2426
[*.{py,pyi}]
2527
indent_style = space
2628
indent_size = 4
@@ -36,3 +38,9 @@ indent_size = 8
3638
[Makefile]
3739
indent_style = tab
3840
indent_size = 8
41+
42+
[parser.c]
43+
indent_size = 2
44+
45+
[{alloc,array,parser}.h]
46+
indent_size = 2

.eslintrc.js

-20
This file was deleted.

.gitattributes

+28-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,37 @@
11
* text=auto eol=lf
22

3-
examples/crlf-line-endings.py eol=crlf
4-
examples/python2-grammar-crlf.py eol=crlf
5-
examples/python3-grammar-crlf.py eol=crlf
6-
3+
# Generated source files
74
src/*.json linguist-generated
85
src/parser.c linguist-generated
96
src/tree_sitter/* linguist-generated
107

11-
bindings/** linguist-generated
8+
# C bindings
9+
bindings/c/* linguist-generated
10+
CMakeLists.txt linguist-generated
11+
Makefile linguist-generated
12+
13+
# Rust bindings
14+
bindings/rust/* linguist-generated
15+
Cargo.toml linguist-generated
16+
Cargo.lock linguist-generated
17+
18+
# Node.js bindings
19+
bindings/node/* linguist-generated
1220
binding.gyp linguist-generated
21+
package.json linguist-generated
22+
package-lock.json linguist-generated
23+
24+
# Python bindings
25+
bindings/python/** linguist-generated
1326
setup.py linguist-generated
14-
Makefile linguist-generated
27+
pyproject.toml linguist-generated
28+
29+
# Go bindings
30+
bindings/go/* linguist-generated
31+
go.mod linguist-generated
32+
go.sum linguist-generated
33+
34+
# Swift bindings
35+
bindings/swift/** linguist-generated
1536
Package.swift linguist-generated
37+
Package.resolved linguist-generated

.github/workflows/ci.yml

+10-21
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

33
on:
44
push:
5-
branches: ["*"]
5+
branches: [master]
66
paths:
77
- grammar.js
88
- src/**
@@ -43,32 +43,21 @@ jobs:
4343
- name: Run tests
4444
uses: tree-sitter/parser-test-action@v2
4545
with:
46-
test-rust: ${{runner.os == 'Linux'}}
46+
test-rust: true
47+
test-node: true
48+
test-python: true
49+
test-go: true
50+
test-swift: true
4751
- name: Parse examples
4852
uses: tree-sitter/parse-action@v4
4953
with:
5054
files: |
5155
examples/**/*.py
56+
!examples/cpython/Lib/test/test_annotationlib.py
57+
!examples/cpython/Lib/test/test_type_params.py
5258
!examples/cpython/Lib/test/test_compile.py
5359
!examples/cpython/Tools/build/generate_re_casefix.py
60+
!examples/cpython/Lib/test/test_annotationlib.py
61+
!examples/cpython/Lib/test/test_type_params.py
5462
invalid-files: |
5563
examples/cpython/Lib/test/tokenizedata/badsyntax_3131.py
56-
fuzz:
57-
name: Fuzz parser
58-
runs-on: ubuntu-latest
59-
steps:
60-
- name: Checkout repository
61-
uses: actions/checkout@v4
62-
with:
63-
fetch-depth: 2
64-
- name: Check for scanner changes
65-
id: scanner-changes
66-
run: |-
67-
if git diff --quiet HEAD^ -- src/scanner.c; then
68-
printf 'changed=false\n' >> "$GITHUB_OUTPUT"
69-
else
70-
printf 'changed=true\n' >> "$GITHUB_OUTPUT"
71-
fi
72-
- name: Fuzz parser
73-
uses: tree-sitter/fuzz-action@v4
74-
if: steps.scanner-changes.outputs.changed == 'true'

.github/workflows/fuzz.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Fuzz Parser
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- src/scanner.c
8+
pull_request:
9+
paths:
10+
- src/scanner.c
11+
12+
jobs:
13+
fuzz:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Run fuzzer
19+
uses: tree-sitter/fuzz-action@v4

.github/workflows/lint.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- grammar.js
8+
pull_request:
9+
paths:
10+
- grammar.js
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
cache: npm
22+
node-version: ${{vars.NODE_VERSION}}
23+
- name: Install modules
24+
run: npm ci --legacy-peer-deps
25+
- name: Run ESLint
26+
run: npm run lint

.github/workflows/publish.yml

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
1-
name: Publish package
1+
name: Publish packages
22

33
on:
44
push:
55
tags: ["*"]
66

7-
concurrency:
8-
group: ${{github.workflow}}-${{github.ref}}
9-
cancel-in-progress: true
7+
permissions:
8+
contents: write
9+
id-token: write
10+
attestations: write
1011

1112
jobs:
13+
github:
14+
uses: tree-sitter/workflows/.github/workflows/release.yml@main
15+
with:
16+
generate: true
17+
attestations: true
1218
npm:
1319
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
1420
secrets:
1521
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
22+
with:
23+
generate: true
1624
crates:
1725
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
1826
secrets:
1927
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}}
28+
with:
29+
generate: true
2030
pypi:
2131
uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main
2232
secrets:
2333
PYPI_API_TOKEN: ${{secrets.PYPI_API_TOKEN}}
34+
with:
35+
generate: true

.gitignore

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
# Rust artifacts
2-
Cargo.lock
32
target/
43

54
# Node artifacts
65
build/
76
prebuilds/
87
node_modules/
9-
*.tgz
108

119
# Swift artifacts
1210
.build/
1311

1412
# Go artifacts
15-
go.sum
1613
_obj/
1714

1815
# Python artifacts
@@ -36,3 +33,8 @@ dist/
3633
*.wasm
3734
*.obj
3835
*.o
36+
37+
# Archives
38+
*.tar.gz
39+
*.tgz
40+
*.zip

.npmignore

-17
This file was deleted.

CMakeLists.txt

+60
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)