From e762715f3e7f0e9e6f861509872b1b6a5e2fa9d3 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 29 Nov 2019 16:07:39 +1300 Subject: Add phpcsff(1df) --- .gitignore | 3 +++ Makefile | 4 ++++ README.md | 3 +++ bin/phpcsff.mi5 | 15 +++++++++++++++ 4 files changed, 25 insertions(+) create mode 100755 bin/phpcsff.mi5 diff --git a/.gitignore b/.gitignore index a6b9e0e3..8dbb1aba 100644 --- a/.gitignore +++ b/.gitignore @@ -85,6 +85,9 @@ /bin/pa /bin/paz /bin/ped +/bin/phpcsff +/bin/phpcsff.m4 +/bin/phpcsff.sh /bin/pit /bin/plmu /bin/pp diff --git a/Makefile b/Makefile index 6902c146..814cd41a 100644 --- a/Makefile +++ b/Makefile @@ -170,6 +170,7 @@ BINS = bin/ap \ bin/pa \ bin/paz \ bin/ped \ + bin/phpcsff \ bin/pit \ bin/plmu \ bin/p \ @@ -234,6 +235,7 @@ BINS_M4 = bin/chn.m4 \ bin/edda.m4 \ bin/mim.m4 \ bin/oii.m4 \ + bin/phpcsff.m4 \ bin/pst.m4 \ bin/swr.m4 \ bin/tlcs.m4 \ @@ -245,6 +247,7 @@ BINS_SH = bin/chn.sh \ bin/edda.sh \ bin/mim.sh \ bin/oii.sh \ + bin/phpcsff.sh \ bin/pst.sh \ bin/swr.sh \ bin/tlcs.sh \ @@ -319,6 +322,7 @@ bin/dfv.sh: bin/dfv.m4 include/mktd.m4 bin/edda.sh: bin/edda.m4 include/mktd.m4 bin/mim.sh: bin/mim.m4 include/mktd.m4 bin/oii.sh: bin/oii.m4 include/mktd.m4 +bin/phpcsff.sh: bin/phpcsff.m4 include/mktd.m4 bin/pst.sh: bin/pst.m4 include/mktd.m4 bin/swr.sh: bin/swr.m4 include/mktd.m4 bin/tlcs.sh: bin/tlcs.m4 include/mktd.m4 diff --git a/README.md b/README.md index 6c53c211..074b08b1 100644 --- a/README.md +++ b/README.md @@ -550,6 +550,9 @@ Installed by the `install-bin` target: * `p(1df)` prints concatenated standard input; `cat(1)` as it should always have been. * `pa(1df)` prints its arguments, one per line. +* `phpcsff(1df)` wraps around + [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) to make it + a source code filter suitable for use as an `equalprg` in Vim. * `pp(1df)` prints the full path of each argument using `$PWD`. * `pph(1df)` runs `pp(1df)` and includes a leading `$HOSTNAME:`. * `paz(1df)` print its arguments terminated by NULL chars. diff --git a/bin/phpcsff.mi5 b/bin/phpcsff.mi5 new file mode 100755 index 00000000..ea05eaaa --- /dev/null +++ b/bin/phpcsff.mi5 @@ -0,0 +1,15 @@ +# Use php-cs-fixer as a source filter. +self=phpcsff + +<% +include(`include/mktd.m4') +%> + +# Duplicate stdin into a file +if ! command -v php-cs-fixer >/dev/null 2>&1 ; then + printf >&2 'php-cs-fixer: command not found\n' + exit 1 +fi +cat -- "${@:--}" > "$td"/src.php +php-cs-fixer fix -- "$td"/src.php +cat -- "$td"/src.php -- cgit v1.2.3 From f50d87b3e20a6a3bf99a6a61cd4ea3dc9aa7d752 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 29 Nov 2019 16:07:47 +1300 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index a067e01f..6a0cbc58 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v7.21.0 -Thu, 28 Nov 2019 02:19:10 +0000 +tejr dotfiles v7.22.0 +Fri, 29 Nov 2019 03:07:47 +0000 -- cgit v1.2.3 From cab7a9652cb8f203a3ca1d1e56ec76ab129f4c02 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 29 Nov 2019 16:07:49 +1300 Subject: Update dotfiles(7) manual page --- man/man7/dotfiles.7df | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/man/man7/dotfiles.7df b/man/man7/dotfiles.7df index abd75951..7d5a65db 100644 --- a/man/man7/dotfiles.7df +++ b/man/man7/dotfiles.7df @@ -862,6 +862,10 @@ it should always have been. .IP \[bu] 2 \f[C]pa(1df)\f[] prints its arguments, one per line. .IP \[bu] 2 +\f[C]phpcsff(1df)\f[] wraps around +PHP\-CS\-Fixer (https://github.com/FriendsOfPHP/PHP-CS-Fixer) to make it +a source code filter suitable for use as an \f[C]equalprg\f[] in Vim. +.IP \[bu] 2 \f[C]pp(1df)\f[] prints the full path of each argument using \f[C]$PWD\f[]. .IP \[bu] 2 -- cgit v1.2.3