mirror of
https://git.busybox.net/buildroot.git
synced 2024-11-30 17:03:31 +08:00
c5a3dfb9a4
Currently only SysV init scripts are checked using shellcheck and a few other rules (e.g. variable naming, file naming). Extend the check using shellcheck to all shell scripts in the tree. This is actually limited to the list of directories that check-package knows that can check, but that list can be expanded later. In order to apply the check to all shell scripts, use python3-magic to determine the file type. Unfortunately, there are two different python modules called "magic". Support both by detecting which one is installed and defining get_filetype accordingly. Keep testing first for name pattern, and only in the case there is no match, check the file type. This ensures, for instance, that SysV init scripts follow specific rules. Apply these checks for shell scripts: - shellcheck; - trailing space; - consecutive empty lines; - empty last line on file; - newline at end of file. Update the list of ignored warnings. Do not add unit tests since no function was added, they were just reused. But expand the runtime test for check-package using as fixture a file that generates a shellcheck warning. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> [Arnout: support both variants of the "magic" module] Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
201 lines
10 KiB
Plaintext
201 lines
10 KiB
Plaintext
package/alsamixergui/0001-misc-fixes.patch Sob
|
|
package/am33x-cm3/S93-am335x-pm-firmware-load Variables
|
|
package/android-tools/0008-Include-sysmacros.h-to-compile-with-glibc-2.28.patch Sob
|
|
package/apache/S50apache Indent Shellcheck Variables
|
|
package/at/S99at Indent Variables
|
|
package/audit/S02auditd Shellcheck Variables
|
|
package/avahi/S05avahi-setup.sh Indent Variables
|
|
package/avahi/S50avahi-daemon Indent Variables
|
|
package/babeld/S50babeld Indent Shellcheck Variables
|
|
package/bind/S81named Indent Shellcheck Variables
|
|
package/bluez5_utils/S40bluetooth NotExecutable Variables
|
|
package/boinc/S99boinc-client Indent Shellcheck Variables
|
|
package/brickd/S70brickd Indent Shellcheck Variables
|
|
package/brltty/S10brltty Indent Shellcheck Variables
|
|
package/busybox/S02sysctl Variables
|
|
package/busybox/S10mdev ConsecutiveEmptyLines Indent Shellcheck
|
|
package/busybox/S15watchdog Indent Variables
|
|
package/busybox/S50telnet Indent Shellcheck Variables
|
|
package/busybox/udhcpc.script Shellcheck
|
|
package/c-icap/S96cicap Indent Shellcheck Variables
|
|
package/cfm/S65cfm Indent Variables
|
|
package/cgroupfs-mount/S30cgroupfs Indent Shellcheck Variables
|
|
package/chrony/S49chrony Indent Shellcheck Variables
|
|
package/connman/S45connman Variables
|
|
package/coremark-pro/coremark-pro.sh.in Shellcheck
|
|
package/curlftpfs/0001-fix-CURLOPT_INFILESIZE.patch Sob
|
|
package/curlftpfs/0002-free_ftpfs_file-memleak-fix.patch Sob
|
|
package/curlftpfs/0003-nocache-memleak-fix.patch Sob
|
|
package/dante/S50dante Indent Shellcheck Variables
|
|
package/darkhttpd/S50darkhttpd Indent Shellcheck Variables
|
|
package/dbus/S30dbus Indent Shellcheck TrailingSpace Variables
|
|
package/dcron/S90dcron Variables
|
|
package/dhcp/S80dhcp-relay Shellcheck Variables
|
|
package/dhcp/S80dhcp-server Shellcheck Variables
|
|
package/dhcp/dhclient-script Shellcheck TrailingSpace
|
|
package/dhcpcd/S41dhcpcd Indent Variables
|
|
package/dhrystone/0001-cmdline-nruns.patch Sob
|
|
package/dhrystone/0002-HZ.patch Sob
|
|
package/dhrystone/0003-exit.patch Sob
|
|
package/dhrystone/0004-headers.patch Sob
|
|
package/dhrystone/0005-prototypes.patch Sob
|
|
package/directfb-examples/0001-remove-bzero.patch Sob
|
|
package/dmraid/S20dmraid Variables
|
|
package/dnsmasq/S80dnsmasq Shellcheck Variables
|
|
package/docker-engine/S60dockerd Indent Shellcheck Variables
|
|
package/domoticz/S99domoticz Shellcheck
|
|
package/dracut/merged-usr-module-setup.sh Shellcheck
|
|
package/dropbear/S50dropbear Indent Shellcheck Variables
|
|
package/earlyoom/S02earlyoom Indent Shellcheck
|
|
package/ejabberd/S50ejabberd Indent Shellcheck Variables
|
|
package/ejabberd/check-erlang-lib Shellcheck
|
|
package/eudev/S10udev ConsecutiveEmptyLines Indent Shellcheck Variables
|
|
package/exim/S86exim Indent Variables
|
|
package/fail2ban/S60fail2ban Shellcheck Variables
|
|
package/fakedate/fakedate Shellcheck
|
|
package/fbv/0001-cross.patch Sob
|
|
package/fbv/0002-fix-24bpp-support-on-big-endian.patch Sob
|
|
package/fbv/0005-include.patch Sob
|
|
package/freescale-imx/imx-uuc/S80imx-uuc Indent Shellcheck Variables
|
|
package/frr/S50frr Shellcheck
|
|
package/gamin/0002-no-const-return.patch Sob
|
|
package/gcc/arc-2020.09-release/0002-libsanitizer-Remove-cyclades-from-libsanitizer.patch Sob
|
|
package/genromfs/0001-build-system.patch Sob
|
|
package/gerbera/S99gerbera Indent
|
|
package/google-breakpad/gen-syms.sh Shellcheck
|
|
package/gpsd/S50gpsd Indent Shellcheck Variables
|
|
package/haveged/S21haveged Shellcheck Variables
|
|
package/htpdate/S43htpdate Shellcheck
|
|
package/i2pd/S99i2pd Indent Shellcheck Variables
|
|
package/ifplugd/0001-cross.patch Sob
|
|
package/ifplugd/0002-fix-headers.patch Sob
|
|
package/ifupdown-scripts/S40network EmptyLastLine Indent Shellcheck Variables
|
|
package/ifupdown-scripts/network/if-pre-up.d/wait_iface EmptyLastLine Shellcheck
|
|
package/ifupdown-scripts/nfs_check Shellcheck
|
|
package/igd2-for-linux/S99upnpd Indent Shellcheck Variables
|
|
package/inadyn/S70inadyn Indent NotExecutable
|
|
package/initscripts/init.d/rcK ConsecutiveEmptyLines EmptyLastLine Shellcheck
|
|
package/initscripts/init.d/rcS ConsecutiveEmptyLines EmptyLastLine Shellcheck
|
|
package/input-event-daemon/S99input-event-daemon ConsecutiveEmptyLines Indent Variables
|
|
package/iptables/S35iptables Shellcheck
|
|
package/irda-utils/0001-daemon.patch Sob
|
|
package/irda-utils/0002-nommu.patch Sob
|
|
package/irda-utils/0003-subdir.patch Sob
|
|
package/irqbalance/S13irqbalance Indent Shellcheck Variables
|
|
package/iucode-tool/S00iucode-tool Variables
|
|
package/iwd/S40iwd Shellcheck Variables
|
|
package/keyutils/0002-cifs.patch Sob
|
|
package/kodi/S50kodi Shellcheck Variables
|
|
package/libart/0001-art-config-cross.patch Sob
|
|
package/libcgicc/0001-disable-documentation-option.patch Sob
|
|
package/libfcgi/0002-disable-examples.patch Sob
|
|
package/libftdi/0001-pkgconfig_libusb.patch Sob
|
|
package/libftdi/0002-libftdi.pc-requires-libusb-fix-static-build.patch Sob
|
|
package/libiio/S99iiod Shellcheck Variables
|
|
package/libmad/0001-mips-h-constraint-removal.patch Sob
|
|
package/lighttpd/S50lighttpd EmptyLastLine Indent Shellcheck Variables
|
|
package/linux-tools/S10hyperv Indent Variables
|
|
package/linuxptp/S65ptp4l Indent Shellcheck
|
|
package/linuxptp/S66phc2sys Indent Shellcheck
|
|
package/lirc-tools/S25lircd Indent Variables
|
|
package/lite/0001-dfbspy-stat.patch Sob
|
|
package/lite/0002-no-tests.patch Sob
|
|
package/lite/0003-pkg-config.patch Sob
|
|
package/lldpd/S60lldpd Indent Shellcheck Variables
|
|
package/lockfile-progs/0001-sus3v-legacy.patch Sob
|
|
package/madplay/0001-switch-to-new-alsa-api.patch Sob
|
|
package/mariadb/S97mysqld Indent Shellcheck Variables
|
|
package/matchbox-keyboard/mb-applet-kbd-wrapper.sh Shellcheck TrailingSpace
|
|
package/mender-connect/S43mender-connect Shellcheck
|
|
package/mii-diag/0001-strchr.patch Sob
|
|
package/minidlna/S60minidlnad Indent Shellcheck Variables
|
|
package/minissdpd/S50minissdpd Indent Shellcheck Variables
|
|
package/modem-manager/S44modem-manager Shellcheck Variables
|
|
package/mosquitto/S50mosquitto Indent Shellcheck Variables
|
|
package/motion/S99motion Indent Shellcheck Variables
|
|
package/mpd/S95mpd Variables
|
|
package/mrouted/S41mrouted NotExecutable
|
|
package/mrp/S65mrp Indent Variables
|
|
package/multipath-tools/S60multipathd Shellcheck
|
|
package/neard/S53neard Indent Shellcheck Variables
|
|
package/netatalk/S50netatalk EmptyLastLine Indent Variables
|
|
package/netcat/0001-signed-bit-counting.patch Sob
|
|
package/netopeer2/S52netopeer2 Shellcheck Variables
|
|
package/netplug/0001-makefile-flags.patch Sob
|
|
package/netplug/S29netplug Indent Shellcheck Variables
|
|
package/netplug/netplug-script ConsecutiveEmptyLines Shellcheck
|
|
package/netsnmp/S59snmpd Indent Shellcheck Variables
|
|
package/network-manager/S45network-manager ConsecutiveEmptyLines EmptyLastLine Shellcheck Variables
|
|
package/nfs-utils/S60nfs ConsecutiveEmptyLines Shellcheck Variables
|
|
package/nginx/S50nginx Indent Variables
|
|
package/nodm/S90nodm Indent Shellcheck Variables
|
|
package/nss-pam-ldapd/S45nslcd EmptyLastLine Indent Shellcheck Variables
|
|
package/ntp/S49ntp.in Variables
|
|
package/ofono/S46ofono Variables
|
|
package/olsr/S50olsr Indent Shellcheck Variables
|
|
package/openntpd/S49ntp Shellcheck Variables
|
|
package/openssh/S50sshd EmptyLastLine Indent Variables
|
|
package/openvmtools/shutdown Shellcheck
|
|
package/openvpn/S60openvpn Indent Shellcheck Variables
|
|
package/oracle-mysql/S97mysqld Shellcheck Variables
|
|
package/owfs/S55owserver Shellcheck Variables
|
|
package/owfs/S60owfs Shellcheck Variables
|
|
package/pigpio/S50pigpio Shellcheck Variables
|
|
package/pkgconf/pkg-config.in Shellcheck
|
|
package/poco/0001-Fix-optional-JSON-support-for-MySQL-3753.patch Sob
|
|
package/postgresql/S50postgresql Variables
|
|
package/procps-ng/S02sysctl Variables
|
|
package/proftpd/S50proftpd Indent Shellcheck Variables
|
|
package/prosody/S50prosody Indent Shellcheck Variables
|
|
package/ptpd/S65ptpd Indent Shellcheck Variables
|
|
package/ptpd2/S65ptpd2 Indent Shellcheck Variables
|
|
package/pulseaudio/S50pulseaudio ConsecutiveEmptyLines EmptyLastLine Indent Variables
|
|
package/python-web2py/S51web2py Shellcheck Variables
|
|
package/rdesktop/0001-8bit-colors.patch Sob
|
|
package/redis/S50redis Shellcheck Variables
|
|
package/restorecond/S02restorecond Shellcheck
|
|
package/rng-tools/S21rngd Shellcheck Variables
|
|
package/rpcbind/S30rpcbind EmptyLastLine Indent Variables
|
|
package/rubix/0002-misc-fixes.patch Sob
|
|
package/rygel/S99rygel Indent Shellcheck Variables
|
|
package/samba4/S91smb Indent Shellcheck Variables
|
|
package/seatd/S70seatd NotExecutable Variables
|
|
package/ser2net/S50ser2net Indent Shellcheck Variables
|
|
package/shairport-sync/S99shairport-sync Indent Shellcheck Variables
|
|
package/skeleton-init-systemd/fakeroot_tmpfiles.sh Shellcheck
|
|
package/smcroute/S41smcroute Indent NotExecutable Variables
|
|
package/smstools3/S50smsd Shellcheck Variables
|
|
package/solarus/0002-Add-a-basic-FindOpenGLES2.cmake.patch Sob
|
|
package/squid/S97squid Indent Shellcheck Variables
|
|
package/sshguard/S49sshguard Indent
|
|
package/sslh/S35sslh Indent Shellcheck Variables
|
|
package/stunnel/S50stunnel Indent Shellcheck Variables
|
|
package/supervisor/S99supervisord Variables
|
|
package/suricata/S99suricata Shellcheck
|
|
package/swupdate/swupdate.sh Shellcheck
|
|
package/sysrepo/S51sysrepo-plugind Indent Shellcheck
|
|
package/targetcli-fb/S50target Shellcheck Variables
|
|
package/tcf-agent/S55tcf-agent Shellcheck Variables
|
|
package/tftpd/S80tftpd-hpa Indent Shellcheck Variables
|
|
package/ti-gfx/S80ti-gfx Shellcheck Variables
|
|
package/ti-gfx/esrev.sh Shellcheck
|
|
package/ti-sgx-um/S80ti-sgx Variables
|
|
package/tpm2-abrmd/S80tpm2-abrmd Indent Shellcheck Variables
|
|
package/transmission/S92transmission ConsecutiveEmptyLines Indent Shellcheck Variables
|
|
package/triggerhappy/S10triggerhappy Indent Shellcheck Variables
|
|
package/tvheadend/S99tvheadend Indent Shellcheck Variables
|
|
package/unbound/S70unbound Shellcheck
|
|
package/unscd/S46unscd Indent Shellcheck Variables
|
|
package/upmpdcli/S99upmpdcli Indent Shellcheck Variables
|
|
package/usbguard/S20usbguard Indent Shellcheck Variables
|
|
package/vala/vala-wrapper Shellcheck
|
|
package/vsftpd/S70vsftpd Indent Shellcheck Variables
|
|
package/watchdogd/S01watchdogd Indent NotExecutable
|
|
package/wpa_supplicant/ifupdown.sh Shellcheck
|
|
package/x11r7/xapp_xdm/S99xdm Indent Variables
|
|
package/x11r7/xdriver_xf86-video-mach64/0001-cross-compile.patch Sob
|
|
package/x11r7/xdriver_xf86-video-savage/0001-cross-compile.patch Sob
|
|
package/x11r7/xdriver_xf86-video-tdfx/0001-cross.patch Sob
|
|
package/x11r7/xserver_xorg-server/S40xorg Shellcheck Variables
|
|
package/xl2tp/xl2tpd TrailingSpace
|