diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-06-10 17:26:01 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-06-10 17:26:01 -0600 |
commit | 7146166ce00e1f6ad3a35d7e1e4bf778b74272e1 (patch) | |
tree | 61dddfb0735fe841a0e1c56ea331a360a2d2dad0 /build-aux/lint-src | |
parent | cd5768ef4bc36b33699539d9656f455bafb0de0c (diff) | |
parent | 6eafa9fd3a49289d34007a018b6d1fba8e4b7e24 (diff) |
Merge branch 'lukeshu/obj-meth'
Diffstat (limited to 'build-aux/lint-src')
-rwxr-xr-x | build-aux/lint-src | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/build-aux/lint-src b/build-aux/lint-src index 033340d..69b594a 100755 --- a/build-aux/lint-src +++ b/build-aux/lint-src @@ -13,7 +13,7 @@ err() { } get-dscname() { - if [[ $1 == */Documentation/* ]] && [[ "$(sed 1q -- "$1")" == 'NAME' ]]; then + if [[ $1 == */Documentation/* && "$(sed 1q -- "$1")" == 'NAME' ]]; then sed -n ' 2{ s,[/.],_,g; @@ -90,7 +90,7 @@ get-dscname() { # File body ############################################################ - if grep -n --color=auto "$(printf '\\S\t')" "$filename"; then + if grep -n --color=auto $'\\S\t' "$filename"; then err "$filename" 'uses tabs for alignment' fi done @@ -112,6 +112,16 @@ get-dscname() { grep -Fxq "#endif /* ${guard} */" "$filename"; }; then err "$filename" "does not have ${guard} guard" fi + if [[ $filename != libmisc/include/libmisc/obj.h ]] && + grep -Fn --color=auto -e LO_IMPLEMENTATION_C -e LO_IMPLEMENTATION_STATIC "$filename"; then + err "$filename" "contains LO_IMPLEMENTATION_C and/or LO_IMPLEMENTATION_STATIC" + fi + fi + if [[ $filename == *.c ]]; then + if [[ $filename != libmisc/tests/test_obj.c ]] && + grep -Fn --color=auto L_IMPLEMENTATION_H "$filename"; then + err "$filename" "contains LO_IMPLEMENTATION_H" + fi fi done ;; |