mirror of
https://github.com/Automattic/harper.git
synced 2025-08-04 18:48:02 +00:00
feat: add update-vscode-linters
command to justfile
This commit is contained in:
parent
57bddf0652
commit
d58bec740f
1 changed files with 32 additions and 0 deletions
32
justfile
32
justfile
|
@ -128,6 +128,38 @@ package-vscode target="":
|
|||
yarn package
|
||||
fi
|
||||
|
||||
update-vscode-linters:
|
||||
#! /bin/bash
|
||||
set -eo pipefail
|
||||
|
||||
linters=$(
|
||||
cargo run --bin harper-cli -- config |
|
||||
jq 'with_entries(.key |= "harper-ls.linters." + . |
|
||||
.value |= {
|
||||
"scope": "resource",
|
||||
"type": "boolean",
|
||||
"default": .default_value,
|
||||
"description": .description
|
||||
}
|
||||
)'
|
||||
)
|
||||
|
||||
cd "{{justfile_directory()}}/packages/vscode-plugin"
|
||||
|
||||
manifest_without_linters=$(
|
||||
jq 'walk(
|
||||
if type == "object" then
|
||||
with_entries(select(.key | startswith("harper-ls.linters") | not))
|
||||
end
|
||||
)' package.json
|
||||
)
|
||||
|
||||
jq --argjson linters "$linters" \
|
||||
'.contributes.configuration.properties += $linters' <<< \
|
||||
"$manifest_without_linters" > \
|
||||
package.json
|
||||
yarn prettier --write package.json
|
||||
|
||||
# Run Rust formatting and linting.
|
||||
check-rust:
|
||||
#! /bin/bash
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue