Skip to content

Commit

Permalink
Use the standardized hack dir vs .hooks (#1146)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-mccoy authored Dec 29, 2022
1 parent 8a36780 commit abf6a56
Show file tree
Hide file tree
Showing 26 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ repos:
hooks:
- id: generate-zarf-schema
name: Check for outdated Zarf schema
entry: ./.hooks/verify-zarf-schema.sh
entry: ./hack/verify-zarf-schema.sh
files: "src/types/types.go"
types: [go]
language: script
Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ main.go @jeff-mccoy @YrrepNoj @Racer159

# Privileged pipeline files
/.github/ @jeff-mccoy @YrrepNoj @Racer159
/.hooks/ @jeff-mccoy @YrrepNoj @Racer159
/hack/ @jeff-mccoy @YrrepNoj @Racer159
/.gitignore @jeff-mccoy @YrrepNoj @Racer159
/.golangci.yml @jeff-mccoy @YrrepNoj @Racer159
/.goreleaser.yml @jeff-mccoy @YrrepNoj @Racer159
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ ensure-ui-build-dir:

check-ui: ## Build the Zarf UI if needed
@ if [ ! -z "$(shell command -v shasum)" ]; then\
if test "$(shell ./.hooks/print-ui-diff.sh | shasum)" != "$(shell cat build/ui/git-info.txt | shasum)" ; then\
if test "$(shell ./hack/print-ui-diff.sh | shasum)" != "$(shell cat build/ui/git-info.txt | shasum)" ; then\
$(MAKE) build-ui;\
./.hooks/print-ui-diff.sh > build/ui/git-info.txt;\
./hack/print-ui-diff.sh > build/ui/git-info.txt;\
fi;\
else\
$(MAKE) build-ui;\
Expand Down Expand Up @@ -94,8 +94,8 @@ build-cli-linux: build-cli-linux-amd build-cli-linux-arm ## Build the Zarf CLI f
build-cli: build-cli-linux-amd build-cli-linux-arm build-cli-mac-intel build-cli-mac-apple build-cli-windows-amd build-cli-windows-arm ## Build the CLI

docs-and-schema: ensure-ui-build-dir ## Generate the Zarf Documentation and Schema
ZARF_CONFIG=.hooks/empty-config.toml go run main.go internal generate-cli-docs
ZARF_CONFIG=.hooks/empty-config.toml .hooks/create-zarf-schema.sh
ZARF_CONFIG=hack/empty-config.toml go run main.go internal generate-cli-docs
ZARF_CONFIG=hack/empty-config.toml hack/create-zarf-schema.sh

dev: ensure-ui-build-dir ## Start a Dev Server for the UI
go mod download
Expand Down Expand Up @@ -171,13 +171,13 @@ test-built-ui: ## Run the Zarf UI E2E tests (requires `make build-ui` first)

test-docs-and-schema:
$(MAKE) docs-and-schema
.hooks/check-zarf-docs-and-schema.sh
hack/check-zarf-docs-and-schema.sh

test-cves: ensure-ui-build-dir
go run main.go tools sbom packages . -o json | grype --fail-on low

cve-report: ensure-ui-build-dir
go run main.go tools sbom packages . -o json | grype -o template -t .hooks/grype.tmpl > build/zarf-known-cves.csv
go run main.go tools sbom packages . -o json | grype -o template -t hack/grype.tmpl > build/zarf-known-cves.csv

lint-go:
revive -config revive.toml -exclude src/cmd/viper.go -formatter stylish ./src/...
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/spf13/viper v1.14.0
github.com/stretchr/testify v1.8.1
golang.org/x/crypto v0.4.0
helm.sh/helm/v3 v3.10.2
helm.sh/helm/v3 v3.10.3
k8s.io/api v0.25.5 // not updating due to breaking api change in .26
k8s.io/apimachinery v0.25.5
k8s.io/client-go v0.25.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3014,8 +3014,8 @@ gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8=
gotest.tools/v3 v3.1.0 h1:rVV8Tcg/8jHUkPUorwjaMTtemIMVXfIPKiOqnhEhakk=
helm.sh/helm/v3 v3.10.2 h1:2PmN9NgmqTn5pswfL5Kh2LxOKjkmh0hxKLe6/J0yUY4=
helm.sh/helm/v3 v3.10.2/go.mod h1:CXOcs02AYvrlPMWARNYNRgf2rNP7gLJQsi/Ubd4EDrI=
helm.sh/helm/v3 v3.10.3 h1:wL7IUZ7Zyukm5Kz0OUmIFZgKHuAgByCrUcJBtY0kDyw=
helm.sh/helm/v3 v3.10.3/go.mod h1:CXOcs02AYvrlPMWARNYNRgf2rNP7gLJQsi/Ubd4EDrI=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ go run main.go internal config-schema > zarf.schema.json
go run main.go internal api-schema | npx quicktype -s schema -o src/ui/lib/api-types.ts

# Create docs from the zarf.yaml JSON schema
docker run -v $(pwd):/app -w /app --rm python:3.8-alpine /bin/sh -c "pip install json-schema-for-humans && generate-schema-doc --config-file .hooks/jsfh-config.json zarf.schema.json docs/4-user-guide/3-zarf-schema.md"
docker run -v $(pwd):/app -w /app --rm python:3.8-alpine /bin/sh -c "pip install json-schema-for-humans && generate-schema-doc --config-file hack/jsfh-config.json zarf.schema.json docs/4-user-guide/3-zarf-schema.md"
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion .hooks/jsfh-config.json → hack/jsfh-config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"custom_template_path": ".hooks/zarf-jsfh-template/base.md",
"custom_template_path": "hack/zarf-jsfh-template/base.md",
"template_md_options": { "badge_as_image": true, "show_heading_numbers": false },
"show_toc": false,
"show_breadcrumbs": false,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": ".hooks/ui-dev.sh",
"dev": "hack/ui-dev.sh",
"build": "vite build",
"test": "playwright test -x --reporter github,html",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
Expand Down

0 comments on commit abf6a56

Please sign in to comment.