Skip to content

Commit

Permalink
Apply formatting from Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Feb 18, 2024
1 parent 6c148c2 commit 2cf6e8a
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 43 deletions.
28 changes: 14 additions & 14 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
module.exports = {
"env": {
"commonjs": true,
"es2021": true,
env: {
commonjs: true,
es2021: true,
},
// NOTE: eslint is deprecating its formatting rules so eslint-config-prettier
// will not always be necessary.
"extends": ["google", "prettier"],
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
extends: ["google", "prettier"],
overrides: [],
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
"rules": {
"indent": ["error", 2, { "SwitchCase": 1 }],
rules: {
indent: ["error", 2, { SwitchCase: 1 }],
"max-len": [
"error",
{
"code": 120,
"ignoreComments": true,
"ignoreUrls": true,
"ignoreStrings": true,
code: 120,
ignoreComments: true,
ignoreUrls: true,
ignoreStrings: true,
},
],
"valid-jsdoc": 0,
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
pull_request:
push:


jobs:
codestyle:
name: Codestyle (format and lint)
Expand Down
16 changes: 6 additions & 10 deletions GRAMMAR.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
justfile grammar
================
# justfile grammar

Justfiles are processed by a mildly context-sensitive tokenizer
and a recursive descent parser. The grammar is LL(k), for an
unknown but hopefully reasonable value of k.

tokens
------
## tokens

```
````
BACKTICK = `[^`]*`
INDENTED_BACKTICK = ```[^(```)]*```
COMMENT = #([^!].*)?$
Expand All @@ -23,10 +21,9 @@ INDENTED_RAW_STRING = '''[^(''')]*'''
STRING = "[^"]*" # also processes \n \r \t \" \\ escapes
INDENTED_STRING = """[^("""]*""" # also processes \n \r \t \" \\ escapes
TEXT = recipe text, only matches in a recipe body
```
````

grammar syntax
--------------
## grammar syntax

```
| alternation
Expand All @@ -36,8 +33,7 @@ _* repetition (0 or more times)
_+ repetition (1 or more times)
```

grammar
-------
## grammar

```
justfile : item* EOF
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ All our queries are in `queries-src`. This directory is what gets tested by
tree-sitter, and should be usable by helix. To generate queries for NeoVim,
run `./build-flavored-queries.py` (this is run as part of `npm run gen`).


You can use the [`:InspectTree`](https://neovim.io/doc/user/treesitter.html#%3AInspectTree)
command to explore the resulting parse tree, and [`:Inspect`](https://neovim.io/doc/user/lua.html#%3AInspect) to view highlight groups.

Expand Down
6 changes: 3 additions & 3 deletions bindings/node/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
try {
module.exports = require("../../build/Release/tree_sitter_just_binding");
} catch (error1) {
if (error1.code !== 'MODULE_NOT_FOUND') {
if (error1.code !== "MODULE_NOT_FOUND") {
throw error1;
}
try {
module.exports = require("../../build/Debug/tree_sitter_just_binding");
} catch (error2) {
if (error2.code !== 'MODULE_NOT_FOUND') {
if (error2.code !== "MODULE_NOT_FOUND") {
throw error2;
}
throw error1
throw error1;
}
}

Expand Down
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"exclude": ["src/", "bindings/", "*.md"]
"exclude": ["src/", "bindings/", "*.md"],
}
14 changes: 3 additions & 11 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ function array(item) {
module.exports = grammar({
name: "just",
externals: ($) => [$._indent, $._dedent, $._newline],
inline: (
$,
) => [
inline: ($) => [
$._string,
$._string_indented,
$._raw_string_indented,
Expand Down Expand Up @@ -130,10 +128,7 @@ module.exports = grammar({
"set",
"shell",
":=",
field(
"right",
array($.string_literal),
),
field("right", array($.string_literal)),
$.eol,
),
),
Expand Down Expand Up @@ -265,10 +260,7 @@ module.exports = grammar({
// dependency : NAME
// | '(' NAME expression* ')'
dependency: ($) =>
choice(
field("recipe", $.identifier),
$.dependency_expression,
),
choice(field("recipe", $.identifier), $.dependency_expression),

// contents of `(recipe expression)`
dependency_expression: ($) =>
Expand Down
1 change: 0 additions & 1 deletion src/grammar.json

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

2 changes: 1 addition & 1 deletion src/node-types.json

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

0 comments on commit 2cf6e8a

Please sign in to comment.