From 74e15568de208c0d734e816e30eed8d95c3d08e0 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Sat, 31 May 2025 05:57:24 -0600 Subject: make lint: Consolidate the lint scripts --- build-aux/lint-src | 142 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100755 build-aux/lint-src (limited to 'build-aux/lint-src') diff --git a/build-aux/lint-src b/build-aux/lint-src new file mode 100755 index 0000000..4207bad --- /dev/null +++ b/build-aux/lint-src @@ -0,0 +1,142 @@ +#!/usr/bin/env bash +# build-aux/lint-src - Lint checks for source files +# +# Copyright (C) 2024-2025 Luke T. Shumaker +# SPDX-License-Identifier: AGPL-3.0-or-later + +RED=$(tput setaf 1) +RESET=$(tput sgr0) + +err() { + printf "${RED}%s${RESET}: %s\n" "$1" "$2" >&2 + r=1 +} + +get-dscname() { + if [[ $1 == */Documentation/* ]] && [[ "$(sed 1q -- "$1")" == 'NAME' ]]; then + sed -n ' + 2{ + s,[/.],_,g; + s,^\s*_,Documentation/,; + s,$,.txt,; + + p; + q; + } + ' -- "$1" + else + sed -n ' + 1,3{ + /^\#!/d; + /^