-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: staged-lint * chore: new commands * chore: new commands with `realpath` * chore: create shell script for pre-commit * fix: pop first element
- Loading branch information
1 parent
f920bde
commit a2a66b7
Showing
5 changed files
with
42 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Pre-Commit | ||
|
||
This is a folder to store scripts for [Pre-Commit](https://pre-commit.com/) | ||
|
||
Config file for `Pre-Commit` is located at [.pre-commit-config.yaml](../.pre-commit-config.yaml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
D=webui/react | ||
target=$1 | ||
shift | ||
files=$(realpath --relative-to="$D" "${@}" | tr "\n" " ") | ||
|
||
case $target in | ||
js ) make -j$(nproc) -C "$D" prettier PRE_ARGS="-- -c $files" eslint ES_ARGS="$files" ;; | ||
css ) make -j$(nproc) -C "$D" prettier PRE_ARGS="-- -c $files" stylelint ST_ARGS="$files" ;; | ||
misc ) make -j$(nproc) -C "$D" prettier PRE_ARGS="-- -c $files" check-package-lock ;; | ||
* ) echo "unknonwn target '$target'"; exit 1 ;; | ||
|
||
esac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters