Skip to content

Commit

Permalink
🐛 Validate doc on pre-submit (#1235)
Browse files Browse the repository at this point in the history
* validate doc on pre-submit

* typo
  • Loading branch information
laurentsimon authored Nov 10, 2021
1 parent 929fd6e commit ae271b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $(PROTOC):

################################## make all ###################################
all: ## Runs build, test and verify
all-targets = update-dependencies build check-linter check-osv unit-test add-projects validate-projects tree-status
all-targets = update-dependencies build check-linter check-osv unit-test validate-docs add-projects validate-projects tree-status
.PHONY: all $(all-targets)
all: $(all-targets)

Expand Down Expand Up @@ -111,13 +111,15 @@ clients/branch.pb.go: clients/branch.proto | $(PROTOC)
protoc --go_out=../../../ clients/branch.proto

generate-docs: ## Generates docs
generate-docs: docs/checks.md
generate-docs: validate-docs docs/checks.md
docs/checks.md: docs/checks/internal/checks.yaml docs/checks/internal/*.go docs/checks/internal/generate/*.go
# Validating checks.yaml
go run ./docs/checks/internal/validate/main.go
# Generating checks.md
go run ./docs/checks/internal/generate/main.go docs/checks.md

validate-docs: docs/checks/internal/generate/main.go
# Validating checks.yaml
go run ./docs/checks/internal/validate/main.go

build-scorecard: ## Runs go build on repo
# Run go build and generate scorecard executable
CGO_ENABLED=0 go build -trimpath -a -tags netgo -ldflags '$(LDFLAGS)'
Expand Down
2 changes: 1 addition & 1 deletion docs/checks/internal/validate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var (
}
)

// Indentify the source file that declares each check.
// Identify the source file that declares each check.
func listCheckFiles() (map[string]string, error) {
checkFiles := make(map[string]string)
// Use regex to determine the file that contains the entry point.
Expand Down

0 comments on commit ae271b4

Please sign in to comment.