-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: cleanup root level files and add SPDX check for Go files (#2431)
## Description Some docs + SPDX + linting + file location cleanup. ## Checklist before merging - [x] Test, docs, adr added or updated as needed - [x] [Contributor Guide Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow) followed --------- Signed-off-by: razzle <[email protected]> Co-authored-by: Austin Abro <[email protected]> Co-authored-by: Austin Abro <[email protected]>
- Loading branch information
1 parent
087a4a3
commit d36c55d
Showing
37 changed files
with
212 additions
and
102 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
File renamed without changes.
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
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
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 |
---|---|---|
@@ -1,35 +1,5 @@ | ||
* @defenseunicorns/zarf | ||
|
||
# Docs & examples | ||
/adr/ @jeff-mccoy @Racer159 @Noxsios @lucasrod16 @AustinAbro321 | ||
/docs/ @jeff-mccoy @Racer159 @Noxsios @lucasrod16 @AustinAbro321 | ||
/examples/ @jeff-mccoy @Racer159 @Noxsios @lucasrod16 @AustinAbro321 | ||
*.md @jeff-mccoy @Racer159 @Noxsios @lucasrod16 @AustinAbro321 | ||
|
||
# Core code | ||
/src/ @jeff-mccoy @Racer159 @Noxsios @lucasrod16 @AustinAbro321 | ||
/go.* @jeff-mccoy @Racer159 @Noxsios @lucasrod16 @AustinAbro321 | ||
main.go @jeff-mccoy @Racer159 @Noxsios @lucasrod16 @AustinAbro321 | ||
|
||
# Init package | ||
/packages/ @jeff-mccoy @Racer159 @Noxsios @lucasrod16 @AustinAbro321 | ||
/zarf.yaml @jeff-mccoy @Racer159 @Noxsios @lucasrod16 @AustinAbro321 | ||
|
||
# Docs Website | ||
/docs-website/ @Racer159 @Noxsios @jeff-mccoy @lucasrod16 @AustinAbro321 | ||
|
||
# Privileged pipeline files | ||
/.github/ @jeff-mccoy @Racer159 @Noxsios @lucasrod16 @AustinAbro321 | ||
/hack/ @jeff-mccoy @Racer159 @Noxsios @lucasrod16 @AustinAbro321 | ||
/.gitignore @jeff-mccoy @Racer159 @Noxsios @lucasrod16 @AustinAbro321 | ||
/.golangci.yml @jeff-mccoy @Racer159 @Noxsios @lucasrod16 @AustinAbro321 | ||
/.goreleaser.yml @jeff-mccoy @Racer159 @Noxsios @lucasrod16 @AustinAbro321 | ||
/.grype.yaml @jeff-mccoy @Racer159 @Noxsios @lucasrod16 @AustinAbro321 | ||
/Dockerfile @jeff-mccoy @Racer159 @Noxsios @lucasrod16 @AustinAbro321 | ||
/renovate.json @jeff-mccoy @Racer159 @Noxsios @lucasrod16 @AustinAbro321 | ||
/Makefile @jeff-mccoy @Racer159 @Noxsios @lucasrod16 @AustinAbro321 | ||
|
||
# Additional privileged files | ||
/CODEOWNERS @jeff-mccoy @austenbryan | ||
/cosign.pub @jeff-mccoy @austenbryan | ||
/LICENSE @jeff-mccoy @austenbryan |
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
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,63 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
# Directory containing the Go files | ||
DIRECTORY="$1" | ||
|
||
# Array of paths to exclude from the check | ||
EXCLUDE_PATHS=( | ||
"src/cmd/tools/helm/repo_update.go" | ||
"src/cmd/tools/helm/repo_remove.go" | ||
"src/cmd/tools/helm/load_plugins.go" | ||
"src/cmd/tools/helm/repo_list.go" | ||
"src/cmd/tools/helm/flags.go" | ||
"src/cmd/tools/helm/repo_add.go" | ||
"src/cmd/tools/helm/dependency.go" | ||
"src/cmd/tools/helm/repo_index.go" | ||
"src/cmd/tools/helm/repo.go" | ||
"src/cmd/tools/helm/dependency_build.go" | ||
"src/cmd/tools/helm/dependency_update.go" | ||
"src/cmd/tools/helm/root.go" | ||
) | ||
|
||
BLACK='\033[0;30m' | ||
RED='\033[0;31m' | ||
RESET='\033[0m' | ||
|
||
# Function to check if a path is in the EXCLUDE_PATHS array | ||
is_excluded() { | ||
local path="$1" | ||
for exclude in "${EXCLUDE_PATHS[@]}"; do | ||
if [[ "$path" == "$exclude"* ]]; then | ||
return 0 # 0 means true/success in shell script | ||
fi | ||
done | ||
return 1 # 1 means false/failure in shell script | ||
} | ||
|
||
# Flag to track if any file meets the condition | ||
found=0 | ||
|
||
# Use process substitution to avoid subshell issue with the 'found' variable | ||
while IFS= read -r file; do | ||
if is_excluded "$file"; then | ||
echo -e "$BLACK$file$RESET" | ||
continue | ||
fi | ||
|
||
# Use `head` to grab the first two lines and compare them directly | ||
firstLine=$(head -n 1 "$file") | ||
secondLine=$(head -n 2 "$file" | tail -n 1) | ||
|
||
# Check if the lines do not match the specified strings | ||
if [[ "$firstLine" != "// SPDX-License-Identifier: Apache-2.0" || "$secondLine" != "// SPDX-FileCopyrightText: 2021-Present The Zarf Authors" ]]; then | ||
echo -e "$RED$file$RESET" | ||
found=1 | ||
fi | ||
done < <(find "$DIRECTORY" -type f -name "*.go") | ||
|
||
# If any file met the condition, exit with status 1 | ||
if [ "$found" -eq 1 ]; then | ||
exit 1 | ||
fi |
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
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,3 @@ | ||
# This is here so it can be used during certain Zarf commands | ||
# such as `internal gen-cli-docs` where we prefer an empty config | ||
# as opposed to the init package config at the base of the repo |
File renamed without changes.
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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.