Skip to content

Commit

Permalink
ci: parse gitattributes templates
Browse files Browse the repository at this point in the history
  • Loading branch information
ObserverOfTime committed Feb 23, 2024
1 parent 53c914b commit fe6f985
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 34 deletions.
31 changes: 25 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,42 @@
name: Test grammar
name: CI

on:
push:
branches: ["*"]
branches: [master]
paths:
- grammar.js
- src/**
- test/**
- bindings/**
- binding.gyp
pull_request:
branches: ["*"]
paths:
- grammar.js
- src/**
- test/**
- bindings/**
- binding.gyp

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
test:
uses: tree-sitter-grammars/.github/.github/workflows/ci.yml@main
with:
test-library: true
name: Test parser
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-14]
steps:
- name: Set up repository
uses: tree-sitter-grammars/actions/setup@main
with:
submodules: true
node-version: ${{vars.NODE_VERSION}}
- name: Run tests
uses: tree-sitter-grammars/actions/test@main
with:
test-library: ${{runner.os == 'Linux'}}
examples: templates/**/*.gitattributes
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "gitattributes"]
url = https://github.com/gitattributes/gitattributes
path = templates
shallow = true
1 change: 1 addition & 0 deletions templates
Submodule templates added at 2aeb85
56 changes: 28 additions & 28 deletions test/highlight/test.gitattributes
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
[attr]nodiff -diff -merge
# <- keyword
# ^^^^^^ property
# ^ operator
# ^^^^ variable.builtin
# ^ operator
# ^^^^^ variable.builtin
# <- @keyword
# ^^^^^^ @property
# ^ @operator
# ^^^^ @variable.builtin
# ^ @operator
# ^^^^^ @variable.builtin

vendor/** linguist-vendored=true
# ^ punctuation.delimiter
# ^^ string.regexp
# ^^^^^^^^^^^^^^^^^ variable.parameter
# ^ operator
# ^^^^ boolean
# ^ @punctuation.delimiter
# ^^ @string.regexp
# ^^^^^^^^^^^^^^^^^ @variable.parameter
# ^ @operator
# ^^^^ @boolean

[^._]-[[:lower:]] !something
# ^ punctuation.bracket
# ^ operator
# ^^ string.special
# ^ punctuation.bracket
# ^ punctuation.bracket
# ^^^^^^^^^ constant
# ^ punctuation.bracket
# ^ operator
# ^^^^^^^^^^ variable.parameter
# ^ @punctuation.bracket
# ^ @operator
# ^^ @string.special
# ^ @punctuation.bracket
# ^ @punctuation.bracket
# ^^^^^^^^^ @constant
# ^ @punctuation.bracket
# ^ @operator
# ^^^^^^^^^^ @variable.parameter

"_\u4E00\t\56txt" encoding=UTF-16
# <- punctuation.special
# ^^^^^^ escape
# ^^ escape
# ^^^ escape
# ^ punctuation.special
# ^^^^^^^^ variable.builtin
# ^ operator
# ^^^^^^ string
# <- @punctuation.special
# ^^^^^^ @escape
# ^^ @escape
# ^^^ @escape
# ^ @punctuation.special
# ^^^^^^^^ @variable.builtin
# ^ @operator
# ^^^^^^ @string

# vim:ft=gitattributes:

0 comments on commit fe6f985

Please sign in to comment.