Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck
@ 2023-05-19 19:57 classabbyamp
  2023-05-19 20:16 ` [PR PATCH] [Updated] lint templates with shellcheck classabbyamp
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: classabbyamp @ 2023-05-19 19:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 518 bytes --]

There is a new pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

common/scripts/template_shellcheck_shim: create shim for xshellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**



A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 7144 bytes --]

From fbde9bf7dfbaf83cc03a6ebe9227dd65b6be425f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH] common/scripts/template_shellcheck_shim: create shim for
 xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 000000000000..48932d19dbca
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Updated] lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
@ 2023-05-19 20:16 ` classabbyamp
  2023-05-19 20:23 ` classabbyamp
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-05-19 20:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4300 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

lint templates with shellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   729 | SC2164 | https://www.shellcheck.net/wiki/SC2164 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |


A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 11595 bytes --]

From fbde9bf7dfbaf83cc03a6ebe9227dd65b6be425f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH 1/5] common/scripts/template_shellcheck_shim: create shim for
 xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 000000000000..48932d19dbca
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

From 21810b1f1fad5557fcecb89c9542a6db22bc2492 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:14 -0400
Subject: [PATCH 2/5] .github/workflows/build.yaml: install shellcheck for
 xlint

---
 .github/workflows/build.yaml | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..de1124202f1c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,16 +20,27 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        XLINT: '1'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          xbps-install -y shellcheck
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 

From c3c23785a1deef7d046fba4222289b2eae1e16d7 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:57 -0400
Subject: [PATCH 3/5] common/travis/xlint.sh: run xshellcheck

---
 common/travis/xlint.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef1733..bc12aedd4f8e 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -12,6 +12,7 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

From 0d6e18e8b1557fd93969b2c0445a5ee6d6c0cf9f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:15:17 -0400
Subject: [PATCH 4/5] TEMP: switch xtools fork/branch for xshellcheck

---
 common/travis/fetch-xtools.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 0dd9e6c532c0..6795b1afc313 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -4,7 +4,7 @@
 
 TAR=tar
 command -v bsdtar >/dev/null && TAR=bsdtar
-URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+URL="https://github.com/classabbyamp/xtools/archive/xshellcheck.tar.gz"
 FILE="xtools.tar.gz"
 
 mkdir -p /tmp/bin

From 6ec7d1db227028994c9738a49014e1c02f6d3912 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:16:23 -0400
Subject: [PATCH 5/5] TEMP: something to shellcheck

---
 srcpkgs/chezmoi/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index b7dca806e5f2..e1c63ec6a247 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -14,6 +14,7 @@ homepage="https://chezmoi.io/"
 changelog="https://github.com/twpayne/chezmoi/releases"
 distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz"
 checksum=49f624ff55e1fb7165e9bca98aead8d6c49c6ff73926973c6ba6347f0ee17eba
+bhasdfhsdf=
 
 pre_build() {
 	local _date
@@ -32,4 +33,5 @@ post_install() {
 	vcompletion completions/chezmoi-completion.bash bash
 	vcompletion completions/chezmoi.fish fish
 	vcompletion completions/chezmoi.zsh zsh
+	: $adfsdhfajhsdfjasdf
 }

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Updated] lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
  2023-05-19 20:16 ` [PR PATCH] [Updated] lint templates with shellcheck classabbyamp
@ 2023-05-19 20:23 ` classabbyamp
  2023-05-19 20:26 ` classabbyamp
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-05-19 20:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4300 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

lint templates with shellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   729 | SC2164 | https://www.shellcheck.net/wiki/SC2164 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |


A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 12755 bytes --]

From fbde9bf7dfbaf83cc03a6ebe9227dd65b6be425f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH 1/6] common/scripts/template_shellcheck_shim: create shim for
 xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 000000000000..48932d19dbca
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

From 21810b1f1fad5557fcecb89c9542a6db22bc2492 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:14 -0400
Subject: [PATCH 2/6] .github/workflows/build.yaml: install shellcheck for
 xlint

---
 .github/workflows/build.yaml | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..de1124202f1c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,16 +20,27 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        XLINT: '1'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          xbps-install -y shellcheck
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 

From c3c23785a1deef7d046fba4222289b2eae1e16d7 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:57 -0400
Subject: [PATCH 3/6] common/travis/xlint.sh: run xshellcheck

---
 common/travis/xlint.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef1733..bc12aedd4f8e 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -12,6 +12,7 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

From 0d6e18e8b1557fd93969b2c0445a5ee6d6c0cf9f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:15:17 -0400
Subject: [PATCH 4/6] TEMP: switch xtools fork/branch for xshellcheck

---
 common/travis/fetch-xtools.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 0dd9e6c532c0..6795b1afc313 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -4,7 +4,7 @@
 
 TAR=tar
 command -v bsdtar >/dev/null && TAR=bsdtar
-URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+URL="https://github.com/classabbyamp/xtools/archive/xshellcheck.tar.gz"
 FILE="xtools.tar.gz"
 
 mkdir -p /tmp/bin

From 6ec7d1db227028994c9738a49014e1c02f6d3912 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:16:23 -0400
Subject: [PATCH 5/6] TEMP: something to shellcheck

---
 srcpkgs/chezmoi/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index b7dca806e5f2..e1c63ec6a247 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -14,6 +14,7 @@ homepage="https://chezmoi.io/"
 changelog="https://github.com/twpayne/chezmoi/releases"
 distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz"
 checksum=49f624ff55e1fb7165e9bca98aead8d6c49c6ff73926973c6ba6347f0ee17eba
+bhasdfhsdf=
 
 pre_build() {
 	local _date
@@ -32,4 +33,5 @@ post_install() {
 	vcompletion completions/chezmoi-completion.bash bash
 	vcompletion completions/chezmoi.fish fish
 	vcompletion completions/chezmoi.zsh zsh
+	: $adfsdhfajhsdfjasdf
 }

From 17b6a1882d30a3af9c3c8e96ea8b7c12e93e1aa9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:23:21 -0400
Subject: [PATCH 6/6] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index de1124202f1c..9e252778b667 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,12 +37,17 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck
+          xbps-install -y shellcheck grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/xlint.sh"
+          )
 
   # Build changed packages.
   build:

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Updated] lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
  2023-05-19 20:16 ` [PR PATCH] [Updated] lint templates with shellcheck classabbyamp
  2023-05-19 20:23 ` classabbyamp
@ 2023-05-19 20:26 ` classabbyamp
  2023-05-19 20:28 ` classabbyamp
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-05-19 20:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4300 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

lint templates with shellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   729 | SC2164 | https://www.shellcheck.net/wiki/SC2164 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |


A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 13668 bytes --]

From fbde9bf7dfbaf83cc03a6ebe9227dd65b6be425f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH 1/7] common/scripts/template_shellcheck_shim: create shim for
 xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 000000000000..48932d19dbca
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

From 21810b1f1fad5557fcecb89c9542a6db22bc2492 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:14 -0400
Subject: [PATCH 2/7] .github/workflows/build.yaml: install shellcheck for
 xlint

---
 .github/workflows/build.yaml | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..de1124202f1c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,16 +20,27 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        XLINT: '1'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          xbps-install -y shellcheck
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 

From c3c23785a1deef7d046fba4222289b2eae1e16d7 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:57 -0400
Subject: [PATCH 3/7] common/travis/xlint.sh: run xshellcheck

---
 common/travis/xlint.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef1733..bc12aedd4f8e 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -12,6 +12,7 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

From 0d6e18e8b1557fd93969b2c0445a5ee6d6c0cf9f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:15:17 -0400
Subject: [PATCH 4/7] TEMP: switch xtools fork/branch for xshellcheck

---
 common/travis/fetch-xtools.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 0dd9e6c532c0..6795b1afc313 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -4,7 +4,7 @@
 
 TAR=tar
 command -v bsdtar >/dev/null && TAR=bsdtar
-URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+URL="https://github.com/classabbyamp/xtools/archive/xshellcheck.tar.gz"
 FILE="xtools.tar.gz"
 
 mkdir -p /tmp/bin

From 6ec7d1db227028994c9738a49014e1c02f6d3912 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:16:23 -0400
Subject: [PATCH 5/7] TEMP: something to shellcheck

---
 srcpkgs/chezmoi/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index b7dca806e5f2..e1c63ec6a247 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -14,6 +14,7 @@ homepage="https://chezmoi.io/"
 changelog="https://github.com/twpayne/chezmoi/releases"
 distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz"
 checksum=49f624ff55e1fb7165e9bca98aead8d6c49c6ff73926973c6ba6347f0ee17eba
+bhasdfhsdf=
 
 pre_build() {
 	local _date
@@ -32,4 +33,5 @@ post_install() {
 	vcompletion completions/chezmoi-completion.bash bash
 	vcompletion completions/chezmoi.fish fish
 	vcompletion completions/chezmoi.zsh zsh
+	: $adfsdhfajhsdfjasdf
 }

From 17b6a1882d30a3af9c3c8e96ea8b7c12e93e1aa9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:23:21 -0400
Subject: [PATCH 6/7] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index de1124202f1c..9e252778b667 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,12 +37,17 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck
+          xbps-install -y shellcheck grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/xlint.sh"
+          )
 
   # Build changed packages.
   build:

From 73e569819accb8058658b573d51fa2988a929c55 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:26:12 -0400
Subject: [PATCH 7/7] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 9e252778b667..4373f36e8c1b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -44,9 +44,13 @@ jobs:
       - run: common/travis/fetch-xtools.sh
       - run: |
           (
-          here="$(pwd)"
-          cd /
-          "$here/common/travis/xlint.sh"
+          echo "$(pwd)"
+          ls
+          echo "/"
+          ls
+          # here="$(pwd)"
+          # cd /
+          # "$here/common/travis/xlint.sh"
           )
 
   # Build changed packages.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Updated] lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
                   ` (2 preceding siblings ...)
  2023-05-19 20:26 ` classabbyamp
@ 2023-05-19 20:28 ` classabbyamp
  2023-05-19 20:33 ` classabbyamp
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-05-19 20:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4300 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

lint templates with shellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   729 | SC2164 | https://www.shellcheck.net/wiki/SC2164 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |


A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 14385 bytes --]

From fbde9bf7dfbaf83cc03a6ebe9227dd65b6be425f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH 1/8] common/scripts/template_shellcheck_shim: create shim for
 xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 000000000000..48932d19dbca
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

From 21810b1f1fad5557fcecb89c9542a6db22bc2492 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:14 -0400
Subject: [PATCH 2/8] .github/workflows/build.yaml: install shellcheck for
 xlint

---
 .github/workflows/build.yaml | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..de1124202f1c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,16 +20,27 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        XLINT: '1'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          xbps-install -y shellcheck
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 

From c3c23785a1deef7d046fba4222289b2eae1e16d7 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:57 -0400
Subject: [PATCH 3/8] common/travis/xlint.sh: run xshellcheck

---
 common/travis/xlint.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef1733..bc12aedd4f8e 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -12,6 +12,7 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

From 0d6e18e8b1557fd93969b2c0445a5ee6d6c0cf9f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:15:17 -0400
Subject: [PATCH 4/8] TEMP: switch xtools fork/branch for xshellcheck

---
 common/travis/fetch-xtools.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 0dd9e6c532c0..6795b1afc313 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -4,7 +4,7 @@
 
 TAR=tar
 command -v bsdtar >/dev/null && TAR=bsdtar
-URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+URL="https://github.com/classabbyamp/xtools/archive/xshellcheck.tar.gz"
 FILE="xtools.tar.gz"
 
 mkdir -p /tmp/bin

From 6ec7d1db227028994c9738a49014e1c02f6d3912 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:16:23 -0400
Subject: [PATCH 5/8] TEMP: something to shellcheck

---
 srcpkgs/chezmoi/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index b7dca806e5f2..e1c63ec6a247 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -14,6 +14,7 @@ homepage="https://chezmoi.io/"
 changelog="https://github.com/twpayne/chezmoi/releases"
 distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz"
 checksum=49f624ff55e1fb7165e9bca98aead8d6c49c6ff73926973c6ba6347f0ee17eba
+bhasdfhsdf=
 
 pre_build() {
 	local _date
@@ -32,4 +33,5 @@ post_install() {
 	vcompletion completions/chezmoi-completion.bash bash
 	vcompletion completions/chezmoi.fish fish
 	vcompletion completions/chezmoi.zsh zsh
+	: $adfsdhfajhsdfjasdf
 }

From 17b6a1882d30a3af9c3c8e96ea8b7c12e93e1aa9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:23:21 -0400
Subject: [PATCH 6/8] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index de1124202f1c..9e252778b667 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,12 +37,17 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck
+          xbps-install -y shellcheck grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/xlint.sh"
+          )
 
   # Build changed packages.
   build:

From 73e569819accb8058658b573d51fa2988a929c55 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:26:12 -0400
Subject: [PATCH 7/8] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 9e252778b667..4373f36e8c1b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -44,9 +44,13 @@ jobs:
       - run: common/travis/fetch-xtools.sh
       - run: |
           (
-          here="$(pwd)"
-          cd /
-          "$here/common/travis/xlint.sh"
+          echo "$(pwd)"
+          ls
+          echo "/"
+          ls
+          # here="$(pwd)"
+          # cd /
+          # "$here/common/travis/xlint.sh"
           )
 
   # Build changed packages.

From 9d1b4af650ad8a24e15fad85849effb22767f052 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:27:43 -0400
Subject: [PATCH 8/8] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4373f36e8c1b..efad2dbdb9a7 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,7 +47,7 @@ jobs:
           echo "$(pwd)"
           ls
           echo "/"
-          ls
+          ls /
           # here="$(pwd)"
           # cd /
           # "$here/common/travis/xlint.sh"

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Updated] lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
                   ` (3 preceding siblings ...)
  2023-05-19 20:28 ` classabbyamp
@ 2023-05-19 20:33 ` classabbyamp
  2023-05-19 20:35 ` classabbyamp
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-05-19 20:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4300 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

lint templates with shellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   729 | SC2164 | https://www.shellcheck.net/wiki/SC2164 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |


A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 15950 bytes --]

From fbde9bf7dfbaf83cc03a6ebe9227dd65b6be425f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH 1/9] common/scripts/template_shellcheck_shim: create shim for
 xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 000000000000..48932d19dbca
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

From 21810b1f1fad5557fcecb89c9542a6db22bc2492 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:14 -0400
Subject: [PATCH 2/9] .github/workflows/build.yaml: install shellcheck for
 xlint

---
 .github/workflows/build.yaml | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..de1124202f1c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,16 +20,27 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        XLINT: '1'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          xbps-install -y shellcheck
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 

From c3c23785a1deef7d046fba4222289b2eae1e16d7 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:57 -0400
Subject: [PATCH 3/9] common/travis/xlint.sh: run xshellcheck

---
 common/travis/xlint.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef1733..bc12aedd4f8e 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -12,6 +12,7 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

From 0d6e18e8b1557fd93969b2c0445a5ee6d6c0cf9f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:15:17 -0400
Subject: [PATCH 4/9] TEMP: switch xtools fork/branch for xshellcheck

---
 common/travis/fetch-xtools.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 0dd9e6c532c0..6795b1afc313 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -4,7 +4,7 @@
 
 TAR=tar
 command -v bsdtar >/dev/null && TAR=bsdtar
-URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+URL="https://github.com/classabbyamp/xtools/archive/xshellcheck.tar.gz"
 FILE="xtools.tar.gz"
 
 mkdir -p /tmp/bin

From 6ec7d1db227028994c9738a49014e1c02f6d3912 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:16:23 -0400
Subject: [PATCH 5/9] TEMP: something to shellcheck

---
 srcpkgs/chezmoi/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index b7dca806e5f2..e1c63ec6a247 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -14,6 +14,7 @@ homepage="https://chezmoi.io/"
 changelog="https://github.com/twpayne/chezmoi/releases"
 distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz"
 checksum=49f624ff55e1fb7165e9bca98aead8d6c49c6ff73926973c6ba6347f0ee17eba
+bhasdfhsdf=
 
 pre_build() {
 	local _date
@@ -32,4 +33,5 @@ post_install() {
 	vcompletion completions/chezmoi-completion.bash bash
 	vcompletion completions/chezmoi.fish fish
 	vcompletion completions/chezmoi.zsh zsh
+	: $adfsdhfajhsdfjasdf
 }

From 17b6a1882d30a3af9c3c8e96ea8b7c12e93e1aa9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:23:21 -0400
Subject: [PATCH 6/9] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index de1124202f1c..9e252778b667 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,12 +37,17 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck
+          xbps-install -y shellcheck grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/xlint.sh"
+          )
 
   # Build changed packages.
   build:

From 73e569819accb8058658b573d51fa2988a929c55 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:26:12 -0400
Subject: [PATCH 7/9] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 9e252778b667..4373f36e8c1b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -44,9 +44,13 @@ jobs:
       - run: common/travis/fetch-xtools.sh
       - run: |
           (
-          here="$(pwd)"
-          cd /
-          "$here/common/travis/xlint.sh"
+          echo "$(pwd)"
+          ls
+          echo "/"
+          ls
+          # here="$(pwd)"
+          # cd /
+          # "$here/common/travis/xlint.sh"
           )
 
   # Build changed packages.

From 9d1b4af650ad8a24e15fad85849effb22767f052 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:27:43 -0400
Subject: [PATCH 8/9] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4373f36e8c1b..efad2dbdb9a7 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,7 +47,7 @@ jobs:
           echo "$(pwd)"
           ls
           echo "/"
-          ls
+          ls /
           # here="$(pwd)"
           # cd /
           # "$here/common/travis/xlint.sh"

From aa4dec243c0fa05e30fb539e3531a7d5d590706f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:33:14 -0400
Subject: [PATCH 9/9] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index efad2dbdb9a7..afb405efe622 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -24,7 +24,6 @@ jobs:
       image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-        XLINT: '1'
         LICENSE_LIST: common/travis/license.lst
 
     steps:
@@ -37,21 +36,12 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck grep
+          xbps-install -y shellcheck grep git awk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: |
-          (
-          echo "$(pwd)"
-          ls
-          echo "/"
-          ls /
-          # here="$(pwd)"
-          # cd /
-          # "$here/common/travis/xlint.sh"
-          )
+      - run: common/travis/xlint.sh
 
   # Build changed packages.
   build:

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Updated] lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
                   ` (4 preceding siblings ...)
  2023-05-19 20:33 ` classabbyamp
@ 2023-05-19 20:35 ` classabbyamp
  2023-05-19 20:37 ` classabbyamp
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-05-19 20:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4300 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

lint templates with shellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   729 | SC2164 | https://www.shellcheck.net/wiki/SC2164 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |


A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 16919 bytes --]

From fbde9bf7dfbaf83cc03a6ebe9227dd65b6be425f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH 01/10] common/scripts/template_shellcheck_shim: create shim
 for xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 000000000000..48932d19dbca
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

From 21810b1f1fad5557fcecb89c9542a6db22bc2492 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:14 -0400
Subject: [PATCH 02/10] .github/workflows/build.yaml: install shellcheck for
 xlint

---
 .github/workflows/build.yaml | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..de1124202f1c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,16 +20,27 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        XLINT: '1'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          xbps-install -y shellcheck
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 

From c3c23785a1deef7d046fba4222289b2eae1e16d7 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:57 -0400
Subject: [PATCH 03/10] common/travis/xlint.sh: run xshellcheck

---
 common/travis/xlint.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef1733..bc12aedd4f8e 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -12,6 +12,7 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

From 0d6e18e8b1557fd93969b2c0445a5ee6d6c0cf9f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:15:17 -0400
Subject: [PATCH 04/10] TEMP: switch xtools fork/branch for xshellcheck

---
 common/travis/fetch-xtools.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 0dd9e6c532c0..6795b1afc313 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -4,7 +4,7 @@
 
 TAR=tar
 command -v bsdtar >/dev/null && TAR=bsdtar
-URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+URL="https://github.com/classabbyamp/xtools/archive/xshellcheck.tar.gz"
 FILE="xtools.tar.gz"
 
 mkdir -p /tmp/bin

From 6ec7d1db227028994c9738a49014e1c02f6d3912 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:16:23 -0400
Subject: [PATCH 05/10] TEMP: something to shellcheck

---
 srcpkgs/chezmoi/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index b7dca806e5f2..e1c63ec6a247 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -14,6 +14,7 @@ homepage="https://chezmoi.io/"
 changelog="https://github.com/twpayne/chezmoi/releases"
 distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz"
 checksum=49f624ff55e1fb7165e9bca98aead8d6c49c6ff73926973c6ba6347f0ee17eba
+bhasdfhsdf=
 
 pre_build() {
 	local _date
@@ -32,4 +33,5 @@ post_install() {
 	vcompletion completions/chezmoi-completion.bash bash
 	vcompletion completions/chezmoi.fish fish
 	vcompletion completions/chezmoi.zsh zsh
+	: $adfsdhfajhsdfjasdf
 }

From 17b6a1882d30a3af9c3c8e96ea8b7c12e93e1aa9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:23:21 -0400
Subject: [PATCH 06/10] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index de1124202f1c..9e252778b667 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,12 +37,17 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck
+          xbps-install -y shellcheck grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/xlint.sh"
+          )
 
   # Build changed packages.
   build:

From 73e569819accb8058658b573d51fa2988a929c55 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:26:12 -0400
Subject: [PATCH 07/10] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 9e252778b667..4373f36e8c1b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -44,9 +44,13 @@ jobs:
       - run: common/travis/fetch-xtools.sh
       - run: |
           (
-          here="$(pwd)"
-          cd /
-          "$here/common/travis/xlint.sh"
+          echo "$(pwd)"
+          ls
+          echo "/"
+          ls
+          # here="$(pwd)"
+          # cd /
+          # "$here/common/travis/xlint.sh"
           )
 
   # Build changed packages.

From 9d1b4af650ad8a24e15fad85849effb22767f052 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:27:43 -0400
Subject: [PATCH 08/10] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4373f36e8c1b..efad2dbdb9a7 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,7 +47,7 @@ jobs:
           echo "$(pwd)"
           ls
           echo "/"
-          ls
+          ls /
           # here="$(pwd)"
           # cd /
           # "$here/common/travis/xlint.sh"

From aa4dec243c0fa05e30fb539e3531a7d5d590706f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:33:14 -0400
Subject: [PATCH 09/10] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index efad2dbdb9a7..afb405efe622 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -24,7 +24,6 @@ jobs:
       image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-        XLINT: '1'
         LICENSE_LIST: common/travis/license.lst
 
     steps:
@@ -37,21 +36,12 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck grep
+          xbps-install -y shellcheck grep git awk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: |
-          (
-          echo "$(pwd)"
-          ls
-          echo "/"
-          ls /
-          # here="$(pwd)"
-          # cd /
-          # "$here/common/travis/xlint.sh"
-          )
+      - run: common/travis/xlint.sh
 
   # Build changed packages.
   build:

From f22797c6dcb8ff9f58703014c6337a81957069b9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:34:56 -0400
Subject: [PATCH 10/10] XLINT no longer needed

---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..46072e9f81ea 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index bc12aedd4f8e..b9f3333ccef3 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Updated] lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
                   ` (5 preceding siblings ...)
  2023-05-19 20:35 ` classabbyamp
@ 2023-05-19 20:37 ` classabbyamp
  2023-05-19 21:53 ` classabbyamp
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-05-19 20:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4300 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

lint templates with shellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   729 | SC2164 | https://www.shellcheck.net/wiki/SC2164 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |


A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 17690 bytes --]

From fbde9bf7dfbaf83cc03a6ebe9227dd65b6be425f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH 01/11] common/scripts/template_shellcheck_shim: create shim
 for xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 000000000000..48932d19dbca
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

From 21810b1f1fad5557fcecb89c9542a6db22bc2492 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:14 -0400
Subject: [PATCH 02/11] .github/workflows/build.yaml: install shellcheck for
 xlint

---
 .github/workflows/build.yaml | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..de1124202f1c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,16 +20,27 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        XLINT: '1'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          xbps-install -y shellcheck
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 

From c3c23785a1deef7d046fba4222289b2eae1e16d7 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:57 -0400
Subject: [PATCH 03/11] common/travis/xlint.sh: run xshellcheck

---
 common/travis/xlint.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef1733..bc12aedd4f8e 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -12,6 +12,7 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

From 0d6e18e8b1557fd93969b2c0445a5ee6d6c0cf9f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:15:17 -0400
Subject: [PATCH 04/11] TEMP: switch xtools fork/branch for xshellcheck

---
 common/travis/fetch-xtools.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 0dd9e6c532c0..6795b1afc313 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -4,7 +4,7 @@
 
 TAR=tar
 command -v bsdtar >/dev/null && TAR=bsdtar
-URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+URL="https://github.com/classabbyamp/xtools/archive/xshellcheck.tar.gz"
 FILE="xtools.tar.gz"
 
 mkdir -p /tmp/bin

From 6ec7d1db227028994c9738a49014e1c02f6d3912 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:16:23 -0400
Subject: [PATCH 05/11] TEMP: something to shellcheck

---
 srcpkgs/chezmoi/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index b7dca806e5f2..e1c63ec6a247 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -14,6 +14,7 @@ homepage="https://chezmoi.io/"
 changelog="https://github.com/twpayne/chezmoi/releases"
 distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz"
 checksum=49f624ff55e1fb7165e9bca98aead8d6c49c6ff73926973c6ba6347f0ee17eba
+bhasdfhsdf=
 
 pre_build() {
 	local _date
@@ -32,4 +33,5 @@ post_install() {
 	vcompletion completions/chezmoi-completion.bash bash
 	vcompletion completions/chezmoi.fish fish
 	vcompletion completions/chezmoi.zsh zsh
+	: $adfsdhfajhsdfjasdf
 }

From 17b6a1882d30a3af9c3c8e96ea8b7c12e93e1aa9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:23:21 -0400
Subject: [PATCH 06/11] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index de1124202f1c..9e252778b667 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,12 +37,17 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck
+          xbps-install -y shellcheck grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/xlint.sh"
+          )
 
   # Build changed packages.
   build:

From 73e569819accb8058658b573d51fa2988a929c55 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:26:12 -0400
Subject: [PATCH 07/11] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 9e252778b667..4373f36e8c1b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -44,9 +44,13 @@ jobs:
       - run: common/travis/fetch-xtools.sh
       - run: |
           (
-          here="$(pwd)"
-          cd /
-          "$here/common/travis/xlint.sh"
+          echo "$(pwd)"
+          ls
+          echo "/"
+          ls
+          # here="$(pwd)"
+          # cd /
+          # "$here/common/travis/xlint.sh"
           )
 
   # Build changed packages.

From 9d1b4af650ad8a24e15fad85849effb22767f052 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:27:43 -0400
Subject: [PATCH 08/11] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4373f36e8c1b..efad2dbdb9a7 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,7 +47,7 @@ jobs:
           echo "$(pwd)"
           ls
           echo "/"
-          ls
+          ls /
           # here="$(pwd)"
           # cd /
           # "$here/common/travis/xlint.sh"

From aa4dec243c0fa05e30fb539e3531a7d5d590706f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:33:14 -0400
Subject: [PATCH 09/11] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index efad2dbdb9a7..afb405efe622 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -24,7 +24,6 @@ jobs:
       image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-        XLINT: '1'
         LICENSE_LIST: common/travis/license.lst
 
     steps:
@@ -37,21 +36,12 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck grep
+          xbps-install -y shellcheck grep git awk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: |
-          (
-          echo "$(pwd)"
-          ls
-          echo "/"
-          ls /
-          # here="$(pwd)"
-          # cd /
-          # "$here/common/travis/xlint.sh"
-          )
+      - run: common/travis/xlint.sh
 
   # Build changed packages.
   build:

From f22797c6dcb8ff9f58703014c6337a81957069b9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:34:56 -0400
Subject: [PATCH 10/11] XLINT no longer needed

---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..46072e9f81ea 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index bc12aedd4f8e..b9f3333ccef3 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From f626bc3d43dcd3adec66e8c42727d6eca5a6018b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:37:19 -0400
Subject: [PATCH 11/11] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index afb405efe622..5f82205eeeef 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,6 +25,7 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
+        XBPS_DISTDIR: '.'
 
     steps:
       - name: Prepare container

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Updated] lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
                   ` (6 preceding siblings ...)
  2023-05-19 20:37 ` classabbyamp
@ 2023-05-19 21:53 ` classabbyamp
  2023-05-19 22:24 ` classabbyamp
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-05-19 21:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4239 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

lint templates with shellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |


A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 18662 bytes --]

From fbde9bf7dfbaf83cc03a6ebe9227dd65b6be425f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH 01/12] common/scripts/template_shellcheck_shim: create shim
 for xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 000000000000..48932d19dbca
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

From 21810b1f1fad5557fcecb89c9542a6db22bc2492 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:14 -0400
Subject: [PATCH 02/12] .github/workflows/build.yaml: install shellcheck for
 xlint

---
 .github/workflows/build.yaml | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..de1124202f1c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,16 +20,27 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        XLINT: '1'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          xbps-install -y shellcheck
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 

From c3c23785a1deef7d046fba4222289b2eae1e16d7 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:57 -0400
Subject: [PATCH 03/12] common/travis/xlint.sh: run xshellcheck

---
 common/travis/xlint.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef1733..bc12aedd4f8e 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -12,6 +12,7 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

From 0d6e18e8b1557fd93969b2c0445a5ee6d6c0cf9f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:15:17 -0400
Subject: [PATCH 04/12] TEMP: switch xtools fork/branch for xshellcheck

---
 common/travis/fetch-xtools.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 0dd9e6c532c0..6795b1afc313 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -4,7 +4,7 @@
 
 TAR=tar
 command -v bsdtar >/dev/null && TAR=bsdtar
-URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+URL="https://github.com/classabbyamp/xtools/archive/xshellcheck.tar.gz"
 FILE="xtools.tar.gz"
 
 mkdir -p /tmp/bin

From 6ec7d1db227028994c9738a49014e1c02f6d3912 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:16:23 -0400
Subject: [PATCH 05/12] TEMP: something to shellcheck

---
 srcpkgs/chezmoi/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index b7dca806e5f2..e1c63ec6a247 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -14,6 +14,7 @@ homepage="https://chezmoi.io/"
 changelog="https://github.com/twpayne/chezmoi/releases"
 distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz"
 checksum=49f624ff55e1fb7165e9bca98aead8d6c49c6ff73926973c6ba6347f0ee17eba
+bhasdfhsdf=
 
 pre_build() {
 	local _date
@@ -32,4 +33,5 @@ post_install() {
 	vcompletion completions/chezmoi-completion.bash bash
 	vcompletion completions/chezmoi.fish fish
 	vcompletion completions/chezmoi.zsh zsh
+	: $adfsdhfajhsdfjasdf
 }

From 17b6a1882d30a3af9c3c8e96ea8b7c12e93e1aa9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:23:21 -0400
Subject: [PATCH 06/12] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index de1124202f1c..9e252778b667 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,12 +37,17 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck
+          xbps-install -y shellcheck grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/xlint.sh"
+          )
 
   # Build changed packages.
   build:

From 73e569819accb8058658b573d51fa2988a929c55 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:26:12 -0400
Subject: [PATCH 07/12] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 9e252778b667..4373f36e8c1b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -44,9 +44,13 @@ jobs:
       - run: common/travis/fetch-xtools.sh
       - run: |
           (
-          here="$(pwd)"
-          cd /
-          "$here/common/travis/xlint.sh"
+          echo "$(pwd)"
+          ls
+          echo "/"
+          ls
+          # here="$(pwd)"
+          # cd /
+          # "$here/common/travis/xlint.sh"
           )
 
   # Build changed packages.

From 9d1b4af650ad8a24e15fad85849effb22767f052 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:27:43 -0400
Subject: [PATCH 08/12] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4373f36e8c1b..efad2dbdb9a7 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,7 +47,7 @@ jobs:
           echo "$(pwd)"
           ls
           echo "/"
-          ls
+          ls /
           # here="$(pwd)"
           # cd /
           # "$here/common/travis/xlint.sh"

From aa4dec243c0fa05e30fb539e3531a7d5d590706f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:33:14 -0400
Subject: [PATCH 09/12] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index efad2dbdb9a7..afb405efe622 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -24,7 +24,6 @@ jobs:
       image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-        XLINT: '1'
         LICENSE_LIST: common/travis/license.lst
 
     steps:
@@ -37,21 +36,12 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck grep
+          xbps-install -y shellcheck grep git awk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: |
-          (
-          echo "$(pwd)"
-          ls
-          echo "/"
-          ls /
-          # here="$(pwd)"
-          # cd /
-          # "$here/common/travis/xlint.sh"
-          )
+      - run: common/travis/xlint.sh
 
   # Build changed packages.
   build:

From f22797c6dcb8ff9f58703014c6337a81957069b9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:34:56 -0400
Subject: [PATCH 10/12] XLINT no longer needed

---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..46072e9f81ea 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index bc12aedd4f8e..b9f3333ccef3 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From f626bc3d43dcd3adec66e8c42727d6eca5a6018b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:37:19 -0400
Subject: [PATCH 11/12] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index afb405efe622..5f82205eeeef 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,6 +25,7 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
+        XBPS_DISTDIR: '.'
 
     steps:
       - name: Prepare container

From aa73b9f57563ee75a3d0ef017a201deb57197011 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 17:53:43 -0400
Subject: [PATCH 12/12] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 5f82205eeeef..952df7667978 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,7 +37,8 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck grep git awk
+          # install tools needed for lints
+          xbps-install -y shellcheck grep git gawk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Updated] lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
                   ` (7 preceding siblings ...)
  2023-05-19 21:53 ` classabbyamp
@ 2023-05-19 22:24 ` classabbyamp
  2023-05-19 22:27 ` classabbyamp
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-05-19 22:24 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4239 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

lint templates with shellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |


A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 20011 bytes --]

From fbde9bf7dfbaf83cc03a6ebe9227dd65b6be425f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH 01/13] common/scripts/template_shellcheck_shim: create shim
 for xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 000000000000..48932d19dbca
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

From 21810b1f1fad5557fcecb89c9542a6db22bc2492 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:14 -0400
Subject: [PATCH 02/13] .github/workflows/build.yaml: install shellcheck for
 xlint

---
 .github/workflows/build.yaml | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..de1124202f1c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,16 +20,27 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        XLINT: '1'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          xbps-install -y shellcheck
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 

From c3c23785a1deef7d046fba4222289b2eae1e16d7 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:57 -0400
Subject: [PATCH 03/13] common/travis/xlint.sh: run xshellcheck

---
 common/travis/xlint.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef1733..bc12aedd4f8e 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -12,6 +12,7 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

From 0d6e18e8b1557fd93969b2c0445a5ee6d6c0cf9f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:15:17 -0400
Subject: [PATCH 04/13] TEMP: switch xtools fork/branch for xshellcheck

---
 common/travis/fetch-xtools.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 0dd9e6c532c0..6795b1afc313 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -4,7 +4,7 @@
 
 TAR=tar
 command -v bsdtar >/dev/null && TAR=bsdtar
-URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+URL="https://github.com/classabbyamp/xtools/archive/xshellcheck.tar.gz"
 FILE="xtools.tar.gz"
 
 mkdir -p /tmp/bin

From 6ec7d1db227028994c9738a49014e1c02f6d3912 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:16:23 -0400
Subject: [PATCH 05/13] TEMP: something to shellcheck

---
 srcpkgs/chezmoi/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index b7dca806e5f2..e1c63ec6a247 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -14,6 +14,7 @@ homepage="https://chezmoi.io/"
 changelog="https://github.com/twpayne/chezmoi/releases"
 distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz"
 checksum=49f624ff55e1fb7165e9bca98aead8d6c49c6ff73926973c6ba6347f0ee17eba
+bhasdfhsdf=
 
 pre_build() {
 	local _date
@@ -32,4 +33,5 @@ post_install() {
 	vcompletion completions/chezmoi-completion.bash bash
 	vcompletion completions/chezmoi.fish fish
 	vcompletion completions/chezmoi.zsh zsh
+	: $adfsdhfajhsdfjasdf
 }

From 17b6a1882d30a3af9c3c8e96ea8b7c12e93e1aa9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:23:21 -0400
Subject: [PATCH 06/13] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index de1124202f1c..9e252778b667 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,12 +37,17 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck
+          xbps-install -y shellcheck grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/xlint.sh"
+          )
 
   # Build changed packages.
   build:

From 73e569819accb8058658b573d51fa2988a929c55 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:26:12 -0400
Subject: [PATCH 07/13] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 9e252778b667..4373f36e8c1b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -44,9 +44,13 @@ jobs:
       - run: common/travis/fetch-xtools.sh
       - run: |
           (
-          here="$(pwd)"
-          cd /
-          "$here/common/travis/xlint.sh"
+          echo "$(pwd)"
+          ls
+          echo "/"
+          ls
+          # here="$(pwd)"
+          # cd /
+          # "$here/common/travis/xlint.sh"
           )
 
   # Build changed packages.

From 9d1b4af650ad8a24e15fad85849effb22767f052 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:27:43 -0400
Subject: [PATCH 08/13] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4373f36e8c1b..efad2dbdb9a7 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,7 +47,7 @@ jobs:
           echo "$(pwd)"
           ls
           echo "/"
-          ls
+          ls /
           # here="$(pwd)"
           # cd /
           # "$here/common/travis/xlint.sh"

From aa4dec243c0fa05e30fb539e3531a7d5d590706f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:33:14 -0400
Subject: [PATCH 09/13] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index efad2dbdb9a7..afb405efe622 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -24,7 +24,6 @@ jobs:
       image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-        XLINT: '1'
         LICENSE_LIST: common/travis/license.lst
 
     steps:
@@ -37,21 +36,12 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck grep
+          xbps-install -y shellcheck grep git awk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: |
-          (
-          echo "$(pwd)"
-          ls
-          echo "/"
-          ls /
-          # here="$(pwd)"
-          # cd /
-          # "$here/common/travis/xlint.sh"
-          )
+      - run: common/travis/xlint.sh
 
   # Build changed packages.
   build:

From f22797c6dcb8ff9f58703014c6337a81957069b9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:34:56 -0400
Subject: [PATCH 10/13] XLINT no longer needed

---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..46072e9f81ea 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index bc12aedd4f8e..b9f3333ccef3 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From f626bc3d43dcd3adec66e8c42727d6eca5a6018b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:37:19 -0400
Subject: [PATCH 11/13] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index afb405efe622..5f82205eeeef 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,6 +25,7 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
+        XBPS_DISTDIR: '.'
 
     steps:
       - name: Prepare container

From aa73b9f57563ee75a3d0ef017a201deb57197011 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 17:53:43 -0400
Subject: [PATCH 12/13] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 5f82205eeeef..952df7667978 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,7 +37,8 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck grep git awk
+          # install tools needed for lints
+          xbps-install -y shellcheck grep git gawk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh

From 8543649f45892c57e03715486d445a19629f0951 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:24:23 -0400
Subject: [PATCH 13/13] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 952df7667978..3c58ca493601 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,7 +25,6 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
-        XBPS_DISTDIR: '.'
 
     steps:
       - name: Prepare container
@@ -41,8 +40,13 @@ jobs:
           xbps-install -y shellcheck grep git gawk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
+      - name: Create hostrepo and prepare masterdir
+        run: |
+         ln -s "$(pwd)" /hostrepo &&
+         common/travis/set_mirror.sh &&
+         common/travis/prepare.sh &&
+         common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 
   # Build changed packages.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Updated] lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
                   ` (8 preceding siblings ...)
  2023-05-19 22:24 ` classabbyamp
@ 2023-05-19 22:27 ` classabbyamp
  2023-05-19 22:37 ` classabbyamp
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-05-19 22:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4239 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

lint templates with shellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |


A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 20777 bytes --]

From fbde9bf7dfbaf83cc03a6ebe9227dd65b6be425f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH 01/14] common/scripts/template_shellcheck_shim: create shim
 for xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 000000000000..48932d19dbca
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

From 21810b1f1fad5557fcecb89c9542a6db22bc2492 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:14 -0400
Subject: [PATCH 02/14] .github/workflows/build.yaml: install shellcheck for
 xlint

---
 .github/workflows/build.yaml | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..de1124202f1c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,16 +20,27 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        XLINT: '1'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          xbps-install -y shellcheck
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 

From c3c23785a1deef7d046fba4222289b2eae1e16d7 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:57 -0400
Subject: [PATCH 03/14] common/travis/xlint.sh: run xshellcheck

---
 common/travis/xlint.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef1733..bc12aedd4f8e 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -12,6 +12,7 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

From 0d6e18e8b1557fd93969b2c0445a5ee6d6c0cf9f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:15:17 -0400
Subject: [PATCH 04/14] TEMP: switch xtools fork/branch for xshellcheck

---
 common/travis/fetch-xtools.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 0dd9e6c532c0..6795b1afc313 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -4,7 +4,7 @@
 
 TAR=tar
 command -v bsdtar >/dev/null && TAR=bsdtar
-URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+URL="https://github.com/classabbyamp/xtools/archive/xshellcheck.tar.gz"
 FILE="xtools.tar.gz"
 
 mkdir -p /tmp/bin

From 6ec7d1db227028994c9738a49014e1c02f6d3912 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:16:23 -0400
Subject: [PATCH 05/14] TEMP: something to shellcheck

---
 srcpkgs/chezmoi/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index b7dca806e5f2..e1c63ec6a247 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -14,6 +14,7 @@ homepage="https://chezmoi.io/"
 changelog="https://github.com/twpayne/chezmoi/releases"
 distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz"
 checksum=49f624ff55e1fb7165e9bca98aead8d6c49c6ff73926973c6ba6347f0ee17eba
+bhasdfhsdf=
 
 pre_build() {
 	local _date
@@ -32,4 +33,5 @@ post_install() {
 	vcompletion completions/chezmoi-completion.bash bash
 	vcompletion completions/chezmoi.fish fish
 	vcompletion completions/chezmoi.zsh zsh
+	: $adfsdhfajhsdfjasdf
 }

From 17b6a1882d30a3af9c3c8e96ea8b7c12e93e1aa9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:23:21 -0400
Subject: [PATCH 06/14] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index de1124202f1c..9e252778b667 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,12 +37,17 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck
+          xbps-install -y shellcheck grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/xlint.sh"
+          )
 
   # Build changed packages.
   build:

From 73e569819accb8058658b573d51fa2988a929c55 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:26:12 -0400
Subject: [PATCH 07/14] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 9e252778b667..4373f36e8c1b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -44,9 +44,13 @@ jobs:
       - run: common/travis/fetch-xtools.sh
       - run: |
           (
-          here="$(pwd)"
-          cd /
-          "$here/common/travis/xlint.sh"
+          echo "$(pwd)"
+          ls
+          echo "/"
+          ls
+          # here="$(pwd)"
+          # cd /
+          # "$here/common/travis/xlint.sh"
           )
 
   # Build changed packages.

From 9d1b4af650ad8a24e15fad85849effb22767f052 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:27:43 -0400
Subject: [PATCH 08/14] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4373f36e8c1b..efad2dbdb9a7 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,7 +47,7 @@ jobs:
           echo "$(pwd)"
           ls
           echo "/"
-          ls
+          ls /
           # here="$(pwd)"
           # cd /
           # "$here/common/travis/xlint.sh"

From aa4dec243c0fa05e30fb539e3531a7d5d590706f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:33:14 -0400
Subject: [PATCH 09/14] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index efad2dbdb9a7..afb405efe622 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -24,7 +24,6 @@ jobs:
       image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-        XLINT: '1'
         LICENSE_LIST: common/travis/license.lst
 
     steps:
@@ -37,21 +36,12 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck grep
+          xbps-install -y shellcheck grep git awk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: |
-          (
-          echo "$(pwd)"
-          ls
-          echo "/"
-          ls /
-          # here="$(pwd)"
-          # cd /
-          # "$here/common/travis/xlint.sh"
-          )
+      - run: common/travis/xlint.sh
 
   # Build changed packages.
   build:

From f22797c6dcb8ff9f58703014c6337a81957069b9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:34:56 -0400
Subject: [PATCH 10/14] XLINT no longer needed

---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..46072e9f81ea 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index bc12aedd4f8e..b9f3333ccef3 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From f626bc3d43dcd3adec66e8c42727d6eca5a6018b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:37:19 -0400
Subject: [PATCH 11/14] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index afb405efe622..5f82205eeeef 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,6 +25,7 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
+        XBPS_DISTDIR: '.'
 
     steps:
       - name: Prepare container

From aa73b9f57563ee75a3d0ef017a201deb57197011 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 17:53:43 -0400
Subject: [PATCH 12/14] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 5f82205eeeef..952df7667978 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,7 +37,8 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck grep git awk
+          # install tools needed for lints
+          xbps-install -y shellcheck grep git gawk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh

From 8543649f45892c57e03715486d445a19629f0951 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:24:23 -0400
Subject: [PATCH 13/14] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 952df7667978..3c58ca493601 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,7 +25,6 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
-        XBPS_DISTDIR: '.'
 
     steps:
       - name: Prepare container
@@ -41,8 +40,13 @@ jobs:
           xbps-install -y shellcheck grep git gawk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
+      - name: Create hostrepo and prepare masterdir
+        run: |
+         ln -s "$(pwd)" /hostrepo &&
+         common/travis/set_mirror.sh &&
+         common/travis/prepare.sh &&
+         common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 
   # Build changed packages.

From a11127f4f5e305272df5a4d2aa33c2009f0f978a Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:27:41 -0400
Subject: [PATCH 14/14] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 3c58ca493601..6ce8db5cbb29 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,6 +25,7 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
+        XSC_FMT: gcc
 
     steps:
       - name: Prepare container

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Updated] lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
                   ` (9 preceding siblings ...)
  2023-05-19 22:27 ` classabbyamp
@ 2023-05-19 22:37 ` classabbyamp
  2023-05-19 22:58 ` classabbyamp
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-05-19 22:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4239 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

lint templates with shellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |


A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 21601 bytes --]

From fbde9bf7dfbaf83cc03a6ebe9227dd65b6be425f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH 01/15] common/scripts/template_shellcheck_shim: create shim
 for xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 000000000000..48932d19dbca
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

From 21810b1f1fad5557fcecb89c9542a6db22bc2492 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:14 -0400
Subject: [PATCH 02/15] .github/workflows/build.yaml: install shellcheck for
 xlint

---
 .github/workflows/build.yaml | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..de1124202f1c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,16 +20,27 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        XLINT: '1'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          xbps-install -y shellcheck
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 

From c3c23785a1deef7d046fba4222289b2eae1e16d7 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:57 -0400
Subject: [PATCH 03/15] common/travis/xlint.sh: run xshellcheck

---
 common/travis/xlint.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef1733..bc12aedd4f8e 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -12,6 +12,7 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

From 0d6e18e8b1557fd93969b2c0445a5ee6d6c0cf9f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:15:17 -0400
Subject: [PATCH 04/15] TEMP: switch xtools fork/branch for xshellcheck

---
 common/travis/fetch-xtools.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 0dd9e6c532c0..6795b1afc313 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -4,7 +4,7 @@
 
 TAR=tar
 command -v bsdtar >/dev/null && TAR=bsdtar
-URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+URL="https://github.com/classabbyamp/xtools/archive/xshellcheck.tar.gz"
 FILE="xtools.tar.gz"
 
 mkdir -p /tmp/bin

From 6ec7d1db227028994c9738a49014e1c02f6d3912 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:16:23 -0400
Subject: [PATCH 05/15] TEMP: something to shellcheck

---
 srcpkgs/chezmoi/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index b7dca806e5f2..e1c63ec6a247 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -14,6 +14,7 @@ homepage="https://chezmoi.io/"
 changelog="https://github.com/twpayne/chezmoi/releases"
 distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz"
 checksum=49f624ff55e1fb7165e9bca98aead8d6c49c6ff73926973c6ba6347f0ee17eba
+bhasdfhsdf=
 
 pre_build() {
 	local _date
@@ -32,4 +33,5 @@ post_install() {
 	vcompletion completions/chezmoi-completion.bash bash
 	vcompletion completions/chezmoi.fish fish
 	vcompletion completions/chezmoi.zsh zsh
+	: $adfsdhfajhsdfjasdf
 }

From 17b6a1882d30a3af9c3c8e96ea8b7c12e93e1aa9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:23:21 -0400
Subject: [PATCH 06/15] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index de1124202f1c..9e252778b667 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,12 +37,17 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck
+          xbps-install -y shellcheck grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/xlint.sh"
+          )
 
   # Build changed packages.
   build:

From 73e569819accb8058658b573d51fa2988a929c55 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:26:12 -0400
Subject: [PATCH 07/15] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 9e252778b667..4373f36e8c1b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -44,9 +44,13 @@ jobs:
       - run: common/travis/fetch-xtools.sh
       - run: |
           (
-          here="$(pwd)"
-          cd /
-          "$here/common/travis/xlint.sh"
+          echo "$(pwd)"
+          ls
+          echo "/"
+          ls
+          # here="$(pwd)"
+          # cd /
+          # "$here/common/travis/xlint.sh"
           )
 
   # Build changed packages.

From 9d1b4af650ad8a24e15fad85849effb22767f052 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:27:43 -0400
Subject: [PATCH 08/15] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4373f36e8c1b..efad2dbdb9a7 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,7 +47,7 @@ jobs:
           echo "$(pwd)"
           ls
           echo "/"
-          ls
+          ls /
           # here="$(pwd)"
           # cd /
           # "$here/common/travis/xlint.sh"

From aa4dec243c0fa05e30fb539e3531a7d5d590706f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:33:14 -0400
Subject: [PATCH 09/15] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index efad2dbdb9a7..afb405efe622 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -24,7 +24,6 @@ jobs:
       image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-        XLINT: '1'
         LICENSE_LIST: common/travis/license.lst
 
     steps:
@@ -37,21 +36,12 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck grep
+          xbps-install -y shellcheck grep git awk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: |
-          (
-          echo "$(pwd)"
-          ls
-          echo "/"
-          ls /
-          # here="$(pwd)"
-          # cd /
-          # "$here/common/travis/xlint.sh"
-          )
+      - run: common/travis/xlint.sh
 
   # Build changed packages.
   build:

From f22797c6dcb8ff9f58703014c6337a81957069b9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:34:56 -0400
Subject: [PATCH 10/15] XLINT no longer needed

---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..46072e9f81ea 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index bc12aedd4f8e..b9f3333ccef3 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From f626bc3d43dcd3adec66e8c42727d6eca5a6018b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:37:19 -0400
Subject: [PATCH 11/15] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index afb405efe622..5f82205eeeef 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,6 +25,7 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
+        XBPS_DISTDIR: '.'
 
     steps:
       - name: Prepare container

From aa73b9f57563ee75a3d0ef017a201deb57197011 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 17:53:43 -0400
Subject: [PATCH 12/15] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 5f82205eeeef..952df7667978 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,7 +37,8 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck grep git awk
+          # install tools needed for lints
+          xbps-install -y shellcheck grep git gawk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh

From 8543649f45892c57e03715486d445a19629f0951 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:24:23 -0400
Subject: [PATCH 13/15] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 952df7667978..3c58ca493601 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,7 +25,6 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
-        XBPS_DISTDIR: '.'
 
     steps:
       - name: Prepare container
@@ -41,8 +40,13 @@ jobs:
           xbps-install -y shellcheck grep git gawk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
+      - name: Create hostrepo and prepare masterdir
+        run: |
+         ln -s "$(pwd)" /hostrepo &&
+         common/travis/set_mirror.sh &&
+         common/travis/prepare.sh &&
+         common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 
   # Build changed packages.

From a11127f4f5e305272df5a4d2aa33c2009f0f978a Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:27:41 -0400
Subject: [PATCH 14/15] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 3c58ca493601..6ce8db5cbb29 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,6 +25,7 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
+        XSC_FMT: gcc
 
     steps:
       - name: Prepare container

From c613dd0bab345010d026a1c17cf79ff125be7ce4 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:37:02 -0400
Subject: [PATCH 15/15] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 6ce8db5cbb29..996cefe191ae 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,7 +25,7 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
-        XSC_FMT: gcc
+        XSHELLCHECK_ARGS: --color=always
 
     steps:
       - name: Prepare container

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Updated] lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
                   ` (10 preceding siblings ...)
  2023-05-19 22:37 ` classabbyamp
@ 2023-05-19 22:58 ` classabbyamp
  2023-05-19 23:09 ` classabbyamp
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-05-19 22:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4239 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

lint templates with shellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |


A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 23538 bytes --]

From fbde9bf7dfbaf83cc03a6ebe9227dd65b6be425f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH 01/17] common/scripts/template_shellcheck_shim: create shim
 for xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 000000000000..48932d19dbca
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

From 21810b1f1fad5557fcecb89c9542a6db22bc2492 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:14 -0400
Subject: [PATCH 02/17] .github/workflows/build.yaml: install shellcheck for
 xlint

---
 .github/workflows/build.yaml | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..de1124202f1c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,16 +20,27 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        XLINT: '1'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          xbps-install -y shellcheck
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 

From c3c23785a1deef7d046fba4222289b2eae1e16d7 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:57 -0400
Subject: [PATCH 03/17] common/travis/xlint.sh: run xshellcheck

---
 common/travis/xlint.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef1733..bc12aedd4f8e 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -12,6 +12,7 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

From 0d6e18e8b1557fd93969b2c0445a5ee6d6c0cf9f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:15:17 -0400
Subject: [PATCH 04/17] TEMP: switch xtools fork/branch for xshellcheck

---
 common/travis/fetch-xtools.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 0dd9e6c532c0..6795b1afc313 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -4,7 +4,7 @@
 
 TAR=tar
 command -v bsdtar >/dev/null && TAR=bsdtar
-URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+URL="https://github.com/classabbyamp/xtools/archive/xshellcheck.tar.gz"
 FILE="xtools.tar.gz"
 
 mkdir -p /tmp/bin

From 6ec7d1db227028994c9738a49014e1c02f6d3912 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:16:23 -0400
Subject: [PATCH 05/17] TEMP: something to shellcheck

---
 srcpkgs/chezmoi/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index b7dca806e5f2..e1c63ec6a247 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -14,6 +14,7 @@ homepage="https://chezmoi.io/"
 changelog="https://github.com/twpayne/chezmoi/releases"
 distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz"
 checksum=49f624ff55e1fb7165e9bca98aead8d6c49c6ff73926973c6ba6347f0ee17eba
+bhasdfhsdf=
 
 pre_build() {
 	local _date
@@ -32,4 +33,5 @@ post_install() {
 	vcompletion completions/chezmoi-completion.bash bash
 	vcompletion completions/chezmoi.fish fish
 	vcompletion completions/chezmoi.zsh zsh
+	: $adfsdhfajhsdfjasdf
 }

From 17b6a1882d30a3af9c3c8e96ea8b7c12e93e1aa9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:23:21 -0400
Subject: [PATCH 06/17] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index de1124202f1c..9e252778b667 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,12 +37,17 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck
+          xbps-install -y shellcheck grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/xlint.sh"
+          )
 
   # Build changed packages.
   build:

From 73e569819accb8058658b573d51fa2988a929c55 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:26:12 -0400
Subject: [PATCH 07/17] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 9e252778b667..4373f36e8c1b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -44,9 +44,13 @@ jobs:
       - run: common/travis/fetch-xtools.sh
       - run: |
           (
-          here="$(pwd)"
-          cd /
-          "$here/common/travis/xlint.sh"
+          echo "$(pwd)"
+          ls
+          echo "/"
+          ls
+          # here="$(pwd)"
+          # cd /
+          # "$here/common/travis/xlint.sh"
           )
 
   # Build changed packages.

From 9d1b4af650ad8a24e15fad85849effb22767f052 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:27:43 -0400
Subject: [PATCH 08/17] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4373f36e8c1b..efad2dbdb9a7 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,7 +47,7 @@ jobs:
           echo "$(pwd)"
           ls
           echo "/"
-          ls
+          ls /
           # here="$(pwd)"
           # cd /
           # "$here/common/travis/xlint.sh"

From aa4dec243c0fa05e30fb539e3531a7d5d590706f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:33:14 -0400
Subject: [PATCH 09/17] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index efad2dbdb9a7..afb405efe622 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -24,7 +24,6 @@ jobs:
       image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-        XLINT: '1'
         LICENSE_LIST: common/travis/license.lst
 
     steps:
@@ -37,21 +36,12 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck grep
+          xbps-install -y shellcheck grep git awk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: |
-          (
-          echo "$(pwd)"
-          ls
-          echo "/"
-          ls /
-          # here="$(pwd)"
-          # cd /
-          # "$here/common/travis/xlint.sh"
-          )
+      - run: common/travis/xlint.sh
 
   # Build changed packages.
   build:

From f22797c6dcb8ff9f58703014c6337a81957069b9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:34:56 -0400
Subject: [PATCH 10/17] XLINT no longer needed

---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..46072e9f81ea 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index bc12aedd4f8e..b9f3333ccef3 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From f626bc3d43dcd3adec66e8c42727d6eca5a6018b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:37:19 -0400
Subject: [PATCH 11/17] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index afb405efe622..5f82205eeeef 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,6 +25,7 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
+        XBPS_DISTDIR: '.'
 
     steps:
       - name: Prepare container

From aa73b9f57563ee75a3d0ef017a201deb57197011 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 17:53:43 -0400
Subject: [PATCH 12/17] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 5f82205eeeef..952df7667978 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,7 +37,8 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck grep git awk
+          # install tools needed for lints
+          xbps-install -y shellcheck grep git gawk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh

From 8543649f45892c57e03715486d445a19629f0951 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:24:23 -0400
Subject: [PATCH 13/17] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 952df7667978..3c58ca493601 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,7 +25,6 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
-        XBPS_DISTDIR: '.'
 
     steps:
       - name: Prepare container
@@ -41,8 +40,13 @@ jobs:
           xbps-install -y shellcheck grep git gawk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
+      - name: Create hostrepo and prepare masterdir
+        run: |
+         ln -s "$(pwd)" /hostrepo &&
+         common/travis/set_mirror.sh &&
+         common/travis/prepare.sh &&
+         common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 
   # Build changed packages.

From a11127f4f5e305272df5a4d2aa33c2009f0f978a Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:27:41 -0400
Subject: [PATCH 14/17] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 3c58ca493601..6ce8db5cbb29 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,6 +25,7 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
+        XSC_FMT: gcc
 
     steps:
       - name: Prepare container

From c613dd0bab345010d026a1c17cf79ff125be7ce4 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:37:02 -0400
Subject: [PATCH 15/17] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 6ce8db5cbb29..996cefe191ae 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,7 +25,7 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
-        XSC_FMT: gcc
+        XSHELLCHECK_ARGS: --color=always
 
     steps:
       - name: Prepare container

From 0b78d39a183911b534e034423ce4e7b42579279e Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:58:18 -0400
Subject: [PATCH 16/17] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 996cefe191ae..1ec4c03089f9 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -38,7 +38,7 @@ jobs:
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
           # install tools needed for lints
-          xbps-install -y shellcheck grep git gawk
+          xbps-install -y shellcheck grep gawk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - name: Create hostrepo and prepare masterdir

From 5844a59a98b795ff0c06e6e9edbafc345b980794 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:58:24 -0400
Subject: [PATCH 17/17] temp

---
 common/travis/xlint.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index b9f3333ccef3..86da7069aa5f 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -9,9 +9,9 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
-	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xlint "$t" || EXITCODE=$? #> /tmp/xlint_out || EXITCODE=$?
 	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
-	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
+	# awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done
 exit $EXITCODE

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Updated] lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
                   ` (11 preceding siblings ...)
  2023-05-19 22:58 ` classabbyamp
@ 2023-05-19 23:09 ` classabbyamp
  2023-05-19 23:25 ` classabbyamp
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-05-19 23:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4239 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

lint templates with shellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |


A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 24351 bytes --]

From fbde9bf7dfbaf83cc03a6ebe9227dd65b6be425f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH 01/18] common/scripts/template_shellcheck_shim: create shim
 for xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 000000000000..48932d19dbca
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

From 21810b1f1fad5557fcecb89c9542a6db22bc2492 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:14 -0400
Subject: [PATCH 02/18] .github/workflows/build.yaml: install shellcheck for
 xlint

---
 .github/workflows/build.yaml | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..de1124202f1c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,16 +20,27 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        XLINT: '1'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          xbps-install -y shellcheck
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 

From c3c23785a1deef7d046fba4222289b2eae1e16d7 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:57 -0400
Subject: [PATCH 03/18] common/travis/xlint.sh: run xshellcheck

---
 common/travis/xlint.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef1733..bc12aedd4f8e 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -12,6 +12,7 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

From 0d6e18e8b1557fd93969b2c0445a5ee6d6c0cf9f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:15:17 -0400
Subject: [PATCH 04/18] TEMP: switch xtools fork/branch for xshellcheck

---
 common/travis/fetch-xtools.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 0dd9e6c532c0..6795b1afc313 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -4,7 +4,7 @@
 
 TAR=tar
 command -v bsdtar >/dev/null && TAR=bsdtar
-URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+URL="https://github.com/classabbyamp/xtools/archive/xshellcheck.tar.gz"
 FILE="xtools.tar.gz"
 
 mkdir -p /tmp/bin

From 6ec7d1db227028994c9738a49014e1c02f6d3912 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:16:23 -0400
Subject: [PATCH 05/18] TEMP: something to shellcheck

---
 srcpkgs/chezmoi/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index b7dca806e5f2..e1c63ec6a247 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -14,6 +14,7 @@ homepage="https://chezmoi.io/"
 changelog="https://github.com/twpayne/chezmoi/releases"
 distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz"
 checksum=49f624ff55e1fb7165e9bca98aead8d6c49c6ff73926973c6ba6347f0ee17eba
+bhasdfhsdf=
 
 pre_build() {
 	local _date
@@ -32,4 +33,5 @@ post_install() {
 	vcompletion completions/chezmoi-completion.bash bash
 	vcompletion completions/chezmoi.fish fish
 	vcompletion completions/chezmoi.zsh zsh
+	: $adfsdhfajhsdfjasdf
 }

From 17b6a1882d30a3af9c3c8e96ea8b7c12e93e1aa9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:23:21 -0400
Subject: [PATCH 06/18] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index de1124202f1c..9e252778b667 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,12 +37,17 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck
+          xbps-install -y shellcheck grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/xlint.sh"
+          )
 
   # Build changed packages.
   build:

From 73e569819accb8058658b573d51fa2988a929c55 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:26:12 -0400
Subject: [PATCH 07/18] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 9e252778b667..4373f36e8c1b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -44,9 +44,13 @@ jobs:
       - run: common/travis/fetch-xtools.sh
       - run: |
           (
-          here="$(pwd)"
-          cd /
-          "$here/common/travis/xlint.sh"
+          echo "$(pwd)"
+          ls
+          echo "/"
+          ls
+          # here="$(pwd)"
+          # cd /
+          # "$here/common/travis/xlint.sh"
           )
 
   # Build changed packages.

From 9d1b4af650ad8a24e15fad85849effb22767f052 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:27:43 -0400
Subject: [PATCH 08/18] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4373f36e8c1b..efad2dbdb9a7 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,7 +47,7 @@ jobs:
           echo "$(pwd)"
           ls
           echo "/"
-          ls
+          ls /
           # here="$(pwd)"
           # cd /
           # "$here/common/travis/xlint.sh"

From aa4dec243c0fa05e30fb539e3531a7d5d590706f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:33:14 -0400
Subject: [PATCH 09/18] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index efad2dbdb9a7..afb405efe622 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -24,7 +24,6 @@ jobs:
       image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-        XLINT: '1'
         LICENSE_LIST: common/travis/license.lst
 
     steps:
@@ -37,21 +36,12 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck grep
+          xbps-install -y shellcheck grep git awk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xtools.sh
-      - run: |
-          (
-          echo "$(pwd)"
-          ls
-          echo "/"
-          ls /
-          # here="$(pwd)"
-          # cd /
-          # "$here/common/travis/xlint.sh"
-          )
+      - run: common/travis/xlint.sh
 
   # Build changed packages.
   build:

From f22797c6dcb8ff9f58703014c6337a81957069b9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:34:56 -0400
Subject: [PATCH 10/18] XLINT no longer needed

---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..46072e9f81ea 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index bc12aedd4f8e..b9f3333ccef3 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From f626bc3d43dcd3adec66e8c42727d6eca5a6018b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:37:19 -0400
Subject: [PATCH 11/18] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index afb405efe622..5f82205eeeef 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,6 +25,7 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
+        XBPS_DISTDIR: '.'
 
     steps:
       - name: Prepare container

From aa73b9f57563ee75a3d0ef017a201deb57197011 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 17:53:43 -0400
Subject: [PATCH 12/18] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 5f82205eeeef..952df7667978 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,7 +37,8 @@ jobs:
           xbps-install -Syu || xbps-install -yu xbps
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
-          xbps-install -y shellcheck grep git awk
+          # install tools needed for lints
+          xbps-install -y shellcheck grep git gawk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - run: common/travis/changed_templates.sh

From 8543649f45892c57e03715486d445a19629f0951 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:24:23 -0400
Subject: [PATCH 13/18] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 952df7667978..3c58ca493601 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,7 +25,6 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
-        XBPS_DISTDIR: '.'
 
     steps:
       - name: Prepare container
@@ -41,8 +40,13 @@ jobs:
           xbps-install -y shellcheck grep git gawk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
+      - name: Create hostrepo and prepare masterdir
+        run: |
+         ln -s "$(pwd)" /hostrepo &&
+         common/travis/set_mirror.sh &&
+         common/travis/prepare.sh &&
+         common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 
   # Build changed packages.

From a11127f4f5e305272df5a4d2aa33c2009f0f978a Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:27:41 -0400
Subject: [PATCH 14/18] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 3c58ca493601..6ce8db5cbb29 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,6 +25,7 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
+        XSC_FMT: gcc
 
     steps:
       - name: Prepare container

From c613dd0bab345010d026a1c17cf79ff125be7ce4 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:37:02 -0400
Subject: [PATCH 15/18] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 6ce8db5cbb29..996cefe191ae 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,7 +25,7 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
-        XSC_FMT: gcc
+        XSHELLCHECK_ARGS: --color=always
 
     steps:
       - name: Prepare container

From 0b78d39a183911b534e034423ce4e7b42579279e Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:58:18 -0400
Subject: [PATCH 16/18] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 996cefe191ae..1ec4c03089f9 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -38,7 +38,7 @@ jobs:
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
           # install tools needed for lints
-          xbps-install -y shellcheck grep git gawk
+          xbps-install -y shellcheck grep gawk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - name: Create hostrepo and prepare masterdir

From 5844a59a98b795ff0c06e6e9edbafc345b980794 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:58:24 -0400
Subject: [PATCH 17/18] temp

---
 common/travis/xlint.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index b9f3333ccef3..86da7069aa5f 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -9,9 +9,9 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
-	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xlint "$t" || EXITCODE=$? #> /tmp/xlint_out || EXITCODE=$?
 	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
-	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
+	# awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done
 exit $EXITCODE

From 7d33b4c8ab8c087817d98c1e9c8bc5034e4fbf0c Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 19:08:55 -0400
Subject: [PATCH 18/18] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 1ec4c03089f9..aaaec25053d6 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -39,6 +39,7 @@ jobs:
           xbps-install -yu
           # install tools needed for lints
           xbps-install -y shellcheck grep gawk
+          xbps-query -l
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - name: Create hostrepo and prepare masterdir

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Updated] lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
                   ` (12 preceding siblings ...)
  2023-05-19 23:09 ` classabbyamp
@ 2023-05-19 23:25 ` classabbyamp
  2023-05-19 23:28 ` classabbyamp
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-05-19 23:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4239 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

lint templates with shellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |


A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 13927 bytes --]

From a0e23f216495b87227f99b1567064f72ddacc1da Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH 1/7] common/scripts/template_shellcheck_shim: create shim for
 xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 000000000000..48932d19dbca
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

From 862c0664bdc3f0bdf55976fc09a52516e28de8ac Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:14 -0400
Subject: [PATCH 2/7] .github/workflows/build.yaml: install shellcheck for
 xlint

---
 .github/workflows/build.yaml | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..aaaec25053d6 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,17 +20,35 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        LICENSE_LIST: common/travis/license.lst
+        XSHELLCHECK_ARGS: --color=always
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          # install tools needed for lints
+          xbps-install -y shellcheck grep gawk
+          xbps-query -l
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
+      - name: Create hostrepo and prepare masterdir
+        run: |
+         ln -s "$(pwd)" /hostrepo &&
+         common/travis/set_mirror.sh &&
+         common/travis/prepare.sh &&
+         common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
-      - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 
   # Build changed packages.

From be2da53a400a568965116eafa711f5ffbdb7b099 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:57 -0400
Subject: [PATCH 3/7] common/travis/xlint.sh: run xshellcheck

---
 common/travis/xlint.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef1733..bc12aedd4f8e 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -12,6 +12,7 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

From 204ff661dd824089049c5b60936bd3d33788773e Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:15:17 -0400
Subject: [PATCH 4/7] TEMP: switch xtools fork/branch for xshellcheck

---
 common/travis/fetch-xtools.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 0dd9e6c532c0..6795b1afc313 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -4,7 +4,7 @@
 
 TAR=tar
 command -v bsdtar >/dev/null && TAR=bsdtar
-URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+URL="https://github.com/classabbyamp/xtools/archive/xshellcheck.tar.gz"
 FILE="xtools.tar.gz"
 
 mkdir -p /tmp/bin

From 1eebbd39d2bac582f18a830c02a22bab3e34f5a1 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:16:23 -0400
Subject: [PATCH 5/7] TEMP: something to shellcheck

---
 srcpkgs/chezmoi/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index b7dca806e5f2..e1c63ec6a247 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -14,6 +14,7 @@ homepage="https://chezmoi.io/"
 changelog="https://github.com/twpayne/chezmoi/releases"
 distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz"
 checksum=49f624ff55e1fb7165e9bca98aead8d6c49c6ff73926973c6ba6347f0ee17eba
+bhasdfhsdf=
 
 pre_build() {
 	local _date
@@ -32,4 +33,5 @@ post_install() {
 	vcompletion completions/chezmoi-completion.bash bash
 	vcompletion completions/chezmoi.fish fish
 	vcompletion completions/chezmoi.zsh zsh
+	: $adfsdhfajhsdfjasdf
 }

From 3ef19af87c02408563627403f576e2364f7809f2 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:34:56 -0400
Subject: [PATCH 6/7] XLINT no longer needed

---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..46072e9f81ea 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index bc12aedd4f8e..b9f3333ccef3 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From 51052af3c5689fc7c7592df1468729f60abdcc81 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:58:24 -0400
Subject: [PATCH 7/7] temp

---
 common/travis/xlint.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index b9f3333ccef3..86da7069aa5f 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -9,9 +9,9 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
-	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xlint "$t" || EXITCODE=$? #> /tmp/xlint_out || EXITCODE=$?
 	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
-	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
+	# awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done
 exit $EXITCODE

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Updated] lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
                   ` (13 preceding siblings ...)
  2023-05-19 23:25 ` classabbyamp
@ 2023-05-19 23:28 ` classabbyamp
  2023-05-19 23:41 ` classabbyamp
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-05-19 23:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4250 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

lint templates with shellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 13927 bytes --]

From a0e23f216495b87227f99b1567064f72ddacc1da Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH 1/7] common/scripts/template_shellcheck_shim: create shim for
 xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 000000000000..48932d19dbca
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

From 862c0664bdc3f0bdf55976fc09a52516e28de8ac Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:14 -0400
Subject: [PATCH 2/7] .github/workflows/build.yaml: install shellcheck for
 xlint

---
 .github/workflows/build.yaml | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..aaaec25053d6 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,17 +20,35 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        LICENSE_LIST: common/travis/license.lst
+        XSHELLCHECK_ARGS: --color=always
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          # install tools needed for lints
+          xbps-install -y shellcheck grep gawk
+          xbps-query -l
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
+      - name: Create hostrepo and prepare masterdir
+        run: |
+         ln -s "$(pwd)" /hostrepo &&
+         common/travis/set_mirror.sh &&
+         common/travis/prepare.sh &&
+         common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
-      - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 
   # Build changed packages.

From be2da53a400a568965116eafa711f5ffbdb7b099 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:57 -0400
Subject: [PATCH 3/7] common/travis/xlint.sh: run xshellcheck

---
 common/travis/xlint.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef1733..bc12aedd4f8e 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -12,6 +12,7 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

From 204ff661dd824089049c5b60936bd3d33788773e Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:15:17 -0400
Subject: [PATCH 4/7] TEMP: switch xtools fork/branch for xshellcheck

---
 common/travis/fetch-xtools.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 0dd9e6c532c0..6795b1afc313 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -4,7 +4,7 @@
 
 TAR=tar
 command -v bsdtar >/dev/null && TAR=bsdtar
-URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+URL="https://github.com/classabbyamp/xtools/archive/xshellcheck.tar.gz"
 FILE="xtools.tar.gz"
 
 mkdir -p /tmp/bin

From 1eebbd39d2bac582f18a830c02a22bab3e34f5a1 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:16:23 -0400
Subject: [PATCH 5/7] TEMP: something to shellcheck

---
 srcpkgs/chezmoi/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index b7dca806e5f2..e1c63ec6a247 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -14,6 +14,7 @@ homepage="https://chezmoi.io/"
 changelog="https://github.com/twpayne/chezmoi/releases"
 distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz"
 checksum=49f624ff55e1fb7165e9bca98aead8d6c49c6ff73926973c6ba6347f0ee17eba
+bhasdfhsdf=
 
 pre_build() {
 	local _date
@@ -32,4 +33,5 @@ post_install() {
 	vcompletion completions/chezmoi-completion.bash bash
 	vcompletion completions/chezmoi.fish fish
 	vcompletion completions/chezmoi.zsh zsh
+	: $adfsdhfajhsdfjasdf
 }

From 3ef19af87c02408563627403f576e2364f7809f2 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:34:56 -0400
Subject: [PATCH 6/7] XLINT no longer needed

---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..46072e9f81ea 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index bc12aedd4f8e..b9f3333ccef3 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From 3c4ef6bfc95ae1f9afeb3df075fbb008ba9eb472 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:58:24 -0400
Subject: [PATCH 7/7] temp

---
 common/travis/xlint.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index b9f3333ccef3..86da7069aa5f 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -9,9 +9,9 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
-	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xlint "$t" || EXITCODE=$? #> /tmp/xlint_out || EXITCODE=$?
 	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
-	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
+	# awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done
 exit $EXITCODE

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Updated] lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
                   ` (14 preceding siblings ...)
  2023-05-19 23:28 ` classabbyamp
@ 2023-05-19 23:41 ` classabbyamp
  2023-07-08 22:00 ` Chocimier
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-05-19 23:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4250 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

lint templates with shellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 14805 bytes --]

From a0e23f216495b87227f99b1567064f72ddacc1da Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH 1/8] common/scripts/template_shellcheck_shim: create shim for
 xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 000000000000..48932d19dbca
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

From 862c0664bdc3f0bdf55976fc09a52516e28de8ac Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:14 -0400
Subject: [PATCH 2/8] .github/workflows/build.yaml: install shellcheck for
 xlint

---
 .github/workflows/build.yaml | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..aaaec25053d6 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,17 +20,35 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        LICENSE_LIST: common/travis/license.lst
+        XSHELLCHECK_ARGS: --color=always
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          # install tools needed for lints
+          xbps-install -y shellcheck grep gawk
+          xbps-query -l
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
+      - name: Create hostrepo and prepare masterdir
+        run: |
+         ln -s "$(pwd)" /hostrepo &&
+         common/travis/set_mirror.sh &&
+         common/travis/prepare.sh &&
+         common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
-      - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 
   # Build changed packages.

From be2da53a400a568965116eafa711f5ffbdb7b099 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:57 -0400
Subject: [PATCH 3/8] common/travis/xlint.sh: run xshellcheck

---
 common/travis/xlint.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef1733..bc12aedd4f8e 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -12,6 +12,7 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

From 204ff661dd824089049c5b60936bd3d33788773e Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:15:17 -0400
Subject: [PATCH 4/8] TEMP: switch xtools fork/branch for xshellcheck

---
 common/travis/fetch-xtools.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 0dd9e6c532c0..6795b1afc313 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -4,7 +4,7 @@
 
 TAR=tar
 command -v bsdtar >/dev/null && TAR=bsdtar
-URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+URL="https://github.com/classabbyamp/xtools/archive/xshellcheck.tar.gz"
 FILE="xtools.tar.gz"
 
 mkdir -p /tmp/bin

From 1eebbd39d2bac582f18a830c02a22bab3e34f5a1 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:16:23 -0400
Subject: [PATCH 5/8] TEMP: something to shellcheck

---
 srcpkgs/chezmoi/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index b7dca806e5f2..e1c63ec6a247 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -14,6 +14,7 @@ homepage="https://chezmoi.io/"
 changelog="https://github.com/twpayne/chezmoi/releases"
 distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz"
 checksum=49f624ff55e1fb7165e9bca98aead8d6c49c6ff73926973c6ba6347f0ee17eba
+bhasdfhsdf=
 
 pre_build() {
 	local _date
@@ -32,4 +33,5 @@ post_install() {
 	vcompletion completions/chezmoi-completion.bash bash
 	vcompletion completions/chezmoi.fish fish
 	vcompletion completions/chezmoi.zsh zsh
+	: $adfsdhfajhsdfjasdf
 }

From 3ef19af87c02408563627403f576e2364f7809f2 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:34:56 -0400
Subject: [PATCH 6/8] XLINT no longer needed

---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..46072e9f81ea 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index bc12aedd4f8e..b9f3333ccef3 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From 3c4ef6bfc95ae1f9afeb3df075fbb008ba9eb472 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:58:24 -0400
Subject: [PATCH 7/8] temp

---
 common/travis/xlint.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index b9f3333ccef3..86da7069aa5f 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -9,9 +9,9 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
-	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xlint "$t" || EXITCODE=$? #> /tmp/xlint_out || EXITCODE=$?
 	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
-	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
+	# awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done
 exit $EXITCODE

From 1960e0d260acc4469ea35834d5d264c795eb5827 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 19:41:13 -0400
Subject: [PATCH 8/8] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index aaaec25053d6..062ff03fd9d1 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -38,7 +38,7 @@ jobs:
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
           # install tools needed for lints
-          xbps-install -y shellcheck grep gawk
+          xbps-install -y shellcheck grep
           xbps-query -l
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
                   ` (15 preceding siblings ...)
  2023-05-19 23:41 ` classabbyamp
@ 2023-07-08 22:00 ` Chocimier
  2023-07-08 23:20 ` [PR PATCH] [Updated] " classabbyamp
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Chocimier @ 2023-07-08 22:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 375 bytes --]

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/43949#issuecomment-1627526895

Comment:
    srcpkgs/chezmoi/template:17: custom variables should use _ prefix: 2

This happens when sh is bash. Sent [lint PR](https://github.com/leahneukirchen/xtools/pull/306), but switching to dash in image might be considered anyway.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Updated] lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
                   ` (16 preceding siblings ...)
  2023-07-08 22:00 ` Chocimier
@ 2023-07-08 23:20 ` classabbyamp
  2023-09-08  8:51 ` classabbyamp
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-07-08 23:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4250 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

lint templates with shellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 14912 bytes --]

From fd3ddbedbabde64ef99ad0ee8ee757616fdc1466 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH 1/8] common/scripts/template_shellcheck_shim: create shim for
 xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 000000000000..48932d19dbca
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

From a26f2fbbd4c85c80089af5c11234a74760c854b2 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:14 -0400
Subject: [PATCH 2/8] .github/workflows/build.yaml: install shellcheck for
 xlint

---
 .github/workflows/build.yaml | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 657712414657..22cd62e78aea 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,17 +20,35 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/xbps-src-masterdir:20230425RC01-x86_64'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        LICENSE_LIST: common/travis/license.lst
+        XSHELLCHECK_ARGS: --color=always
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          # install tools needed for lints
+          xbps-install -y shellcheck grep gawk
+          xbps-query -l
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
+      - name: Create hostrepo and prepare masterdir
+        run: |
+         ln -s "$(pwd)" /hostrepo &&
+         common/travis/set_mirror.sh &&
+         common/travis/prepare.sh &&
+         common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
-      - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 
   # Build changed packages.

From b3f8e1a8510e8c65314e79ede12a25a8577ef5a9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:57 -0400
Subject: [PATCH 3/8] common/travis/xlint.sh: run xshellcheck

---
 common/travis/xlint.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef1733..bc12aedd4f8e 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -12,6 +12,7 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

From d8b784ebc493e328412a6c01b613809f0bdec887 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:15:17 -0400
Subject: [PATCH 4/8] TEMP: switch xtools fork/branch for xshellcheck

---
 common/travis/fetch-xtools.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 0dd9e6c532c0..6795b1afc313 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -4,7 +4,7 @@
 
 TAR=tar
 command -v bsdtar >/dev/null && TAR=bsdtar
-URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+URL="https://github.com/classabbyamp/xtools/archive/xshellcheck.tar.gz"
 FILE="xtools.tar.gz"
 
 mkdir -p /tmp/bin

From 4949b22afb03d1a502d8f53e810a6e0a5472d2ac Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:16:23 -0400
Subject: [PATCH 5/8] TEMP: something to shellcheck

---
 srcpkgs/chezmoi/template | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index 074ef8b8c602..111365b57d39 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -13,7 +13,8 @@ license="MIT"
 homepage="https://chezmoi.io/"
 changelog="https://github.com/twpayne/chezmoi/releases"
 distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz"
-checksum=708ad93e8e0504ca598f6571652fc15ac609c735ce55af6a23a9b8931553c2e5
+checksum=49f624ff55e1fb7165e9bca98aead8d6c49c6ff73926973c6ba6347f0ee17eba
+bhasdfhsdf=
 
 pre_build() {
 	local _date
@@ -32,4 +33,5 @@ post_install() {
 	vcompletion completions/chezmoi-completion.bash bash
 	vcompletion completions/chezmoi.fish fish
 	vcompletion completions/chezmoi.zsh zsh
+	: $adfsdhfajhsdfjasdf
 }

From 4704820f0d201de60b5bf9e52009018a659ad3e7 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:34:56 -0400
Subject: [PATCH 6/8] XLINT no longer needed

---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0..46072e9f81ea 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index bc12aedd4f8e..b9f3333ccef3 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From 9b540ce86fb31c612930dfb6ebf6214a78e56c81 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:58:24 -0400
Subject: [PATCH 7/8] temp

---
 common/travis/xlint.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index b9f3333ccef3..86da7069aa5f 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -9,9 +9,9 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
-	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xlint "$t" || EXITCODE=$? #> /tmp/xlint_out || EXITCODE=$?
 	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
-	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
+	# awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done
 exit $EXITCODE

From 73b70b8d4b8b8a34635c0ecc092b0de8b939a620 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 19:41:13 -0400
Subject: [PATCH 8/8] fixup! .github/workflows/build.yaml: install shellcheck
 for xlint

---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 22cd62e78aea..a01df8672be4 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -38,7 +38,7 @@ jobs:
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
           # install tools needed for lints
-          xbps-install -y shellcheck grep gawk
+          xbps-install -y shellcheck grep
           xbps-query -l
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Updated] lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
                   ` (17 preceding siblings ...)
  2023-07-08 23:20 ` [PR PATCH] [Updated] " classabbyamp
@ 2023-09-08  8:51 ` classabbyamp
  2023-12-08  1:46 ` github-actions
  2023-12-23  1:45 ` [PR PATCH] [Closed]: " github-actions
  20 siblings, 0 replies; 22+ messages in thread
From: classabbyamp @ 2023-09-08  8:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4250 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xshellcheck
https://github.com/void-linux/void-packages/pull/43949

lint templates with shellcheck
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |

[ci skip]

A patch file from https://github.com/void-linux/void-packages/pull/43949.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xshellcheck-43949.patch --]
[-- Type: text/x-diff, Size: 11947 bytes --]

From 29b8c75abc5c5ad21f4b1f2b0e8fb5853ba637d3 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 15:28:53 -0400
Subject: [PATCH 1/6] common/scripts/template_shellcheck_shim: create shim for
 xshellcheck

---
 common/scripts/template_shellcheck_shim | 398 ++++++++++++++++++++++++
 1 file changed, 398 insertions(+)
 create mode 100644 common/scripts/template_shellcheck_shim

diff --git a/common/scripts/template_shellcheck_shim b/common/scripts/template_shellcheck_shim
new file mode 100644
index 0000000000000..48932d19dbcaf
--- /dev/null
+++ b/common/scripts/template_shellcheck_shim
@@ -0,0 +1,398 @@
+#!/bin/bash
+# this file is for use by xshellcheck from xtools
+#
+# by assigning and using every variable templates should contain,
+# it suppresses SC2034 (unused variable) and SC2154 (possibly unassigned
+# variable). set -e suppresses errors like SC2164 (use cd ... || exit).
+
+set -e
+
+# TODO: do other variables need handling?
+# _*
+# *_descr
+# *_groups
+# *_homedir
+# *_pgroup
+# *_shell
+# desc_option_*
+# build_option_*
+
+# global variables
+CHROOT_READY=
+CROSS_BUILD=
+DESTDIR=
+FILESDIR=
+PKGDESTDIR=
+XBPS_BUILDDIR=
+XBPS_BUILD_ENVIRONMENT=
+XBPS_CHECK_PKGS=
+XBPS_CROSS_BASE=
+XBPS_ENDIAN=
+XBPS_FETCH_CMD=
+XBPS_LIBC=
+XBPS_MACHINE=
+XBPS_MAKEJOBS=
+XBPS_NO_ATOMIC8=
+XBPS_RUST_TARGET=
+XBPS_SRCDISTDIR=
+XBPS_SRCPKGDIR=
+XBPS_TARGET_ENDIAN=
+XBPS_TARGET_LIBC=
+XBPS_TARGET_MACHINE=
+XBPS_TARGET_NO_ATOMIC8=
+XBPS_TARGET_WORDSIZE=
+XBPS_WORDSIZE=
+XBPS_WRAPPERDIR=
+makejobs=
+sourcepkg=
+
+# toolchain variables
+AR=
+AS=
+CC=
+CFLAGS=
+CPP=
+CPPFLAGS=
+CXX=
+CXXFLAGS=
+GCC=
+LD=
+LDFLAGS=
+LD_LIBRARY_PATH=
+NM=
+OBJCOPY=
+OBJDUMP=
+RANLIB=
+READELF=
+STRIP=
+
+# available variables
+allow_unknown_shlibs=
+alternatives=
+archs=
+binfmts=
+bootstrap=
+broken=
+build_helper=
+build_options=
+build_options_default=
+build_style=
+build_wrksrc=
+changelog=
+checkdepends=
+checksum=
+conf_files=
+configure_args=
+configure_script=
+conflicts=
+create_wrksrc=
+depends=
+disable_parallel_build=
+disable_parallel_check=
+distfiles=
+dkms_modules=
+fetch_cmd=
+font_dirs=
+force_debug_pkgs=
+gconf_entries=
+gconf_schemas=
+homepage=
+hostmakedepends=
+ignore_elf_dirs=
+ignore_elf_files=
+keep_libtool_archives=
+kernel_hooks_version=
+lib32depends=
+lib32disabled=
+lib32files=
+lib32mode=
+lib32symlinks=
+license=
+maintainer=
+make_build_args=
+make_build_target=
+make_check=
+make_check_args=
+make_check_pre=
+make_check_target=
+make_cmd=
+make_dirs=
+make_install_args=
+make_install_target=
+make_use_env=
+makedepends=
+mutable_files=
+no_generic_pkgconfig_link=
+nocheckperms=
+nocross=
+nodebug=
+nofixperms=
+nopie=
+nopie_files=
+noshlibprovides=
+nostrip=
+nostrip_files=
+noverifyrdeps=
+patch_args=
+perl_configure_dirs=
+pkgname=
+preserve=
+provides=
+register_shell=
+replaces=
+repository=
+restricted=
+reverts=
+revision=
+sgml_entries=
+shlib_provides=
+shlib_requires=
+short_desc=
+skip_extraction=
+skiprdeps=
+subpackages=
+system_accounts=
+system_groups=
+tags=
+triggers=
+version=
+wrksrc=
+xml_catalogs=
+xml_entries=
+
+# go
+go_build_tags=
+go_import_path=
+go_ldflags=
+go_mod_mode=
+go_package=
+
+# cmake
+cmake_builddir=
+
+# gemspec
+gem_cmd=
+
+# haskell-stack
+stackage=
+
+# meson
+meson_builddir=
+meson_cmd=
+meson_crossfile=
+
+# python*
+py2_inc=
+py2_lib=
+py2_sitelib=
+py2_ver=
+py3_inc=
+py3_lib=
+py3_sitelib=
+py3_ver=
+pycompile_dirs=
+pycompile_module=
+python_version=
+
+# void-cross
+cross_binutils_configure_args=
+cross_gcc_bootstrap_configure_args=
+cross_gcc_configure_args=
+cross_gcc_skip_go=
+cross_glibc_cflags=
+cross_glibc_configure_args=
+cross_glibc_ldflags=
+cross_musl_cflags=
+cross_musl_configure_args=
+cross_musl_ldflags=
+
+. template
+
+# global variables
+: "$CHROOT_READY"
+: "$CROSS_BUILD"
+: "$DESTDIR"
+: "$FILESDIR"
+: "$PKGDESTDIR"
+: "$XBPS_BUILDDIR"
+: "$XBPS_BUILD_ENVIRONMENT"
+: "$XBPS_CHECK_PKGS"
+: "$XBPS_CROSS_BASE"
+: "$XBPS_ENDIAN"
+: "$XBPS_FETCH_CMD"
+: "$XBPS_LIBC"
+: "$XBPS_MACHINE"
+: "$XBPS_MAKEJOBS"
+: "$XBPS_NO_ATOMIC8"
+: "$XBPS_RUST_TARGET"
+: "$XBPS_SRCDISTDIR"
+: "$XBPS_SRCPKGDIR"
+: "$XBPS_TARGET_ENDIAN"
+: "$XBPS_TARGET_LIBC"
+: "$XBPS_TARGET_MACHINE"
+: "$XBPS_TARGET_NO_ATOMIC8"
+: "$XBPS_TARGET_WORDSIZE"
+: "$XBPS_WORDSIZE"
+: "$XBPS_WRAPPERDIR"
+: "$makejobs"
+: "$sourcepkg"
+
+# toolchain variables
+: "$AR"
+: "$AS"
+: "$CC"
+: "$CFLAGS"
+: "$CPP"
+: "$CPPFLAGS"
+: "$CXX"
+: "$CXXFLAGS"
+: "$GCC"
+: "$LD"
+: "$LDFLAGS"
+: "$LD_LIBRARY_PATH"
+: "$NM"
+: "$OBJCOPY"
+: "$OBJDUMP"
+: "$RANLIB"
+: "$READELF"
+: "$STRIP"
+
+# available variables
+: "$allow_unknown_shlibs"
+: "$alternatives"
+: "$archs"
+: "$binfmts"
+: "$bootstrap"
+: "$broken"
+: "$build_helper"
+: "$build_options"
+: "$build_options_default"
+: "$build_style"
+: "$build_wrksrc"
+: "$changelog"
+: "$checkdepends"
+: "$checksum"
+: "$conf_files"
+: "$configure_args"
+: "$configure_script"
+: "$conflicts"
+: "$create_wrksrc"
+: "$depends"
+: "$disable_parallel_build"
+: "$disable_parallel_check"
+: "$distfiles"
+: "$dkms_modules"
+: "$fetch_cmd"
+: "$font_dirs"
+: "$force_debug_pkgs"
+: "$gconf_entries"
+: "$gconf_schemas"
+: "$homepage"
+: "$hostmakedepends"
+: "$ignore_elf_dirs"
+: "$ignore_elf_files"
+: "$keep_libtool_archives"
+: "$kernel_hooks_version"
+: "$lib32depends"
+: "$lib32disabled"
+: "$lib32files"
+: "$lib32mode"
+: "$lib32symlinks"
+: "$license"
+: "$maintainer"
+: "$make_build_args"
+: "$make_build_target"
+: "$make_check"
+: "$make_check_args"
+: "$make_check_pre"
+: "$make_check_target"
+: "$make_cmd"
+: "$make_dirs"
+: "$make_install_args"
+: "$make_install_target"
+: "$make_use_env"
+: "$makedepends"
+: "$mutable_files"
+: "$no_generic_pkgconfig_link"
+: "$nocheckperms"
+: "$nocross"
+: "$nodebug"
+: "$nofixperms"
+: "$nopie"
+: "$nopie_files"
+: "$noshlibprovides"
+: "$nostrip"
+: "$nostrip_files"
+: "$noverifyrdeps"
+: "$patch_args"
+: "$perl_configure_dirs"
+: "$pkgname"
+: "$preserve"
+: "$provides"
+: "$register_shell"
+: "$replaces"
+: "$repository"
+: "$restricted"
+: "$reverts"
+: "$revision"
+: "$sgml_entries"
+: "$shlib_provides"
+: "$shlib_requires"
+: "$short_desc"
+: "$skip_extraction"
+: "$skiprdeps"
+: "$subpackages"
+: "$system_accounts"
+: "$system_groups"
+: "$tags"
+: "$triggers"
+: "$version"
+: "$wrksrc"
+: "$xml_catalogs"
+: "$xml_entries"
+
+# go
+: "$go_build_tags"
+: "$go_import_path"
+: "$go_ldflags"
+: "$go_mod_mode"
+: "$go_package"
+
+# cmake
+: "$cmake_builddir"
+
+# gemspec
+: "$gem_cmd"
+
+# haskell-stack
+: "$stackage"
+
+# meson
+: "$meson_builddir"
+: "$meson_cmd"
+: "$meson_crossfile"
+
+# python*
+: "$py2_inc"
+: "$py2_lib"
+: "$py2_sitelib"
+: "$py2_ver"
+: "$py3_inc"
+: "$py3_lib"
+: "$py3_sitelib"
+: "$py3_ver"
+: "$pycompile_dirs"
+: "$pycompile_module"
+: "$python_version"
+
+# void-cross
+: "$cross_binutils_configure_args"
+: "$cross_gcc_bootstrap_configure_args"
+: "$cross_gcc_configure_args"
+: "$cross_gcc_skip_go"
+: "$cross_glibc_cflags"
+: "$cross_glibc_configure_args"
+: "$cross_glibc_ldflags"
+: "$cross_musl_cflags"
+: "$cross_musl_configure_args"
+: "$cross_musl_ldflags"

From 82ccedd90c85f7414eaf65e15b3ab0c63a918984 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:14 -0400
Subject: [PATCH 2/6] .github/workflows/build.yaml: install shellcheck for
 xlint

---
 .github/workflows/build.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index d860feff70d38..7def24d9d208c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -25,6 +25,7 @@ jobs:
       env:
         PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
         LICENSE_LIST: common/travis/license.lst
+        XSHELLCHECK_ARGS: --color=always
 
     steps:
       - name: Prepare container
@@ -37,7 +38,7 @@ jobs:
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
           # install tools needed for lints
-          xbps-install -y grep curl
+          xbps-install -y grep curl shellcheck gawk
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - name: Create hostrepo and prepare masterdir

From fb65e10ac68f81f685a2217ecf00a2ad1f7cd38b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:14:57 -0400
Subject: [PATCH 3/6] common/travis/xlint.sh: run xshellcheck

---
 common/travis/xlint.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 0b2d12d0b0d04..b9f3333ccef3c 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -10,6 +10,7 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
 	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
 	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done

From 5e108410767a7580b5da09e2221278e1e29253b3 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:15:17 -0400
Subject: [PATCH 4/6] TEMP: switch xtools fork/branch for xshellcheck

---
 common/travis/fetch-xtools.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/travis/fetch-xtools.sh b/common/travis/fetch-xtools.sh
index 0dd9e6c532c06..6795b1afc3132 100755
--- a/common/travis/fetch-xtools.sh
+++ b/common/travis/fetch-xtools.sh
@@ -4,7 +4,7 @@
 
 TAR=tar
 command -v bsdtar >/dev/null && TAR=bsdtar
-URL="https://github.com/leahneukirchen/xtools/archive/master.tar.gz"
+URL="https://github.com/classabbyamp/xtools/archive/xshellcheck.tar.gz"
 FILE="xtools.tar.gz"
 
 mkdir -p /tmp/bin

From 33012c402cc7be41724e66145ebeb18a33bd3575 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 16:16:23 -0400
Subject: [PATCH 5/6] TEMP: something to shellcheck

---
 srcpkgs/chezmoi/template | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index 315131953a149..c24c9f9d8b999 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -14,6 +14,7 @@ homepage="https://chezmoi.io/"
 changelog="https://github.com/twpayne/chezmoi/releases"
 distfiles="https://github.com/twpayne/chezmoi/archive/v${version}.tar.gz"
 checksum=e2c30b9cf023c50083d5cacec36a73088d4bb31548f3251a3baa275717e20817
+bhasdfhsdf=
 
 pre_build() {
 	local _date
@@ -32,4 +33,5 @@ post_install() {
 	vcompletion completions/chezmoi-completion.bash bash
 	vcompletion completions/chezmoi.fish fish
 	vcompletion completions/chezmoi.zsh zsh
+	: $adfsdhfajhsdfjasdf
 }

From 049cb76df34dbbd8f8af9ea5fc165427b8b4ac63 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 19 May 2023 18:58:24 -0400
Subject: [PATCH 6/6] temp

---
 common/travis/xlint.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index b9f3333ccef3c..86da7069aa5f7 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -9,9 +9,9 @@ common/scripts/lint-commits $base $tip || EXITCODE=$?
 
 for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
 	/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
-	xlint "$t" > /tmp/xlint_out || EXITCODE=$?
+	xlint "$t" || EXITCODE=$? #> /tmp/xlint_out || EXITCODE=$?
 	xshellcheck "$t" || EXITCODE=$?
 	common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
-	awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
+	# awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out
 done
 exit $EXITCODE

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
                   ` (18 preceding siblings ...)
  2023-09-08  8:51 ` classabbyamp
@ 2023-12-08  1:46 ` github-actions
  2023-12-23  1:45 ` [PR PATCH] [Closed]: " github-actions
  20 siblings, 0 replies; 22+ messages in thread
From: github-actions @ 2023-12-08  1:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/pull/43949#issuecomment-1846429657

Comment:
Pull Requests become stale 90 days after last activity and are closed 14 days after that.  If this pull request is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PR PATCH] [Closed]: lint templates with shellcheck
  2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
                   ` (19 preceding siblings ...)
  2023-12-08  1:46 ` github-actions
@ 2023-12-23  1:45 ` github-actions
  20 siblings, 0 replies; 22+ messages in thread
From: github-actions @ 2023-12-23  1:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4080 bytes --]

There's a closed pull request on the void-packages repository

lint templates with shellcheck
https://github.com/void-linux/void-packages/pull/43949

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

we may want to disable some warnings by default, currently these warnings are raised:

| count | code   | wiki link                              |
|------:|:-------|:---------------------------------------|
|  8516 | SC2086 | https://www.shellcheck.net/wiki/SC2086 |
|   499 | SC2034 | https://www.shellcheck.net/wiki/SC2034 |
|   287 | SC2016 | https://www.shellcheck.net/wiki/SC2016 |
|   156 | SC2091 | https://www.shellcheck.net/wiki/SC2091 |
|   144 | SC2046 | https://www.shellcheck.net/wiki/SC2046 |
|   103 | SC2035 | https://www.shellcheck.net/wiki/SC2035 |
|    83 | SC2154 | https://www.shellcheck.net/wiki/SC2154 |
|    75 | SC2209 | https://www.shellcheck.net/wiki/SC2209 |
|    73 | SC2231 | https://www.shellcheck.net/wiki/SC2231 |
|    59 | SC2155 | https://www.shellcheck.net/wiki/SC2155 |
|    53 | SC2044 | https://www.shellcheck.net/wiki/SC2044 |
|    39 | SC2295 | https://www.shellcheck.net/wiki/SC2295 |
|    36 | SC2115 | https://www.shellcheck.net/wiki/SC2115 |
|    28 | SC2166 | https://www.shellcheck.net/wiki/SC2166 |
|    22 | SC2185 | https://www.shellcheck.net/wiki/SC2185 |
|    21 | SC2103 | https://www.shellcheck.net/wiki/SC2103 |
|    19 | SC1091 | https://www.shellcheck.net/wiki/SC1091 |
|    13 | SC2043 | https://www.shellcheck.net/wiki/SC2043 |
|    12 | SC2162 | https://www.shellcheck.net/wiki/SC2162 |
|    12 | SC2001 | https://www.shellcheck.net/wiki/SC2001 |
|    10 | SC2129 | https://www.shellcheck.net/wiki/SC2129 |
|     9 | SC2098 | https://www.shellcheck.net/wiki/SC2098 |
|     9 | SC2038 | https://www.shellcheck.net/wiki/SC2038 |
|     7 | SC2031 | https://www.shellcheck.net/wiki/SC2031 |
|     6 | SC2090 | https://www.shellcheck.net/wiki/SC2090 |
|     6 | SC2013 | https://www.shellcheck.net/wiki/SC2013 |
|     5 | SC2140 | https://www.shellcheck.net/wiki/SC2140 |
|     5 | SC2097 | https://www.shellcheck.net/wiki/SC2097 |
|     5 | SC2045 | https://www.shellcheck.net/wiki/SC2045 |
|     4 | SC2261 | https://www.shellcheck.net/wiki/SC2261 |
|     4 | SC2153 | https://www.shellcheck.net/wiki/SC2153 |
|     4 | SC2015 | https://www.shellcheck.net/wiki/SC2015 |
|     3 | SC2269 | https://www.shellcheck.net/wiki/SC2269 |
|     3 | SC2223 | https://www.shellcheck.net/wiki/SC2223 |
|     3 | SC2196 | https://www.shellcheck.net/wiki/SC2196 |
|     3 | SC2089 | https://www.shellcheck.net/wiki/SC2089 |
|     3 | SC2061 | https://www.shellcheck.net/wiki/SC2061 |
|     3 | SC2059 | https://www.shellcheck.net/wiki/SC2059 |
|     3 | SC2030 | https://www.shellcheck.net/wiki/SC2030 |
|     3 | SC2004 | https://www.shellcheck.net/wiki/SC2004 |
|     3 | SC2002 | https://www.shellcheck.net/wiki/SC2002 |
|     2 | SC2237 | https://www.shellcheck.net/wiki/SC2237 |
|     2 | SC2125 | https://www.shellcheck.net/wiki/SC2125 |
|     2 | SC2094 | https://www.shellcheck.net/wiki/SC2094 |
|     2 | SC2005 | https://www.shellcheck.net/wiki/SC2005 |
|     1 | SC2222 | https://www.shellcheck.net/wiki/SC2222 |
|     1 | SC2221 | https://www.shellcheck.net/wiki/SC2221 |
|     1 | SC2207 | https://www.shellcheck.net/wiki/SC2207 |
|     1 | SC2168 | https://www.shellcheck.net/wiki/SC2168 |
|     1 | SC2145 | https://www.shellcheck.net/wiki/SC2145 |
|     1 | SC2144 | https://www.shellcheck.net/wiki/SC2144 |
|     1 | SC2102 | https://www.shellcheck.net/wiki/SC2102 |
|     1 | SC2100 | https://www.shellcheck.net/wiki/SC2100 |
|     1 | SC2078 | https://www.shellcheck.net/wiki/SC2078 |
|     1 | SC2068 | https://www.shellcheck.net/wiki/SC2068 |
|     1 | SC2012 | https://www.shellcheck.net/wiki/SC2012 |
|     1 | SC2010 | https://www.shellcheck.net/wiki/SC2010 |
|     1 | SC1090 | https://www.shellcheck.net/wiki/SC1090 |

[ci skip]

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2023-12-23  1:45 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-19 19:57 [PR PATCH] common/scripts/template_shellcheck_shim: create shim for xshellcheck classabbyamp
2023-05-19 20:16 ` [PR PATCH] [Updated] lint templates with shellcheck classabbyamp
2023-05-19 20:23 ` classabbyamp
2023-05-19 20:26 ` classabbyamp
2023-05-19 20:28 ` classabbyamp
2023-05-19 20:33 ` classabbyamp
2023-05-19 20:35 ` classabbyamp
2023-05-19 20:37 ` classabbyamp
2023-05-19 21:53 ` classabbyamp
2023-05-19 22:24 ` classabbyamp
2023-05-19 22:27 ` classabbyamp
2023-05-19 22:37 ` classabbyamp
2023-05-19 22:58 ` classabbyamp
2023-05-19 23:09 ` classabbyamp
2023-05-19 23:25 ` classabbyamp
2023-05-19 23:28 ` classabbyamp
2023-05-19 23:41 ` classabbyamp
2023-07-08 22:00 ` Chocimier
2023-07-08 23:20 ` [PR PATCH] [Updated] " classabbyamp
2023-09-08  8:51 ` classabbyamp
2023-12-08  1:46 ` github-actions
2023-12-23  1:45 ` [PR PATCH] [Closed]: " github-actions

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).