-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
654 changed files
with
2,670 additions
and
28,906 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 was deleted.
Oops, something went wrong.
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,53 @@ | ||
#!/bin/sh | ||
|
||
# Check definition. Multiline string, every line is for one check. | ||
# Format of line is: | ||
# `Check title ./path/relative/to/this/script/check-script.sh`. | ||
# The last space separates title from script path. | ||
check_list=" | ||
BIOME LINT CHECK ./check-lint.sh | ||
BIOME FORMAT CHECK ./check-format.sh | ||
MAKEFILE FILE LISTING CHECK ./check-makefile-file-listing.sh | ||
" | ||
|
||
extract_title() { | ||
echo "$1" | awk '{$NF=""; print $0}' | ||
} | ||
|
||
extract_command() { | ||
realpath "$(dirname "$0")"/"$(echo "$1" | awk '{print $NF}')" | ||
} | ||
|
||
err_report="" | ||
while IFS= read -r line; do | ||
[ -n "$line" ] || continue | ||
|
||
check=$(extract_command "$line") | ||
|
||
if ! output=$("$check" 2>&1); then | ||
err_report="${err_report}$(extract_title "$line") ($check)\n$output\n\n" | ||
fi | ||
done << EOF | ||
$check_list | ||
EOF | ||
|
||
if [ -z "$err_report" ]; then | ||
exit 0 | ||
fi | ||
|
||
echo "Warning: some check failed" | ||
printf "%b" "$err_report" | ||
|
||
printf "Checks failed. Continue with commit? (c)Continue (a)Abort: " > /dev/tty | ||
IFS= read -r resolution < /dev/tty | ||
|
||
case "$resolution" in | ||
c | C) exit 0 ;; | ||
a | A) | ||
echo "Commit aborted." | ||
exit 1 | ||
;; | ||
esac | ||
|
||
echo "Unknown resolution '$resolution', aborting commit..." | ||
exit 1 |
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 @@ | ||
#!/bin/sh | ||
|
||
root_dir="$(realpath "$(dirname "$0")"/../../)" | ||
|
||
npx @biomejs/biome format "$root_dir" |
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 @@ | ||
#!/bin/sh | ||
|
||
root_dir="$(realpath "$(dirname "$0")"/../../)" | ||
|
||
npx @biomejs/biome lint --error-on-warnings "$root_dir" |
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,44 @@ | ||
#!/bin/sh | ||
|
||
makefile_list="\ | ||
Makefile.am | ||
packages/app/Makefile.am | ||
packages/test/Makefile.am | ||
" | ||
|
||
get_mentioned_files() { | ||
for makefile in $1; do | ||
[ -n "$makefile" ] || continue | ||
"$(dirname "$0")"/extract-extra-dist.sh "$makefile" | ||
done | ||
} | ||
|
||
get_unlisted_files() { | ||
makefiles=$1 | ||
added_files=$2 | ||
|
||
mentioned_files=$(get_mentioned_files "$makefiles") | ||
|
||
for file in $added_files; do | ||
if ! echo "$mentioned_files" | | ||
grep --quiet --fixed-strings --line-regexp "$file" 2> /dev/null; then | ||
echo "$file" | ||
fi | ||
done | ||
} | ||
|
||
git_added="$(git diff --cached --name-only --diff-filter=A)" | ||
|
||
if [ -z "$git_added" ]; then | ||
exit 0 | ||
fi | ||
|
||
unlisted_files="$(get_unlisted_files "$makefile_list" "$git_added")" | ||
|
||
if [ -z "$unlisted_files" ]; then | ||
exit 0 | ||
fi | ||
|
||
echo "Warning: The following files are not listed in any Makefile.am:" | ||
echo "$unlisted_files" | ||
exit 1 |
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,30 @@ | ||
#!/bin/sh | ||
|
||
makefile="$1" | ||
inside_extra_dist=0 | ||
files="" | ||
|
||
while IFS= read -r line; do | ||
case "$line" in | ||
*EXTRA_DIST[[:space:]]*=*) | ||
inside_extra_dist=1 | ||
files="${line#*=}" | ||
files="${files%\\}" | ||
;; | ||
*\\) | ||
[ $inside_extra_dist -eq 1 ] && files="$files ${line%\\}" | ||
;; | ||
*) # the last line in EXTRA_DIST | ||
[ $inside_extra_dist -eq 1 ] && files="$files $line" && break | ||
;; | ||
esac | ||
done < "$makefile" | ||
|
||
# no globing | ||
set -f | ||
# split to arguments | ||
# shellcheck disable=2086 | ||
set -- $files | ||
for file in "$@"; do | ||
printf "%s\n" "${makefile%Makefile.am}$file" | ||
done |
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,4 @@ | ||
#!/bin/sh | ||
|
||
./.bin/pre-commit/remove-nexus.sh | ||
./.bin/pre-commit/check-all.sh |
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 |
---|---|---|
|
@@ -21,7 +21,6 @@ yarn-error.log* | |
pcs-web-ui-* | ||
pcs-web-ui.spec | ||
.npmrc | ||
.eslintcache | ||
|
||
stamps* | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.