Skip to content

Commit

Permalink
chore(docs): added makefile target
Browse files Browse the repository at this point in the history
Signed-off-by: ivan katliarchuk <[email protected]>
  • Loading branch information
ivankatliarchuk committed Dec 31, 2024
1 parent fd150ef commit 956510a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,8 @@ release.prod: test
.PHONY: ko
ko:
scripts/install-ko.sh

# generate-documentation: Generate documentation (docs/flags.md)
.PHONE: generate-docs
generate-documentation:
go run internal/gen/main.go
2 changes: 1 addition & 1 deletion docs/flags.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Flags

<!-- THIS FILE MUST NOT BE EDITED BY HAND -->
<!-- ON NEW FLAG ADDED PLEASE RUN 'go run internal/gen/main.go' -->
<!-- ON NEW FLAG ADDED PLEASE RUN 'make generate-documentation' -->

| Flag | Description |
| :------ | :----------- |
Expand Down
2 changes: 1 addition & 1 deletion internal/gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (f *Flags) AddFlag(name, description string) {
const markdownTemplate = `# Flags
<!-- THIS FILE MUST NOT BE EDITED BY HAND -->
<!-- ON NEW FLAG ADDED PLEASE RUN 'go run internal/gen/main.go' -->
<!-- ON NEW FLAG ADDED PLEASE RUN 'make generate-documentation' -->
| Flag | Description |
| :------ | :----------- |
Expand Down
2 changes: 1 addition & 1 deletion internal/gen/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestFlagsMdUpToDate(t *testing.T) {
actual, err := flags.generateMarkdownTable()
assert.NoError(t, err)

assert.True(t, len(expected) == len(actual), "expected file '%s' to be up to date. execute 'go run internal/gen/main.g", filePath)
assert.True(t, len(expected) == len(actual), "expected file '%s' to be up to date. execute 'make generate-documentation", filePath)
}

func TestFlagsMdExtraFlagAdded(t *testing.T) {
Expand Down

0 comments on commit 956510a

Please sign in to comment.