Run perltidy on code

parent 5e8c09ae
......@@ -324,7 +324,7 @@ sub get_all_diffs {
# Preload excludes from all minor releases in $from-major
my $v_from = Pg::Version->new( $from );
for my $exclude_from ( $v_from->major, map { $v_from->major . "." . $_ } 1..$v_from->minor ) {
for my $exclude_from ( $v_from->major, map { $v_from->major . "." . $_ } 1 .. $v_from->minor ) {
for my $change ( @{ clone $self->get_changes_for_single_upgrade( $exclude_from ) } ) {
$excludes->{ $self->get_shortened( $change ) }++;
}
......@@ -347,7 +347,7 @@ sub get_all_diffs {
my @selected_changes = @{ $changes }[ @{ $search_results->{ $new_version } } ];
for my $item ( @selected_changes ) {
my @parts = split m{(<(?:[^>]*|"[^"]*"|'[^']*')+>)}, $item;
for my $element (@parts) {
for my $element ( @parts ) {
next if $element =~ m{\A<};
$element =~ s{\b($keywords_re)\b}{<span class="searchhilight">$1</span>}gi;
}
......@@ -357,9 +357,9 @@ sub get_all_diffs {
}
$changes = [
map { $_->[1] }
grep { !$excludes->{ $_->[0] }++ }
map { [ $self->get_shortened( $_ ), $_ ] } @{ $changes }
map { $_->[ 1 ] }
grep { !$excludes->{ $_->[ 0 ] }++ }
map { [ $self->get_shortened( $_ ), $_ ] } @{ $changes }
];
push @{ $ret->{ 'security' } }, grep { m{CVE-\d{4}-\d+} } @{ $changes };
......
#!/usr/bin/env bash
# Unofficial Bash Strict Mode
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
# End of Unofficial Bash Strict Mode
# make sure that current dir is project top dir
this_script="${BASH_SOURCE[0]}"
script_directory="$( dirname "${this_script}" )"
work_dir="$( readlink -f "${script_directory}" )"
cd "$work_dir"
# make sure that current dir is project top dir
readarray -d $'\n' -t files < <(
(
find lib/ -type f -name '*.pm'
find t/ -maxdepth 1 -type f -name '*.t'
) | sort -uV
)
file_count="${#files[@]}"
i=0
while (( i < file_count ))
do
use_file="${files[$i]}"
tidy_file="${use_file}.beforeTidy"
printf "Working on file %2d of %2d : %s.\n" "$(( i + 1 ))" "${file_count}" "${use_file}"
perltidy --profile=t/perltidyrc "${use_file}" || true
if [[ -f "${tidy_file}" ]]
then
diff -u "${tidy_file}" "${use_file}" || echo
rm -f "${tidy_file}"
fi
(( ++i ))
done
......@@ -9,7 +9,7 @@ BEGIN {
JSON
Mojolicious::Plugin::JSONConfig
Mojolicious::Plugin::Number::Commify
};
};
for my $module ( @modules ) {
use_ok( $module );
......
......@@ -3,7 +3,7 @@ use Mojo::Base -strict;
use Test::More;
use Test::Mojo;
my $t = Test::Mojo->new('PgWhyUpgrade');
$t->get_ok('/')->status_is(302);
my $t = Test::Mojo->new( 'PgWhyUpgrade' );
$t->get_ok( '/' )->status_is( 302 );
done_testing();
--backup-and-modify-in-place
--backup-file-extension=beforeTidy
--block-brace-tightness=0
--brace-tightness=0
--closing-token-indentation=1
--continuation-indentation=4
--indent-columns=4
--maximum-line-length=195
--nocuddled-else
--noopening-brace-on-new-line
--nooutdent-labels
--paren-tightness=0
--square-bracket-tightness=0
--vertical-tightness=0
--vertical-tightness-closing=0
--break-at-old-comma-breakpoints
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment