App-perlimports
view release on metacpan or search on metacpan
precious.toml view on Meta::CPAN
lint_flags = ["--lint" ]
tidy_flags = ["-i" ]
ok_exit_codes = 0
ignore_stderr = [".* OK"]
[commands.perltidy]
type = "both"
include = [ "**/*.{pl,pm,t,psgi}" ]
cmd = [ "perltidy", "--profile=$PRECIOUS_ROOT/perltidyrc" ]
lint_flags = [ "--assert-tidy", "--no-standard-output", "--outfile=/dev/null" ]
tidy_flags = [ "--backup-and-modify-in-place", "--backup-file-extension=/" ]
ok_exit_codes = 0
lint_failure_exit_codes = 2
[commands.perlcritic]
type = "lint"
include = [ "**/*.{pl,pm,t,psgi}" ]
cmd = [ "perlcritic", "--profile=$PRECIOUS_ROOT/perlcriticrc" ]
ok_exit_codes = 0
lint_failure_exit_codes = 2
script/perlimports view on Meta::CPAN
perlimports --create-config-file .perlimports.toml
For system-wide defaults, you can create a file in C<$XDG_HOME>. Something like:
perlimports --create-config-file ~/.config/perlimports/perlimports.toml
After you have set up the config file to your liking, you can do away with most
command line switches, other than C<-i>, C<--lint> or C<--read-stdin>.
Now, let's update a file in place. (Make sure you can revert the file if you
need to, as C<perlimports> will not make a backup.)
perlimports -i foo.pl
Lint a file:
perlimports --lint foo.pl
In-place edits on directories:
perlimports -i lib t xt
script/perlimports view on Meta::CPAN
The absolute or relative path to a file which contains a lost of module names
which should never export symbols. (See above for behaviour). The pattern is
one module name per line.
Foo
Foo::Bar
=head2 --inplace-edit|-i
Edit the file in place rather than printing the result to STDOUT. Make sure you
have a backup copy first.
--inplace--edit
-i
Edit the file in place rather than printing the result to STDOUT. Make sure you
have a backup copy first.
=head2 --json
(Experimental). If enabled, linting errors will be emitted as JSON objects with
one object per error. This is intended to make it easier for editors to parse
line numbers and column numbers as well as the error message. This flag can
only be used in tandem with C<--lint>.
=head2 --lint
script/perlimports view on Meta::CPAN
lint_flags = [ "--lint"]
tidy_flags = [ "-i"]
ok_exit_codes = 0
expect_stderr = true
[commands.perltidy]
type = "both"
include = [ "**/*.{pl,pm,t,psgi}" ]
cmd = [ "perltidy", "--profile=$PRECIOUS_ROOT/perltidyrc" ]
lint_flags = [ "--assert-tidy", "--no-standard-output", "--outfile=/dev/null" ]
tidy_flags = [ "--backup-and-modify-in-place", "--backup-file-extension=/" ]
ok_exit_codes = 0
lint_failure_exit_codes = 2
expect_stderr = true
Note that L<https://github.com/houseabsolute/precious> runs plugins in order,
so we've placed a L<perltidy> config after L<perlimports>. This is handy
because L<perlimports> could introduce changes which will later be reverted by
L<perltidy>. By running them sequentially we can avoid false positives which
might be generated by L<perlimports> changing an include which L<perltidy>
might revert.
( run in 1.526 second using v1.01-cache-2.11-cpan-49f99fa48dc )