How to or should we sort "use Our::Class qw(may_be some_imports);" statements with Perl::Tidy (or not)?

77 Views Asked by At

We would like to sort use statements alphabetically in the beginning of our classes automatically via perltidy or maybe other tool if available. We already use Test::PerlTidy to test if the code is formatted before committing.

I found that Perl::Tidy has the options prefilter and postfilter. prefilter looks like the better approach, because I can sort the statements as I wish in any logical for me order, then leave it to perltidy to format it.

  1. Would you recommend sorting use statements? The used classes do not depend on using one before the other.
  2. Would you recommend using these Perl::Tidy features?
  3. Is there a better approach?
0

There are 0 best solutions below