diff --git a/.travis.yml b/.travis.yml index 767b69afc..455f223b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,6 +32,7 @@ install: - cpanm --notest --quiet CGI::Fast FCGI - cpanm --notest --quiet Unicode::CaseFold - cpanm --notest --quiet SOAP::Lite Net::LDAP + - cpanm --installdeps . --with-develop before_script: - coverage-setup @@ -40,6 +41,7 @@ script: - autoreconf -i - ./configure - cd src; make; cd .. + - make check-local TEST_FILES='xt/perltidy.t' || true - make check-local TEST_FILES='t/compile_executables.t t/compile_modules.t t/Language.t t/parse_templates.t t/pod-syntax.t' after_success: diff --git a/Makefile.am b/Makefile.am index 44b826ac2..2063c6f81 100644 --- a/Makefile.am +++ b/Makefile.am @@ -58,7 +58,8 @@ noinst_SCRIPTS = \ xt/fixme.t \ xt/fixme-todo.t \ xt/pod-coverage.t \ - xt/pod-spelling.t + xt/pod-spelling.t \ + xt/perltidy.t EXTRA_DIST = \ AUTHORS.md \ diff --git a/cpanfile b/cpanfile new file mode 100644 index 000000000..da18050d7 --- /dev/null +++ b/cpanfile @@ -0,0 +1,5 @@ +on 'develop' => sub { + requires 'Test::Fixme'; + requires 'Test::PerlTidy'; + requires 'Perl::Tidy', '== 20180220'; +}; diff --git a/doc/dot.perltidyrc b/doc/dot.perltidyrc index 65512bb50..870f5e7e6 100644 --- a/doc/dot.perltidyrc +++ b/doc/dot.perltidyrc @@ -6,7 +6,7 @@ -cti=0 # No extra indentation for closing brackets -i=4 # Indent level is 4 cols -ci=4 # Continuation indent is 4 cols --l=78 # Max line witdh is 78 cols +-l=78 # Max line width is 78 cols -nolc # Don't outdent long comments (* -olc) -nolq # Don't outdent long quoted strings -nsbl # No opening sub brace on new line (* -sbl) diff --git a/xt/perltidy.t b/xt/perltidy.t new file mode 100644 index 000000000..96e2e41ce --- /dev/null +++ b/xt/perltidy.t @@ -0,0 +1,10 @@ +use strict; +use warnings; + +use Test::PerlTidy; +use FindBin qw($Bin); + +run_tests( + path => "$Bin/../src/", + perltidyrc => "$Bin/../doc/dot.perltidyrc" +);