summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.editorconfig4
-rwxr-xr-xbuild-aux/lint-generic15
-rwxr-xr-xbuild-aux/valgrind2
-rwxr-xr-xlib9p/core.gen2
-rwxr-xr-xlib9p/idl/2010-9P2000.L.9p.gen2
5 files changed, 16 insertions, 9 deletions
diff --git a/.editorconfig b/.editorconfig
index d2b92ed..69c649d 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -45,10 +45,10 @@ _mode = gitignore
# By specific filename (non-lib9p) #############################################
-[{build-aux/lint-{generic,unknown},build-aux/embed-sources.h.gen}]
+[{build-aux/lint-unknown,build-aux/embed-sources.h.gen}]
_mode = sh
-[{build-aux/lint-{bin,h},build-aux/get-dscname,build-aux/valgrind,libusb/include/libusb/tusb_helpers.h.gen}]
+[{build-aux/lint-{bin,h,generic},build-aux/get-dscname,build-aux/valgrind,libusb/include/libusb/tusb_helpers.h.gen}]
_mode = bash
[build-aux/stack.c.gen]
diff --git a/build-aux/lint-generic b/build-aux/lint-generic
index d982527..9bf88dd 100755
--- a/build-aux/lint-generic
+++ b/build-aux/lint-generic
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
# build-aux/lint-generic - Non-language-specific lint checks
#
# Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com>
@@ -16,12 +16,19 @@ r=0
for filename in "$@"; do
# File header ##########################################################
- shebang="$(sed -n '1{/^#!/{/^#!\/hint\//q; p;};}' "$filename")"
- if [ -x "$filename" ] && [ -z "$shebang" ]; then
+ shebang="$(sed -n '1{/^#!/p;}' "$filename")"
+ if [[ -x $filename && (-z $shebang || $shebang == '#!/hint/'*) ]]; then
err "$filename" 'is executable but does not have a shebang'
- elif [ -n "$shebang" ] && ! [ -x "$filename" ]; then
+ elif [[ (-n $shebang && $shebang != '#!/hint/'*) && ! -x $filename ]]; then
err "$filename" 'has a shebang but is not executable'
fi
+ case "$shebang" in
+ '') : ;;
+ '#!/bin/sh') : ;;
+ '#!/usr/bin/env bash') : ;;
+ '#!/usr/bin/env python3') : ;;
+ *) err "$filename" 'has an unrecognized shebang' ;;
+ esac
if ! grep -E -q 'Copyright \(C\) 202[4-9]((-|, )202[5-9])* Luke T. Shumaker' "$filename"; then
err "$filename" 'is missing a copyright statement'
diff --git a/build-aux/valgrind b/build-aux/valgrind
index 7ad2712..8fe7c6e 100755
--- a/build-aux/valgrind
+++ b/build-aux/valgrind
@@ -1,4 +1,4 @@
-#!/bin/env bash
+#!/usr/bin/env bash
# build-aux/valgrind - Wrapper around valgrind to keep flags consistent
#
# Copyright (C) 2025 Luke T. Shumaker <lukeshu@lukeshu.com>
diff --git a/lib9p/core.gen b/lib9p/core.gen
index b30ec31..24f66de 100755
--- a/lib9p/core.gen
+++ b/lib9p/core.gen
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# lib9p/core.gen - Generate C marshalers/unmarshalers for .9p files
# defining 9P protocol variants.
#
diff --git a/lib9p/idl/2010-9P2000.L.9p.gen b/lib9p/idl/2010-9P2000.L.9p.gen
index cb32585..f0bdb6b 100755
--- a/lib9p/idl/2010-9P2000.L.9p.gen
+++ b/lib9p/idl/2010-9P2000.L.9p.gen
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# lib9p/idl/2010-9P2000.L.9p.gen - Generate definitions of 9P2000.L messages
import sys