Skip to content

Commit 37c573f

Browse files
committed
add initial project structure
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
1 parent ac27dcf commit 37c573f

30 files changed

Lines changed: 4002 additions & 1 deletion

.bouncer.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
permit:
2+
- BSD.*
3+
- MIT.*
4+
- Apache.*
5+
- MPL.*
6+
- ISC
7+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
set -eu
3+
4+
ORIGINAL_STATE_DIR=$(mktemp -d "TEMP-original-state-XXXXXXXXX")
5+
TIDY_STATE_DIR=$(mktemp -d "TEMP-tidy-state-XXXXXXXXX")
6+
7+
trap "cp -v ${ORIGINAL_STATE_DIR}/* ./ && rm -fR ${ORIGINAL_STATE_DIR} ${TIDY_STATE_DIR}" EXIT
8+
9+
echo "Capturing original state of files..."
10+
cp -v go.mod go.sum "${ORIGINAL_STATE_DIR}"
11+
12+
echo "Capturing state of go.mod and go.sum after running go mod tidy..."
13+
go mod tidy
14+
cp -v go.mod go.sum "${TIDY_STATE_DIR}"
15+
echo ""
16+
17+
set +e
18+
19+
# Detect difference between the git HEAD state and the go mod tidy state
20+
DIFF_MOD=$(diff -u "${ORIGINAL_STATE_DIR}/go.mod" "${TIDY_STATE_DIR}/go.mod")
21+
DIFF_SUM=$(diff -u "${ORIGINAL_STATE_DIR}/go.sum" "${TIDY_STATE_DIR}/go.sum")
22+
23+
if [[ -n "${DIFF_MOD}" || -n "${DIFF_SUM}" ]]; then
24+
echo "go.mod diff:"
25+
echo "${DIFF_MOD}"
26+
echo "go.sum diff:"
27+
echo "${DIFF_SUM}"
28+
echo ""
29+
printf "FAILED! go.mod and/or go.sum are NOT tidy; please run 'go mod tidy'.\n\n"
30+
exit 1
31+
fi

0 commit comments

Comments
 (0)