| 1 | package Code::TidyAll::Plugin::SortLines; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 1 | extends 'Code::TidyAll::Plugin'; | |
| 9 | |||
| 10 | 1 | our $VERSION = '0.83'; | |
| 11 | |||
| 12 | sub transform_source { | ||
| 13 | 2 | ▶ | my ( $self, $source ) = @_; |
|
Subroutine
transform_source: called CC=1 SCAR=0.0
Pod
documented
| |||
| 14 | |||
| 15 | 2 | return join( "\n", sort( grep {/\S/} split( /\n/, $source ) ) ) . "\n"; | |
| 16 | } | ||
| 17 | |||
| 18 | 1 | 1; | |
| 19 | |||
| 20 | # ABSTRACT: Sort the lines in a file | ||
| 21 | |||
| 22 | __END__ | ||
| 23 | |||
| 24 | =pod | ||
| 25 | |||
| 26 | =encoding UTF-8 | ||
| 27 | |||
| 28 | =head1 NAME | ||
| 29 | |||
| 30 | Code::TidyAll::Plugin::SortLines - Sort the lines in a file | ||
| 31 | |||
| 32 | =head1 VERSION | ||
| 33 | |||
| 34 | version 0.83 | ||
| 35 | |||
| 36 | =head1 SYNOPSIS | ||
| 37 | |||
| 38 | # In configuration: | ||
| 39 | |||
| 40 | [SortLines] | ||
| 41 | select = .ispell* **/.gitignore | ||
| 42 | |||
| 43 | =head1 DESCRIPTION | ||
| 44 | |||
| 45 | Sorts the lines of a file; whitespace lines are discarded. Useful for files | ||
| 46 | containing one entry per line, such as C<.svnignore>, C<.gitignore>, and | ||
| 47 | C<.ispell*>. | ||
| 48 | |||
| 49 | =head1 SUPPORT | ||
| 50 | |||
| 51 | Bugs may be submitted at L<https://github.com/houseabsolute/perl-code-tidyall/issues>. | ||
| 52 | |||
| 53 | =head1 SOURCE | ||
| 54 | |||
| 55 | The source code repository for Code-TidyAll can be found at L<https://github.com/houseabsolute/perl-code-tidyall>. | ||
| 56 | |||
| 57 | =head1 AUTHORS | ||
| 58 | |||
| 59 | =over 4 | ||
| 60 | |||
| 61 | =item * | ||
| 62 | |||
| 63 | Jonathan Swartz <swartz@pobox.com> | ||
| 64 | |||
| 65 | =item * | ||
| 66 | |||
| 67 | Dave Rolsky <autarch@urth.org> | ||
| 68 | |||
| 69 | =back | ||
| 70 | |||
| 71 | =head1 COPYRIGHT AND LICENSE | ||
| 72 | |||
| 73 | This software is copyright (c) 2011 - 2022 by Jonathan Swartz. | ||
| 74 | |||
| 75 | This is free software; you can redistribute it and/or modify it under | ||
| 76 | the same terms as the Perl 5 programming language system itself. | ||
| 77 | |||
| 78 | The full text of the license can be found in the | ||
| 79 | F<LICENSE> file included with this distribution. | ||
| 80 | |||
| 81 | =cut | ||