diff options
author | 2019-01-31 19:10:06 -0500 | |
---|---|---|
committer | 2019-01-31 19:10:06 -0500 | |
commit | 9d2417c9dc8f3a6a1b608a1c2717a89408d304c3 (patch) | |
tree | 9b58f2cf8468a37d6cdcc42052a4e9f1ac6a7927 | |
parent | Bug 1497042 - Enclose table names in CREATE queries (diff) | |
download | bugzilla-9d2417c9dc8f3a6a1b608a1c2717a89408d304c3.tar.gz bugzilla-9d2417c9dc8f3a6a1b608a1c2717a89408d304c3.tar.bz2 bugzilla-9d2417c9dc8f3a6a1b608a1c2717a89408d304c3.zip |
add perl-fmt script
-rwxr-xr-x | contrib/perl-fmt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/contrib/perl-fmt b/contrib/perl-fmt new file mode 100755 index 000000000..7ac47eeb8 --- /dev/null +++ b/contrib/perl-fmt @@ -0,0 +1,24 @@ +#!/usr/bin/env perl +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. + +use 5.10.1; +use strict; +use warnings; + +use File::Basename qw(dirname); +use Cwd qw(realpath); +use File::Spec::Functions qw(catfile catdir); +use Env qw(@PATH @PERL5LIB); + +my $bugzilla_dir = realpath(catdir( dirname(__FILE__), '..' )); +unshift @PERL5LIB, catdir($bugzilla_dir, 'local', 'lib', 'perl5'); +unshift @PATH, catdir($bugzilla_dir, 'local', 'bin'); + +my $profile = catfile($bugzilla_dir, ".perltidyrc" ); +warn "formatting @ARGV\n"; +exec( perltidy => "--profile=$profile", '-nst', '-b', '-bext=/', '-conv', @ARGV ); |