Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# make Generate index.html from index.bs
# make lint Check index.bs for warnings and errors
# make watch Regenerate index.html after any change to index.bs

LOCAL_BIKESHED := $(shell command -v bikeshed 2> /dev/null)

index.html: index.bs
ifndef LOCAL_BIKESHED
curl https://api.csswg.org/bikeshed/ -f -F file=@$< >$@;
else
bikeshed spec
endif

ifdef LOCAL_BIKESHED
.PHONY: lint watch

lint: index.bs
bikeshed --print=plain --dry-run --force spec --line-numbers $<
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--force is die on nothing, right? We probably don't want that. What does spec-prod use by default @tabatkins?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't actually know. I assume it always succeeds, aka --force. But for a lint command I definitely think you should use a more restrictive value, that's kinda the point of linting.

Btw --line-numbers no longer does anything, I need to remove that flag. Bikeshed always generates good line numbers now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistent behaviour between local builds and https://github.com/webmachinelearning/webmcp/blob/main/.github/workflows/auto-publish.yml#L17 we should die on warnings i.e. everything.


watch: index.bs
@echo 'Browse to file://${PWD}/index.html'
bikeshed --print=plain watch $<
endif # LOCAL_BIKESHED