Skip to content

Commit

Permalink
Add an example of extension yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
eliemichel committed Dec 9, 2024
1 parent df5bdea commit 11eddf5
Show file tree
Hide file tree
Showing 5 changed files with 1,951 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gen/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func Comment(in string, mode CommentType, indent int, newline bool) string {
}

func ConstantCase(v string) string {
return strings.ToUpper(v)
return strings.Replace(strings.ToUpper(v), "-", "_", -1)
}

func PascalCase(s string) string {
Expand Down
1 change: 1 addition & 0 deletions tests/extension/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
doc
34 changes: 34 additions & 0 deletions tests/extension/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.PHONY: all all-help-message fix gen gen-check doc

# default target if you just type `make`
all: all-help-message fix gen doc

# help message before starting `make all`
all-help-message: help
@echo 'Running default targets: fix gen doc'

help:
@echo 'Targets are: all, help, fix, gen, gen-check, doc'

fix: webgpu.yml
go run ../../fix -yaml webgpu-sample-extension.yml

gen: ../../schema.json webgpu-sample-extension.yml
go run ../../gen -schema ../../schema.json -yaml webgpu-sample-extension.yml -header webgpu-sample-extension.h

gen-check: fix gen
@git diff --quiet -- webgpu-sample-extension.h || { \
echo "error: The re-generated header from yml doesn't match the checked-in header"; \
git diff -- webgpu-sample-extension.h; \
exit 1; \
}
@git diff --quiet -- webgpu-sample-extension.yml || { \
echo "error: Please re-run 'make fix' to format the yml"; \
git diff -- webgpu-sample-extension.yml; \
exit 1; \
}

doc: webgpu-sample-extension.h Doxyfile
doxygen Doxyfile
# Verify that no ` or :: made it through into the final docs
! grep -RE '`|>::' doc/generated/**/*.html
Loading

0 comments on commit 11eddf5

Please sign in to comment.