Skip to content

Commit d81f4d0

Browse files
committed
[static] add check-repo-names to Splice
Signed-off-by: Itai Segall <itai.segall@digitalasset.com>
1 parent a6f7631 commit d81f4d0

File tree

2 files changed

+7
-47
lines changed

2 files changed

+7
-47
lines changed

.github/workflows/build.static_tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ jobs:
7575
with:
7676
cmd: actionlint
7777

78+
- name: Check for strings that should not be used in Splice
79+
uses: ./.github/actions/nix/run_bash_command_in_nix
80+
with:
81+
cmd: ./scripts/check-repo-names.sh
82+
7883
- name: SBT-based static checks
7984
uses: ./.github/actions/sbt/execute_sbt_command
8085
with:

scripts/check-repo-names.sh

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@
88
set -euo pipefail
99

1010
SPLICE_ROOT=$( git rev-parse --show-toplevel )
11-
copy_script="scripts/copy-to-splice.sh"
1211
rename_script="scripts/check-repo-names.sh"
13-
if [[ -f "$SPLICE_ROOT/$copy_script" ]]; then
14-
in_copy_src=yes
15-
else
16-
in_copy_src=no
17-
fi
1812

1913
function check_patterns_locally() {
2014
# removing NEVERMATCHES alternative causes these to never match
@@ -63,6 +57,7 @@ function check_patterns_locally() {
6357
'cluster/stacks'
6458
'cluster/images/LICENSE'
6559
'expected.json'
60+
'README.md'
6661
)
6762

6863
local exception exceptions_args=()
@@ -97,44 +92,4 @@ function check_patterns_locally() {
9792
fi
9893
}
9994

100-
function setup_temp_splice() {
101-
local src="$1" tempsplice
102-
tempsplice="$(mktemp -d)"
103-
cd "$src"
104-
local script_prefix
105-
case $in_copy_src in
106-
yes) script_prefix=;;
107-
no) script_prefix='direnv exec .';;
108-
esac
109-
$script_prefix "$copy_script" "$tempsplice"
110-
cd "$tempsplice"
111-
}
112-
113-
function check_patterns() {
114-
local optstring
115-
case "$in_copy_src" in
116-
yes)
117-
optstring='h'
118-
setup_temp_splice "$SPLICE_ROOT";;
119-
no) optstring='hs:';;
120-
esac
121-
122-
while getopts "$optstring" arg; do
123-
case "$arg" in
124-
h)
125-
echo ' Options: [-s SPLICE_REPO]
126-
-s: Run copy-to-splice from SPLICE_REPO first, and scan the result' 1>&2
127-
exit 0;;
128-
s)
129-
if [[ ! -d $OPTARG ]]; then
130-
echo "-s requires a splice repo directory" 1>&2
131-
exit 1
132-
fi
133-
setup_temp_splice "$OPTARG";;
134-
:|?) exit 1;;
135-
esac
136-
done
137-
check_patterns_locally
138-
}
139-
140-
check_patterns "$@"
95+
check_patterns_locally

0 commit comments

Comments
 (0)