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

ci: add linting and formatting automation to tree-sitter grammar #68

Merged
merged 5 commits into from
Mar 25, 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
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,23 @@ concurrency:

jobs:
test:
name: Test tree-sitter
runs-on: ubuntu-latest
defaults:
run:
working-directory: tree_sitter_v

steps:
- name: Install Nodejs
uses: actions/setup-node@v4
with:
node-version: 20

- name: Checkout v-analyzer
uses: actions/checkout@v4

- name: Install dependencies
run: cd tree_sitter_v && npm update
run: npm update

- name: Run tests
run: cd tree_sitter_v && npm run test
run: npm run test

- name: Lint
run: npm run lint

- name: Verify formatting
run: npm run format:check
15 changes: 15 additions & 0 deletions tree_sitter_v/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
env: {
commonjs: true,
es2024: true,
},
extends: [
'google',
'prettier', // Use prettier for formatting, disable potentially conflicting rules.
],
overrides: [],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
};
2 changes: 0 additions & 2 deletions tree_sitter_v/.gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
grammar.js symlink=file

src/tree_sitter/* linguist-generated
src/grammar.json linguist-generated
src/node-types.json linguist-generated
Expand Down
5 changes: 5 additions & 0 deletions tree_sitter_v/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
printWidth: 100,
singleQuote: true,
useTabs: true,
};
Loading