Skip to content

Commit 821994a

Browse files
authored
chore: upgrade tree-sitter (#69)
* chore: upgrade tree-sitter * chore: update ci workflow * chore: move test into test folder
1 parent edd817e commit 821994a

32 files changed

+1220
-82
lines changed

.editorconfig

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
9+
[*.{json,toml,yml,gyp}]
10+
indent_style = space
11+
indent_size = 2
12+
13+
[*.js]
14+
indent_style = space
15+
indent_size = 2
16+
17+
[*.rs]
18+
indent_style = space
19+
indent_size = 4
20+
21+
[*.{c,cc,h}]
22+
indent_style = space
23+
indent_size = 4
24+
25+
[*.{py,pyi}]
26+
indent_style = space
27+
indent_size = 4
28+
29+
[*.swift]
30+
indent_style = space
31+
indent_size = 4
32+
33+
[*.go]
34+
indent_style = tab
35+
indent_size = 8
36+
37+
[Makefile]
38+
indent_style = tab
39+
indent_size = 8

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
* text eol=lf
2+
3+
src/*.json linguist-generated
4+
src/parser.c linguist-generated
5+
src/tree_sitter/* linguist-generated
6+
7+
bindings/** linguist-generated
8+
binding.gyp linguist-generated
9+
setup.py linguist-generated
10+
Makefile linguist-generated
11+
Package.swift linguist-generated

.github/workflows/ci.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
name: CI
22

33
on:
4-
pull_request:
5-
branches:
6-
- '**'
74
push:
8-
branches:
9-
- 'main'
5+
branches: [main]
6+
paths:
7+
- grammar.js
8+
- src/**
9+
- test/**
10+
- bindings/**
11+
- binding.gyp
12+
pull_request:
13+
paths:
14+
- grammar.js
15+
- src/**
16+
- test/**
17+
- bindings/**
18+
- binding.gyp
1019

1120
concurrency:
12-
group: ${{ github.workflow }}-${{ github.ref }}
21+
group: ${{github.workflow}}-${{github.ref}}
1322
cancel-in-progress: true
1423

1524
jobs:
1625
test:
17-
name: Run validation tests
18-
runs-on: ${{ matrix.os }}
26+
name: Test parser
27+
runs-on: ${{matrix.os}}
1928
strategy:
20-
fail-fast: true
29+
fail-fast: false
2130
matrix:
22-
os: [macos-latest, ubuntu-latest, windows-latest]
31+
os: [ubuntu-latest, windows-latest, macos-14]
2332
steps:
2433
- name: Checkout repository
25-
uses: actions/checkout@v3
26-
- name: Install Node.js
27-
uses: actions/setup-node@v3
34+
uses: actions/checkout@v4
35+
- name: Set up tree-sitter
36+
uses: tree-sitter/setup-action/cli@v1
37+
- name: Run tests
38+
uses: tree-sitter/parser-test-action@v2
2839
with:
29-
node-version: '20.10.x'
30-
registry-url: 'https://registry.npmjs.org'
31-
- name: Install dependencies
32-
run: npm ci
33-
- name: Run tree-sitter tests
34-
run: npm test
35-
- name: Ensure generated parser files are up-to-date
36-
# On Windows and Macos, tree-sitter generate results in a diff, not sure why
37-
if: runner.os != 'Windows' && runner.os != 'macOS'
38-
run: |
39-
git status
40-
test -z "$(git status --porcelain)"
40+
test-rust: ${{runner.os == 'Linux'}}

Makefile

Lines changed: 112 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

binding.gyp

Lines changed: 16 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/c/tree-sitter-gitcommit.h

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/c/tree-sitter-gitcommit.pc.in

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/go/binding.go

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/go/binding_test.go

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)