Skip to content

Commit 24b43ea

Browse files
authored
Merge pull request ElementsProject#1413 from delta1/lint-merge-prs
lint: fix shellcheck, spelling, and locale
2 parents b8cf7b7 + 2f1b86e commit 24b43ea

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

contrib/merge-prs.sh

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
#!/usr/bin/env bash
22

3+
export LC_ALL=C
34
set -eo pipefail
45

56
BASE_ORIG=merged-master
67
BASE="${BASE_ORIG}"
78
BITCOIN_UPSTREAM_REMOTE=bitcoin
89
BITCOIN_UPSTREAM="${BITCOIN_UPSTREAM_REMOTE}/master"
9-
ELEMENTS_UPSTREAM_REMOTE=upstream
10-
ELEMENTS_UPSTREAM="${ELEMENTS_UPSTREAM_REMOTE}/master"
10+
# ELEMENTS_UPSTREAM_REMOTE=upstream
11+
# ELEMENTS_UPSTREAM="${ELEMENTS_UPSTREAM_REMOTE}/master"
1112

1213
# Replace this with the location where we should put the fuzz test corpus
1314
BITCOIN_QA_ASSETS="${HOME}/.tmp/bitcoin/qa-assets"
1415
FUZZ_CORPUS="${BITCOIN_QA_ASSETS}/fuzz_seed_corpus/"
15-
mkdir -p "$(dirname ${BITCOIN_QA_ASSETS})"
16+
mkdir -p "$(dirname "${BITCOIN_QA_ASSETS}")"
1617

1718
# BEWARE: On some systems /tmp/ gets periodically cleaned, which may cause
1819
# random files from this directory to disappear based on timestamp, and
@@ -100,13 +101,10 @@ if [[ "$SKIP_MERGE" == "1" ]]; then
100101
fi
101102

102103
## Get full list of merges
103-
ELT_COMMITS=$(git -C "$WORKTREE" log "$ELEMENTS_UPSTREAM" --not $BASE --merges --first-parent --pretty='format:%ct %cI %h Elements %s')
104-
BTC_COMMITS=$(git -C "$WORKTREE" log "$BITCOIN_UPSTREAM" --not $BASE --merges --first-parent --pretty='format:%ct %cI %h Bitcoin %s')
105-
106-
#ELT_COMMITS=
107-
#BTC_COMMITS=$(git -C "$WORKTREE" log v0.21.0 --not $BASE --merges --first-parent --pretty='format:%ct %cI %h Bitcoin %s')
108-
109-
#play /home/apoelstra/games/Hover/sounds/mixed/hit_wall.wav 2>/dev/null ## play start sound
104+
# for elements
105+
# COMMITS=$(git -C "$WORKTREE" log "$ELEMENTS_UPSTREAM" --not $BASE --merges --first-parent --pretty='format:%ct %cI %h Elements %s')
106+
# for bitcoin
107+
COMMITS=$(git -C "$WORKTREE" log "$BITCOIN_UPSTREAM" --not $BASE --merges --first-parent --pretty='format:%ct %cI %h Bitcoin %s')
110108

111109
cd "$WORKTREE"
112110

@@ -122,19 +120,19 @@ quietly () {
122120

123121
## Sort by unix timestamp and iterate over them
124122
#echo "$ELT_COMMITS" "$BTC_COMMITS" | sort -n -k1 | while read line
125-
echo "$ELT_COMMITS" | tac | while read line
123+
echo "$COMMITS" | tac | while read -r line
126124
do
127125
echo
128126
echo "=-=-=-=-=-=-=-=-=-=-="
129127
echo
130128

131-
echo -e $line
129+
echo -e "$line"
132130
## Extract data and output what we're doing
133-
DATE=$(echo $line | cut -d ' ' -f 2)
134-
HASH=$(echo $line | cut -d ' ' -f 3)
135-
CHAIN=$(echo $line | cut -d ' ' -f 4)
136-
PR_ID=$(echo $line | cut -d ' ' -f 6 | tr -d :)
137-
PR_ID_ALT=$(echo $line | cut -d ' ' -f 8 | tr -d :)
131+
DATE=$(echo "$line" | cut -d ' ' -f 2)
132+
HASH=$(echo "$line" | cut -d ' ' -f 3)
133+
CHAIN=$(echo "$line" | cut -d ' ' -f 4)
134+
PR_ID=$(echo "$line" | cut -d ' ' -f 6 | tr -d :)
135+
PR_ID_ALT=$(echo "$line" | cut -d ' ' -f 8 | tr -d :)
138136

139137
if [[ "$PR_ID" == "pull" ]]; then
140138
PR_ID="${PR_ID_ALT}"
@@ -150,7 +148,7 @@ do
150148
echo -e "Continuing build of \e[37m$PR_ID\e[0m at $(date)"
151149
else
152150
echo -e "Start merge/build of \e[37m$PR_ID\e[0m at $(date)"
153-
git -C "$WORKTREE" merge $HASH --no-ff -m "Merge $HASH into merged_master ($CHAIN PR $PR_ID)"
151+
git -C "$WORKTREE" merge "$HASH" --no-ff -m "Merge $HASH into merged_master ($CHAIN PR $PR_ID)"
154152
fi
155153

156154
if [[ "$DO_BUILD" == "1" ]]; then

test/lint/lint-spelling.ignore-words.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ xwindows
2929
te
3030
ligh
3131
atack
32+
lsat

test/lint/lint-spelling.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if ! command -v codespell > /dev/null; then
1515
fi
1616

1717
IGNORE_WORDS_FILE=test/lint/lint-spelling.ignore-words.txt
18-
mapfile -t FILES < <(git ls-files -- ":(exclude)build-aux/m4/" ":(exclude)contrib/seeds/*.txt" ":(exclude)depends/" ":(exclude)doc/release-notes/" ":(exclude)src/leveldb/" ":(exclude)src/crc32c/" ":(exclude)src/qt/locale/" ":(exclude)src/qt/*.qrc" ":(exclude)src/secp256k1/" ":(exclude)src/minisketch/" ":(exclude)src/univalue/" ":(exclude)contrib/builder-keys/keys.txt" ":(exclude)contrib/guix/patches")
18+
mapfile -t FILES < <(git ls-files -- ":(exclude)build-aux/m4/" ":(exclude)contrib/seeds/*.txt" ":(exclude)depends/" ":(exclude)doc/release-notes/" ":(exclude)src/leveldb/" ":(exclude)src/crc32c/" ":(exclude)src/qt/locale/" ":(exclude)src/qt/*.qrc" ":(exclude)src/secp256k1/" ":(exclude)src/minisketch/" ":(exclude)src/univalue/" ":(exclude)contrib/builder-keys/keys.txt" ":(exclude)contrib/guix/patches") ":(exclude)src/simplicity/"
1919
if ! codespell --check-filenames --disable-colors --quiet-level=7 --ignore-words=${IGNORE_WORDS_FILE} "${FILES[@]}"; then
2020
echo "^ Warning: codespell identified likely spelling errors. Any false positives? Add them to the list of ignored words in ${IGNORE_WORDS_FILE}"
2121
fi

0 commit comments

Comments
 (0)