path: root/lint
AgeCommit message (Collapse)AuthorFilesLines
2018-12-19Remove diagnostic messages from check/lint scriptsTom Ryder8-11/+0
So that `make -s` works nicely.
2018-06-03Revamp vint script with blacklist not whitelistTom Ryder1-22/+18
2018-06-03Add missing vint targetsTom Ryder1-0/+2
2018-06-03Implement personal filetype.vimTom Ryder1-0/+1
This implements only the syntax highlighting for file types I regularly use and care about, implemented in the way I want them to work, with files named per type in ftdetect/*.vim. I have chosen only file types with which I regularly deal and for which syntax highlighting and filetype/indent plugins are actually useful. Most other files, e.g. system config files I edit infrequently and only with sudoedit(8), don't really benefit from that. Much of this is just copied from the distribution filetype.vim file, but some of it I do specifically in a way I want, such as the shell decision logic. We'll see how well this works.
2018-05-31Update vim-lint script to reflect changesTom Ryder1-1/+11
2018-05-31Junk detect_background.vim and thereby autoloadTom Ryder1-1/+0
It's too complicated and confusing, and doesn't do enough to justify wrecking Vim's own logic for doing this sort of thing. Better to just say `:set background=dark` and be done with it. This is the only one of my inline plugins with an `autoload` file, so we can get rid of that, too. Not worth packaging/publishing to www.vim.org.
2017-11-19Add vim/compiler scripts to vint targetsTom Ryder1-0/+1
2017-11-12Move lots of local Vim config into vim/afterTom Ryder1-1/+0
This is a relatively drastic change that should have been done progressively, but I got carried away in ripping everything out and putting it back in again. Reading the documentation for writing a Vim script (:help usr_41.txt), I am convinced that all of the content that was in the vim/ftplugin directory and some of the vim/indent directory actually belonged in vim/after/ftplugin and vim/after/indent respectively. This is because the section on filetypes makes the distinction between replacing the core filetype or indent plugins and merely adding to or editing them after the fact; from :help ftplugin: > If you do want to use the default plugin, but overrule one of the > settings, you can write the different setting in a script: > > setlocal textwidth=70 > > Now write this in the "after" directory, so that it gets sourced after > the distributed "vim.vim" ftplugin after-directory. For Unix this > would be "~/.vim/after/ftplugin/vim.vim". Note that the default > plugin will have set "b:did_ftplugin", but it is ignored here. Therefore, I have deleted the user_indent.vim and user_ftplugin.vim plugins and their documentation that I wrote, and their ftplugin.vim and indent.vim shims in ~/.vim, in an attempt to make these plugins elegantly undo-ready, and instead embraced the way the documentation and $VIMRUNTIME structure seems to suggest. I broke the ftplugin files up by function and put them under subdirectories of vim/after named by filetype, as the 'runtimepath' layout permits. In doing so, I also carefully applied the documentation's advice: * Short-circuiting repeated loads * Checking for existing mappings using the <Plug> prefix approach * Avoiding repeated function declarations overwriting each other * Guarding against 'cpotions' mangling things (by simply short-circuiting if 'compatible' is set). I've made the b:undo_ftplugin and b:undo_indent commands less forgiving, and append commands to it inline with the initial establishment of the setup they're reversing, including checking that the b:undo_* variable actually exists in the first place. For the indentation scripts, however, three of the four files originally in vim/indent actually do belong there: 1. csv.vim, because it doesn't have an indent file in the core. 2. tsv.vim, because it doesn't have an indent file in the core. 3. php.vim, because it does what ftplugins are allowed to do in preventing the core indent rules from running at all. The indent/vim.vim rules, however, have been moved to after/indent/vim.vim, because the tweaks it makes for two-space indentation are designed to supplement the core indent rules, not replace them. Finally, I've adjusted Makefile targets accordingly for the above, given the vim/ftplugin directory is now empty and there are three new directories in vim/after to install. We wrap these under a single `install-vim-after` parent target for convenience. The `install-vim-after-ftplugin` target accommodates the additional level of filetype directories beneath it.
2017-11-05Add vim/autoload to the lint-vim targetTom Ryder1-0/+1
This directory was created in commit 4c46c80, but its contents haven't been linted with `vint` until now.
2017-11-02Add vim/plugin to lint-vim argumentsTom Ryder1-0/+1
This ensures that new plugin code gets tested before being released. We don't add the new vim/doc directory, as it's plain text rather than VimL.
2017-10-31Use "shell" not "sh" consistentlyTom Ryder2-2/+2
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.
2017-10-31Correct some vestigial programs to shell namesTom Ryder2-2/+2
Just for consistency.
2017-10-31Bring Xinit check/lint scripts up to standardTom Ryder1-1/+5
This makes them more consistent with the work already done on the check and lint scripts for the other targets.
2017-10-31Revamp `lint-vim` target for consistencyTom Ryder1-5/+10
Use a positive list of things to check rather than just excluding `bundle`; it's a little clearer what it's doing that way, and easier to add paths to check rather than paths to exclude. We also correctly leverage `vint` accepting multiple arguments, like `shellcheck`.
2017-10-31Check and lint URxvt Perls correctlyTom Ryder1-1/+6
Require that the URxvt Perls are built correctly. There's only one at the moment, so I'll make that the single prerequisite for the `check-urxvt` target.
2017-10-31Add option terminators to some stray `set` callsTom Ryder2-3/+3
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.
2017-10-31Tidy and correct linting for all three shellsTom Ryder3-10/+23
Reduce each one to target only the dotfiles specifically for that shell, as opposed to previously where for example the `check-sh` target was checking shell shims in for `mpd` and `plenv`. I'm still not completely sure that's the right approach, but it's at least less conceptually muddy than what we had before. Notably, the check and lint for Korn shell includes a single POSIX shell script file in its `shrc.d` subdirectory, so that check is executed separately.
2017-10-31Use shell name not command in check/lint messagesTom Ryder1-3/+3
This is a little bit clearer and nicer to read, I think.
2017-10-31Apply stable check and lint methods to games shellTom Ryder1-1/+7
This applies the same stable approach to testing the actual built games that are shebannged with #!/bin/sh as has been applied to the shell scripts in the `check-bin` and `lint-bin` targets. There are no GNU Bash games in these directories, so the latter block of code from the `bin` analogues to check or lint those is not needed. The same applies here; this is not as complete a checking or linting of the games directory as it could be; ideally we would check the sed(1) and awk(1) scripts too.
2017-10-31Correct copypaste errors in `check-bin`, `lint-bin`Tom Ryder1-3/+3
Use consistent variable names, and strip the correct suffix from the Bash scripts on iteration.
2017-10-31Add conditional Bash `check-bin`, `lint-bin`Tom Ryder1-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.
2017-10-31Show explicit success message for `lint-bin`Tom Ryder1-1/+2
We add an `|| exit` short-circuit for the case of `shellcheck` exiting non-zero.
2017-10-31Adjust `check-bin`, `lint-bin` for built scriptsTom Ryder1-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.
2017-10-31Revert "Drastically simplify `lint` scripts"Tom Ryder8-35/+19
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.
2017-10-31Drastically simplify `lint` scriptsTom Ryder8-19/+35
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.
2017-10-30Add a `lint-vim` target for linting Vim configTom Ryder1-0/+5
Since I know there's a usable tool for this now in vim-vint, I may as well make a target for my own convenience later. Updated the README.markdown documentation of the `lint-*` targets, restructuring the paragraph into a nested list for clarity. Also updated the `dotfiles(7)` manual page to reflect those changes.
2017-06-18Update check/lint shTom Ryder1-1/+5
2017-06-18Refactor mpd/ncmpcpp stuff completelyTom Ryder1-1/+2
This has been neglected. Switch to per-user mpd process instantiated on login via .profile.d. Cut back ncmpcpp config until I have time to write one that's compatible with 0.8.
2017-05-24Remove Yash supportTom Ryder1-1/+0
I never use it
2017-04-09Add xinitrc.d script checksTom Ryder1-0/+1
2017-04-05More sh flexibility (check/lint scripts)Tom Ryder7-7/+0
2017-04-05Apply runtime shebanging to POSIX shellTom Ryder2-20/+2
2016-12-30Clean up lint scripts a bitTom Ryder4-4/+6
2016-12-30Remove zsh linterTom Ryder1-2/+0
2016-12-27Add zsh checkingTom Ryder1-0/+2
2016-12-17Rename all pdksh stuff to kshTom Ryder2-2/+2
As part of a foray into more active use of ksh and derivatives.
2016-08-31Add very basic Yash supportTom Ryder1-0/+2
I know almost nothing about Yash yet, but reading the manual page on its startup behaviour implies a little coaxing is necessary to make it play nicely with my file layout.
2016-08-31Build URxvt Perls with shb(1)Tom Ryder1-1/+1
2016-08-24Tidy check/lint targets, add pdkshTom Ryder1-0/+2
2016-08-23Ignore SC1090 (allow unfollowable dotting)Tom Ryder2-2/+2
2016-08-23Specify shell dialect for bash/sh lintingTom Ryder2-2/+2
2016-08-03Correct lint/bin directoryTom Ryder1-1/+1
2016-08-02Restore -f test rather than -e testTom Ryder2-2/+2
Because it prevents testing directories, of course
2016-08-02Spruce up lint-bin and lint-games scriptsTom Ryder2-9/+17
2016-08-02Remove leading blank lineTom Ryder1-1/+0
2016-08-02Move tests and lints into their own scriptsTom Ryder5-0/+21
Much nicer than having them embedded in the Makefile. Might do this for some of the more complex install targets too. Or maybe all of them ...