aboutsummaryrefslogtreecommitdiff
path: root/lint/bin.sh
Commit message (Collapse)AuthorAgeFilesLines
* Remove diagnostic messages from check/lint scriptsTom Ryder2018-12-191-4/+0
| | | | So that `make -s` works nicely.
* Use "shell" not "sh" consistentlyTom Ryder2017-10-311-1/+1
| | | | | I'm going to pretend this is a crucially important production fix, in order to try out the "hotfix" part of the "Git flow" workflow.
* Correct some vestigial programs to shell namesTom Ryder2017-10-311-1/+1
| | | | Just for consistency.
* Add option terminators to some stray `set` callsTom Ryder2017-10-311-2/+2
| | | | | | | | | | Adding the option terminator "--" directly after the `set` call ensures that all following arguments will be interpreted as new arguments for the list. This is probably not strictly applicable here, because the paths that will be stacked up don't start with dashes by definition, but it's likely good practice.
* Use shell name not command in check/lint messagesTom Ryder2017-10-311-3/+3
| | | | This is a little bit clearer and nicer to read, I think.
* Correct copypaste errors in `check-bin`, `lint-bin`Tom Ryder2017-10-311-3/+3
| | | | | Use consistent variable names, and strip the correct suffix from the Bash scripts on iteration.
* Add conditional Bash `check-bin`, `lint-bin`Tom Ryder2017-10-311-0/+13
| | | | | | Both blocks are analogues of the POSIX checks, but are wrapped in a conditional so that bash(1) doesn't become a hard dependency of the default `make install` target.
* Show explicit success message for `lint-bin`Tom Ryder2017-10-311-1/+2
| | | | | We add an `|| exit` short-circuit for the case of `shellcheck` exiting non-zero.
* Adjust `check-bin`, `lint-bin` for built scriptsTom Ryder2017-10-311-1/+5
| | | | | | | | | | | | | | | | Make the `$(BINS)` target a prerequisite of `check-bin` so that all of the scripts with a #!/bin/sh shebang are built, and then check them all by iterating through a glob (and hence an order according to LC_COLLATE) and stripping the `.sh` suffix to find the name of the matching shebanged script. Leverage `shellcheck`'s support of multiple check arguments to build an argument list of the binscripts first before passing all of those to a single call, simply for speed. We don't have anything in this target to test the scripts of any other type, such as the `.awk` or `.sed` scripts. `gawk` has a `--lint` mode that might apply.
* Revert "Drastically simplify `lint` scripts"Tom Ryder2017-10-311-2/+1
| | | | | | | | | | | | I forgot that the `lint` tools here need to check the *built* files, and that that's the reason the `perlcritic` check against the source .pl file was failing. While it's still true that it would be preferable to test the files found in a deterministic order, this branch's attempt to address that issue is pretty much nonsense and can be abandoned. This reverts commit 196155499c04b2c2050302e6575f1bcbbed052f1.
* Drastically simplify `lint` scriptsTom Ryder2017-10-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using find(1) to run the appropriate lint program over a set of files allows us to be terse and deal a little more dynamically with new files placed in the directories, but the downsides are that it's error-prone and that the order of testing is not predictable, and we'd ideally like the testing to be a little more deterministic than that. Case in point: writing the code for this commit unintentionally uncovered a longstanding issue where the URxvt Perl script `select.pl` was actually not being checked at all, due to an unneeded exclamation mark inverting the `-name` test for `*.pl` files. `select.pl` is presently not passing `perlcritic --brutal` on my machine, and likely has not been compliant since as early as commit 5000365 in March this year: >commit 500036564541ff2d65a7b2f6f6f556202d72d6ce >Author: Tom Ryder <tom@sanctum.geek.nz> >Date: Fri Mar 24 11:01:05 2017 > > Lots of Makefile tidying > > ... > * Favour find(1) calls over shell loops > ... This commit also more clearly delineates between the language being "linted" and the target for which it's being linted. The latter is likely more desirable. This needs clarification.
* More sh flexibility (check/lint scripts)Tom Ryder2017-04-051-0/+1