Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Add excalidraw lint check #4

@russellb

Description

@russellb

Diagrams generated with excalidraw and exported as a png have metadata embedded in the image file that allow them to be loaded back into the tool for further editing. The metadata is included by default, but there's an option to turn it off. To help ensure we don't accidentally lose the metadata in some iteration of a diagram, a lint check can be added that runs in a github action to ensure the data is present.

For reference, an equivalent check implemented as a Makefile target:

.PHONY: png-lint
png-lint: dist/.png-lint ## Lint the png files from excalidraw

dist/.png-lint: $(shell find . -iname '*.png') | dist
	$(ECHO_PREFIX) printf "  %-12s ./...\n" "[PNG LINT]"
	$(CMD_PREFIX) for file in $^; do \
		if echo "$$file" | grep -q --basic-regexp --file=.excalidraw-ignore; then continue ; fi ; \
		if ! grep -q "excalidraw+json" $$file; then \
			echo "$$file was not exported from excalidraw with 'Embed Scene' enabled." ; \
			echo "If this is not an excalidraw file, add it to .excalidraw-ignore" ; \
			exit 1 ; \
		fi \
	done
	$(CMD_PREFIX) touch $@

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions