Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tenzen-y committed May 1, 2022
1 parent 1cc45fe commit deea56f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions hack/boilerplate/update-boilerplate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ for i in ${find_go_files}; do
if [[ $(sed -n 2p "$i") =~ "Copyright" ]]; then
echo "Remove the current boilerplate and add the new boilerplate to $i"
tail -n +17 "$i" >"$i.tmp"
# If the 1st line starts with "//go:build" and the 2nd line starts with "Copyright", remove the current boilerplate and copy the marker for Go.
# If the 1st line starts with "//go:build" and the 4th line starts with "Copyright", remove the current boilerplate and copy the marker.
elif [[ $(sed -n 1p "$i") =~ "//go:build" ]] && [[ $(sed -n 4p "$i") =~ "Copyright" ]]; then
echo "Remove the current boilerplate, copy the marker for Go, and add the new boilerplate to $i"
sed -e "2,17d" "$i" > "$i.tmp"
Expand All @@ -42,7 +42,7 @@ for i in ${find_go_files}; do
cat "$i" >"$i.tmp"
fi

# If the 1st line starts with "//go:build", copy the marker for Go and add the new boilerplate to the file.
# If the 1st line starts with "//go:build", copy the marker and add the new boilerplate to the file.
if [[ $(sed -n 1p "$i.tmp") =~ "//go:build" ]]; then
(head -2 "$i.tmp" && cat ./hack/boilerplate/boilerplate.go.txt && tail -n +3 "$i.tmp") >"$i" && rm "$i.tmp"
# Otherwise, add the new boilerplate to the file.
Expand Down
9 changes: 7 additions & 2 deletions hack/verify-shellcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ set -o pipefail

cd "$(dirname "$0")/.."

if ! which shellcheck >/dev/null; then
echo 'Can not find shellcheck, install with: make shellcheck'
exit 1
fi

shell_scripts=()
while IFS='' read -r script;
do git check-ignore -q "$script" || shell_scripts+=("$script");
done < <(find . -name "*.sh" \
! -path ./_\* \
! -path ./.git\*
! -path "./_*" \
! -path "./.git/*"
)

shellcheck "${shell_scripts[@]}"

0 comments on commit deea56f

Please sign in to comment.