For steve_p on #parrot.
I find this a little too verbose, but would not object if someone
applied it.
=== t/codingstd/trailing_space.t
==================================================================
--- t/codingstd/trailing_space.t (revision 4828)
+++ t/codingstd/trailing_space.t (local)
@@ -50,14 +50,13 @@
# slurp in the file
open( my $fh, '<', $path )
or die "Cannot open '$path' for reading: $!\n";
+
+ while (my $line=<$fh>)
{
- local $/;
- $buf = <$fh>;
+ if ( $line =~ m{.?[ \t]+$} ) {
+ push @failed_files, "$path:$.";
+ }
}
-
- if ( $buf =~ m{.?[ \t]+$}m ) {
- push @failed_files, $path;
- }
}
# check the file
--
Will "Coke" Coleda
wi...@coleda.com
will find you every line with trailing spaces.
better yet, do like i do, and set this in your .vimrc:
set list
set listchars=trail:-,tab:\.\
NOTE: there is a trailing space on the line above. it's IMPORTANT.
not only will this show you trailing spaces (as dashes), but leading
tabs (as dot followed by space). that way you'll notice and fix them
before you commit. i've never run emacs, so i don't know the lispy
analog. i'm sure somebody will chime in with it.
~jerry
jerry> i've never run emacs, so i don't know the lispy analog.
jerry> i'm sure somebody will chime in with it.
This does what you think it does:
(setq-default show-trailing-whitespace t)
Emacs 22 users can highlight tabs like this:
(global-hi-lock-mode 1)
(highlight-regexp "\t")
--
... apart from the sanitation, the medicine,education, wine,
public order, irrigation, roads, a fresh water system, and public
health, what have the Romans ever done for us?
-- Reg, JPF
These configuration options (both emacs and vim) have been added to
docs/project/cage_cleaners_guide.pod if people wish to refer to them
again.
Paul