mirror of
https://github.com/ivuorinen/tree-sitter-shellspec.git
synced 2026-02-15 21:52:36 +00:00
chore: add prettier and format all files
- Install prettier ^3.6.2 - Add .prettierrc with project formatting rules - Add .prettierignore to exclude generated files and dependencies - Add npm scripts: format and format:check - Format all files with prettier
This commit is contained in:
4
.github/renovate.json
vendored
4
.github/renovate.json
vendored
@@ -1,6 +1,4 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
"extends": [
|
"extends": ["github>ivuorinen/renovate-config"]
|
||||||
"github>ivuorinen/renovate-config"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
2
.github/workflows/codeql.yml
vendored
2
.github/workflows/codeql.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
language: ['actions,javascript', 'cpp'] # Add languages used in your actions
|
language: ["actions,javascript", "cpp"] # Add languages used in your actions
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
|||||||
24
.prettierignore
Normal file
24
.prettierignore
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Dependencies
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# Generated files
|
||||||
|
src/parser.c
|
||||||
|
src/grammar.json
|
||||||
|
src/node-types.json
|
||||||
|
src/tree_sitter/
|
||||||
|
|
||||||
|
# Build artifacts
|
||||||
|
build/
|
||||||
|
dist/
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
*.log
|
||||||
|
megalinter-reports/
|
||||||
|
|
||||||
|
# Test specs (shell scripts have specific formatting)
|
||||||
|
test/spec/
|
||||||
|
|
||||||
|
# Lock files
|
||||||
|
package-lock.json
|
||||||
|
pnpm-lock.yaml
|
||||||
|
yarn.lock
|
||||||
11
.prettierrc
Normal file
11
.prettierrc
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"semi": true,
|
||||||
|
"trailingComma": "all",
|
||||||
|
"singleQuote": false,
|
||||||
|
"printWidth": 100,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"useTabs": false,
|
||||||
|
"arrowParens": "always",
|
||||||
|
"endOfLine": "lf",
|
||||||
|
"proseWrap": "preserve"
|
||||||
|
}
|
||||||
@@ -30,20 +30,20 @@ module.exports = grammar(bashGrammar, {
|
|||||||
[$.pipeline],
|
[$.pipeline],
|
||||||
// 2 essential ShellSpec conflicts
|
// 2 essential ShellSpec conflicts
|
||||||
[$.command_name, $.shellspec_data_block],
|
[$.command_name, $.shellspec_data_block],
|
||||||
[$.shellspec_hook_block]
|
[$.shellspec_hook_block],
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
// 8 ShellSpec rule extensions
|
// 8 ShellSpec rule extensions
|
||||||
shellspec_describe_block, // Describe/fDescribe/xDescribe
|
shellspec_describe_block, // Describe/fDescribe/xDescribe
|
||||||
shellspec_context_block, // Context/ExampleGroup variants
|
shellspec_context_block, // Context/ExampleGroup variants
|
||||||
shellspec_it_block, // It/Example/Specify variants
|
shellspec_it_block, // It/Example/Specify variants
|
||||||
shellspec_hook_block, // BeforeEach/AfterEach/etc blocks
|
shellspec_hook_block, // BeforeEach/AfterEach/etc blocks
|
||||||
shellspec_utility_block, // Parameters/Skip/Pending/Todo
|
shellspec_utility_block, // Parameters/Skip/Pending/Todo
|
||||||
shellspec_data_block, // Data blocks with statements/arguments
|
shellspec_data_block, // Data blocks with statements/arguments
|
||||||
shellspec_hook_statement, // Before/After statements
|
shellspec_hook_statement, // Before/After statements
|
||||||
shellspec_directive_statement // Include/Skip if
|
shellspec_directive_statement, // Include/Skip if
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
### Supported ShellSpec Constructs
|
### Supported ShellSpec Constructs
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ check-ci:
|
|||||||
|
|
||||||
### 2. Release Workflow (`release.yml`)
|
### 2. Release Workflow (`release.yml`)
|
||||||
|
|
||||||
- **Triggers**: tags (v*.*.*), manual dispatch
|
- **Triggers**: tags (v*.*.\*), manual dispatch
|
||||||
- **Jobs**: validate, check-ci, security, release
|
- **Jobs**: validate, check-ci, security, release
|
||||||
- **Purpose**: Streamlined release process with CI dependency
|
- **Purpose**: Streamlined release process with CI dependency
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
ignore_all_files_in_gitignore: true
|
ignore_all_files_in_gitignore: true
|
||||||
ignored_paths:
|
ignored_paths:
|
||||||
- megalinter-reports
|
- megalinter-reports
|
||||||
read_only: false
|
read_only: false
|
||||||
|
|
||||||
# list of tool names to exclude. We recommend not excluding any tools, see the readme for more details.
|
# list of tool names to exclude. We recommend not excluding any tools, see the readme for more details.
|
||||||
@@ -46,8 +46,8 @@ excluded_tools: []
|
|||||||
initial_prompt: ""
|
initial_prompt: ""
|
||||||
project_name: "tree-sitter-shellspec"
|
project_name: "tree-sitter-shellspec"
|
||||||
languages:
|
languages:
|
||||||
- cpp
|
- cpp
|
||||||
- typescript
|
- typescript
|
||||||
- bash
|
- bash
|
||||||
included_optional_tools: []
|
included_optional_tools: []
|
||||||
encoding: utf-8
|
encoding: utf-8
|
||||||
|
|||||||
17
package-lock.json
generated
17
package-lock.json
generated
@@ -14,6 +14,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"markdownlint-cli": "^0.46.0",
|
"markdownlint-cli": "^0.46.0",
|
||||||
"nodemon": "^3.0.1",
|
"nodemon": "^3.0.1",
|
||||||
|
"prettier": "^3.6.2",
|
||||||
"tree-sitter-cli": "^0.25.0"
|
"tree-sitter-cli": "^0.25.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1278,6 +1279,22 @@
|
|||||||
"url": "https://github.com/sponsors/jonschlinkert"
|
"url": "https://github.com/sponsors/jonschlinkert"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/prettier": {
|
||||||
|
"version": "3.6.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz",
|
||||||
|
"integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"bin": {
|
||||||
|
"prettier": "bin/prettier.cjs"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/pstree.remy": {
|
"node_modules/pstree.remy": {
|
||||||
"version": "1.1.8",
|
"version": "1.1.8",
|
||||||
"resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz",
|
"resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz",
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
"lint": "npx mega-linter-runner",
|
"lint": "npx mega-linter-runner",
|
||||||
"lint:yaml": "yamllint .",
|
"lint:yaml": "yamllint .",
|
||||||
"lint:markdown": "markdownlint . --config .markdownlint.json --ignore node_modules --fix",
|
"lint:markdown": "markdownlint . --config .markdownlint.json --ignore node_modules --fix",
|
||||||
|
"format": "prettier --write .",
|
||||||
|
"format:check": "prettier --check .",
|
||||||
"precommit": "pre-commit run --all-files",
|
"precommit": "pre-commit run --all-files",
|
||||||
"clean": "rm -rf src/parser.c src/grammar.json src/node-types.json",
|
"clean": "rm -rf src/parser.c src/grammar.json src/node-types.json",
|
||||||
"rebuild": "npm run clean && npm run generate"
|
"rebuild": "npm run clean && npm run generate"
|
||||||
@@ -37,6 +39,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"markdownlint-cli": "^0.46.0",
|
"markdownlint-cli": "^0.46.0",
|
||||||
"nodemon": "^3.0.1",
|
"nodemon": "^3.0.1",
|
||||||
|
"prettier": "^3.6.2",
|
||||||
"tree-sitter-cli": "^0.25.0"
|
"tree-sitter-cli": "^0.25.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,15 +5,9 @@
|
|||||||
"camelcase": "Shellspec",
|
"camelcase": "Shellspec",
|
||||||
"scope": "source.shellspec",
|
"scope": "source.shellspec",
|
||||||
"path": ".",
|
"path": ".",
|
||||||
"file-types": [
|
"file-types": ["shellspec"],
|
||||||
"shellspec"
|
"highlights": ["queries/highlights.scm"],
|
||||||
],
|
"locals": ["queries/locals.scm"],
|
||||||
"highlights": [
|
|
||||||
"queries/highlights.scm"
|
|
||||||
],
|
|
||||||
"locals": [
|
|
||||||
"queries/locals.scm"
|
|
||||||
],
|
|
||||||
"injection-regex": "shellspec"
|
"injection-regex": "shellspec"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user