Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for 0.24 #34

Merged
merged 3 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
root = true

[*]
charset = utf-8

[*.{json,toml,yml,gyp}]
indent_style = space
indent_size = 2

[*.js]
indent_style = space
indent_size = 2

[*.scm]
indent_style = space
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

[*.swift]
indent_style = space
indent_size = 4

[*.go]
indent_style = tab
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.

41 changes: 36 additions & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
/src/** linguist-vendored
/examples/* linguist-vendored
* text=auto eol=lf

src/grammar.json -diff
src/node-types.json -diff
src/parser.c -diff
# Generated source files
src/*.json linguist-generated
src/parser.c linguist-generated
src/tree_sitter/* 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
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
127 changes: 106 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,118 @@ name: CI

on:
push:
branches:
- master
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:
runs-on: ${{ matrix.os }}
name: Test parser
runs-on: ${{matrix.os}}
strategy:
fail-fast: true
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
os: [ubuntu-latest, windows-latest, macos-14]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up tree-sitter
uses: tree-sitter/setup-action/cli@v2
- name: Run tests
uses: tree-sitter/parser-test-action@v2
with:
node-version: 18
- run: npm install
- run: npm test

test_windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
test-rust: true
test-node: true
test-python: true
test-go: true
test-swift: true
- name: Set up examples
run: |-
git clone https://github.com/Azure/bicep examples/bicep --single-branch --depth=1 --filter=blob:none
- name: Parse examples
uses: tree-sitter/parse-action@v4
with:
node-version: 18
- run: npm install
- run: npm run-script test-windows
files: |
examples/**/*.bicep
!examples/bicep/src/Bicep.Cli.E2eTests/src/examples/extensions.ff/main.bicep
!examples/bicep/src/Bicep.Cli.E2eTests/src/examples/extensions.prod/main.bicep
!examples/bicep/src/Bicep.Cli.E2eTests/src/examples/local-deploy/main.bicep
!examples/bicep/src/Bicep.Core.Samples/Files/baselines/ResourceDerivedTypes_LF/main.bicep
!examples/bicep/src/Bicep.Core.Samples/Files/baselines/ResourceDerivedTypes_LF/main.diagnostics.bicep
!examples/bicep/src/Bicep.Core.Samples/Files/baselines/ResourceDerivedTypes_LF/main.formatted.bicep
!examples/bicep/src/Bicep.Core.Samples/Files/baselines/ResourceDerivedTypes_LF/main.ir.bicep
!examples/bicep/src/Bicep.Core.Samples/Files/baselines/ResourceDerivedTypes_LF/main.sourcemap.bicep
!examples/bicep/src/Bicep.Core.Samples/Files/baselines/ResourceDerivedTypes_LF/main.symbols.bicep
!examples/bicep/src/Bicep.Core.Samples/Files/baselines/ResourceDerivedTypes_LF/main.syntax.bicep
!examples/bicep/src/Bicep.Core.Samples/Files/baselines/ResourceDerivedTypes_LF/main.tokens.bicep
!examples/bicep/src/Bicep.Core.Samples/Files/baselines/TypeDeclarations_LF/main.formatted.bicep
!examples/bicep/src/Bicep.Core.Samples/Files/user_submitted/extensibility/aks/modules/kubernetes.bicep
!examples/bicep/src/Bicep.Core.Samples/Files/user_submitted/extensibility/microsoftGraph/main.bicep
!examples/bicep/src/Bicep.Core.Samples/Files/user_submitted/extensibility/microsoftGraph/main.existing.bicep
!examples/bicep/src/Bicep.LangServer.IntegrationTests/Files/ImportKubernetesManifest/azure-vote-all-in-one-redis/manifest.bicep
!examples/bicep/src/Bicep.LangServer.IntegrationTests/Files/ImportKubernetesManifest/wordpress/manifest.bicep
invalid-files: |
examples/**/Invalid*
examples/bicep/src/Bicep.Core.Samples/Files/baselines/Imports_LF/main.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/Imports_LF/main.diagnostics.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/Imports_LF/main.formatted.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/Imports_LF/main.ir.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/Imports_LF/main.pprint.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/Imports_LF/main.sourcemap.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/Imports_LF/main.symbols.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/Imports_LF/main.syntax.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/Imports_LF/main.tokens.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidFunctions_LF/main.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidFunctions_LF/main.diagnostics.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidFunctions_LF/main.formatted.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidFunctions_LF/main.pprint.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidFunctions_LF/main.symbols.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidFunctions_LF/main.syntax.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidFunctions_LF/main.tokens.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidResourceDerivedTypes_LF/main.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidResourceDerivedTypes_LF/main.diagnostics.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidResourceDerivedTypes_LF/main.formatted.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidResourceDerivedTypes_LF/main.pprint.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidResourceDerivedTypes_LF/main.symbols.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidResourceDerivedTypes_LF/main.syntax.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidResourceDerivedTypes_LF/main.tokens.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidTestFramework_CRLF/main.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidTestFramework_CRLF/main.diagnostics.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidTestFramework_CRLF/main.formatted.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidTestFramework_CRLF/main.ir.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidTestFramework_CRLF/main.pprint.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidTestFramework_CRLF/main.sourcemap.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidTestFramework_CRLF/main.symbols.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidTestFramework_CRLF/main.syntax.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidTestFramework_CRLF/main.tokens.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/InvalidTestFramework_CRLF/samples/broken.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/Lambdas_LF/main.pprint.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/Metadata_CRLF/main.syntax.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/Metadata_CRLF/main.tokens.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/NewlineSensitivity_LF/main.syntax.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/NewlineSensitivity_LF/main.tokens.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/Parameters_LF/main.syntax.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/Parameters_LF/main.tokens.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/Variables_LF/main.syntax.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines/Variables_LF/main.tokens.bicep
examples/bicep/src/Bicep.Core.Samples/Files/baselines_bicepparam/Invalid_Imports/foo.bicep
examples/bicep/src/Bicep.Decompiler.IntegrationTests/Files/Working/issue5455/nested_StorageRoleDeploymentResource.bicep
examples/bicep/src/Bicep.Decompiler.IntegrationTests/Files/Working/nested-outer/nested_testnested.bicep
examples/bicep/src/Bicep.Decompiler.IntegrationTests/Files/Working/userdefinedfunctions/main.bicep
examples/bicep/src/Bicep.MSBuild.E2eTests/examples/fail/fail.bicep
examples/bicep/src/vscode-bicep/src/test/e2e/examples/files/invalid-resources/main.bicep
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
19 changes: 13 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@ name: Lint

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

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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 install
run: npm ci --legacy-peer-deps
- name: Run ESLint
run: npm run lint
Loading
Loading