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

Standardization update #5

Merged
merged 9 commits into from
Apr 10, 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
36 changes: 32 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,38 @@ root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
max_line_length = 120
insert_final_newline = true
trim_trailing_whitespace = true

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

[*.js]
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
17 changes: 12 additions & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
* text eol=lf
*.wasm binary

/src/** linguist-generated
/src/scanner.cc linguist-generated=false
/index.js linguist-generated
/binding.gyp linguist-detectable=false
src/*.json linguist-generated
src/parser.c linguist-generated
src/tree_sitter/* linguist-generated

src/schema.*.c linguist-generated
schema/*/src/** linguist-generated

bindings/** linguist-generated
binding.gyp linguist-generated
setup.py linguist-generated
Makefile linguist-generated
Package.swift linguist-generated
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "ci"
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI

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

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

jobs:
test:
name: Test parsers
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-14]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Set up tree-sitter
uses: tree-sitter/setup-action/cli@v1
- name: Run tests
uses: tree-sitter/parser-test-action@v2
with:
test-rust: ${{runner.os == 'Linux'}}
- name: Set up test suite
shell: bash
run: |-
printf '%s\n' examples/*.yaml > "$RUNNER_TEMP/test-files"
while read -r file; do
printf '%s\n' "$file" >> "$RUNNER_TEMP/test-files"
if [[ -f ${file/in.yaml/error} ]]; then
printf '%s\n' "$file" >> "$RUNNER_TEMP/invalid-files"
fi
done < <(find -L examples/yaml-test-suite/name -name in.yaml)
- name: Parse test suite
uses: tree-sitter/parse-action@v4
with:
files-list: ${{runner.temp}}/test-files
invalid-files-list: ${{runner.temp}}/invalid-files
26 changes: 26 additions & 0 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Fuzz

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

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

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

on:
push:
tags: ["*"]

jobs:
npm:
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
with:
package-name: "@tree-sitter-grammars/tree-sitter-yaml"
secrets:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
crates:
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
secrets:
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_TOKEN}}
pypi:
uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main
secrets:
PYPI_API_TOKEN: ${{secrets.PYPI_TOKEN}}
39 changes: 35 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
/build
/node_modules
# Rust artifacts
Cargo.lock
target/

/bindings/rust
/Cargo.toml
# Node artifacts
build/
prebuilds/
node_modules/

# Swift artifacts
.build/
Package.resolved

# Go artifacts
go.sum
_obj/

# Python artifacts
.venv/
dist/
*.egg-info
*.whl

# C artifacts
*.a
*.so
*.so.*
*.dylib
*.dll
*.pc

# Grammar volatiles
dsl.d.ts
*.wasm
*.obj
*.o
7 changes: 2 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
[submodule "tree-sitter"]
path = tree-sitter
url = https://github.com/ikatyang/tree-sitter
branch = v0.19.3-custom
[submodule "yaml-test-suite"]
path = yaml-test-suite
path = examples/yaml-test-suite
url = https://github.com/yaml/yaml-test-suite
branch = data
shallow = true
Empty file removed .npmignore
Empty file.
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

69 changes: 0 additions & 69 deletions CHANGELOG.md

This file was deleted.

27 changes: 27 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "tree-sitter-yaml"
description = "YAML grammar for tree-sitter"
version = "0.6.0"
license = "MIT"
readme = "README.md"
keywords = ["incremental", "parsing", "tree-sitter", "yaml"]
categories = ["parsing", "text-editors"]
authors = [
"Ika <[email protected]>",
"Amaan Qureshi <[email protected]>"
]
repository = "https://github.com/tree-sitter-grammars/tree-sitter-yaml"
edition = "2021"
autoexamples = false

build = "bindings/rust/build.rs"
include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"]

[lib]
path = "bindings/rust/lib.rs"

[dependencies]
tree-sitter = ">=0.21.0"

[build-dependencies]
cc = "1.0.92"
5 changes: 2 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
The MIT License (MIT)

Copyright (c) Ika <[email protected]> (https://github.com/ikatyang)
Copyright (c) 2024 tree-sitter-grammars contributors
Copyright (c) 2019-2021 Ika

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
15 changes: 9 additions & 6 deletions Makefile

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

Loading
Loading