3 # Example use a perltidy postfilter to outdent certain leading keywords
6 # perltidy_okw.pl -sil=1 file.pl
8 # This version outdents hardwired keywords 'step', 'command', and 'expected'
9 # The following is an example of the desired effect. The flag -sil=1 is
10 # needed to get a starting indentation level so that the outdenting
15 command 'Share project: project1';
16 expected 'A project megjelenik a serveren';
17 shareProject ('project1', 'login', '123', Login => 1, PortalServer =>
19 valueCheck ('project1_share', listBIMCloudData ('projects'));
27 # Run it exactly like perltidy, and the postfilter removes the
28 # leading whitespace of lines which begin with your keywords. The
29 # postfilter works on the file as a single string, so the 'm' quote
30 # modifier is needed to make the ^ and $ string positioners work
32 # See http://perltidy.sourceforge.net/Tidy.html for further details
33 # on how to call Perl::Tidy
35 my $arg_string = undef;
36 my $err=Perl::Tidy::perltidy(
39 sub { $_ = $_[0]; s/^\s*(step|command|expected)(.*)$/$1$2/gm; return $_ }
42 die "Error calling perltidy\n";