diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -1,3 +1,8 @@ +# Makefile - Main build script for sbc-harness project +# +# Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> +# SPDX-Licence-Identifier: AGPL-3.0-or-later + linux.git = $(HOME)/src/github.com/torvalds/linux all: build @@ -54,6 +59,21 @@ lint: mypy --strict --scripts-are-modules $(sources_py) black --check $(sources_py) isort --check $(sources_py) + r=0; find $$(git ls-files -- $(foreach f,$(generate/files),:!$f) :!cmd/*/static/*) -maxdepth 0 -type f | while read -r filename; do \ + grep -q 'Copyright (C) 2024 Luke T. Shumaker' $$filename || \ + { echo "$$filename is missing a copyright statement"; r=1; continue; }; \ + dscname=$$(sed -n '1,3{ /^#!/d; /^<!--$$/d; /-\*- .* -\*-/d; s,[/*# ]*,,; s/ - .*//;p; q; }' $$filename); \ + filename_alt1=$$(echo "$$filename" | sed \ + -e 's,^cmd/,,' \ + -e 's,.*/include/,,' \ + -e 's,^lib9p/idl/,,' \ + -e 's/\.wip$$//'); \ + filename_alt2=$$(echo "$$filename_alt1" | sed \ + -e 's,^sbc_harness/,,' \ + -e 's,^srv9p/,,'); \ + [ "$$dscname" == "$$filename" ] || [ "$$dscname" == "$$filename_alt1" ] || [ "$$dscname" == "$$filename_alt2" ] || \ + { echo "$$filename self-identifies as $$dscname"; r=1; continue; }; \ + done; exit $$r format: black $(sources_py) isort $(sources_py) |