Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: Make spacing before #TRIAL configurable #30

Open
djerius opened this issue Apr 2, 2023 · 0 comments
Open

RFE: Make spacing before #TRIAL configurable #30

djerius opened this issue Apr 2, 2023 · 0 comments

Comments

@djerius
Copy link

djerius commented Apr 2, 2023

The space before # TRIAL may be inconsistent with the user's perltidy rules, which will, if using Test::Perl::Critic, cause Perl::Critic::Policy::CodeLayout::RequireTidyCode to fail, but only when performing a trial release.

Providing some sort of configuration for the format of the # TRIAL side comment without breaking parsing by down-stream tools would be useful.

As an example, I've attached a sample distribution which generates the errors. If I modify the included perltidy.rc file to add the -msc=1 option (which changes the required spacing before side comments to 1 space), the test passes.

Thanks!


$ dzil release
[DZ] beginning to build Test-Trial
[DZ] guessing dist's main_module is lib/Test/Trial.pm
[@Basic/ExtraTests] rewriting author test xt/author/critic.t
[DZ] writing Test-Trial in Test-Trial-0.01
[DZ] building archive with Archive::Tar::Wrapper
[DZ] writing archive to Test-Trial-0.01.tar.gz
[@Basic/TestRelease] Extracting /tmp/Test-Trial/Test-Trial-0.01.tar.gz to .build/jrgSkIeWUN
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Test::Trial
Writing MYMETA.yml and MYMETA.json
cp lib/Test/Trial.pm blib/lib/Test/Trial.pm
PERL_DL_NONLAZY=1 "/home/dj/.plenv/versions/5.36.0/bin/perl5.36.0" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/author-critic.t .. ok   
All tests successful.
Files=1, Tests=1,  1 wallclock secs ( 0.01 usr  0.01 sys +  0.89 cusr  0.20 csys =  1.11 CPU)
Result: PASS
[@Basic/TestRelease] all's well; removing .build/jrgSkIeWUN
[@Basic/ConfirmRelease] *** Preparing to release Test-Trial-0.01.tar.gz with @Basic/UploadToCPAN ***
Do you want to continue the release process? [y/N]: 
[@Basic/ConfirmRelease] Aborting release
[@Basic/ConfirmRelease] Aborting release at inline delegation in Dist::Zilla::Plugin::ConfirmRelease for logger->log_fatal (attribute declared in /home/dj/.plenv/versions/5.36.0/lib/perl5/site_perl/5.36.0/Dist/Zilla/Role/Plugin.pm at line 61) line 18.
[Test-Trial.tar.gz.txt](https://github.com/dagolden/Dist-Zilla-Plugin-BumpVersionAfterRelease/files/11133416/Test-Trial.tar.gz.txt)


$ dzil release --trial
[DZ] beginning to build Test-Trial
[DZ] guessing dist's main_module is lib/Test/Trial.pm
[@Basic/ExtraTests] rewriting author test xt/author/critic.t
[DZ] writing Test-Trial in Test-Trial-0.01
[DZ] building archive with Archive::Tar::Wrapper
[DZ] writing archive to Test-Trial-0.01-TRIAL.tar.gz
[@Basic/TestRelease] Extracting /tmp/Test-Trial/Test-Trial-0.01-TRIAL.tar.gz to .build/o0VezkyAIy
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Test::Trial
Writing MYMETA.yml and MYMETA.json
cp lib/Test/Trial.pm blib/lib/Test/Trial.pm
PERL_DL_NONLAZY=1 "/home/dj/.plenv/versions/5.36.0/bin/perl5.36.0" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/author-critic.t .. 1/? 
#   Failed test 'Test::Perl::Critic for "blib/lib/Test/Trial.pm"'
#   at /home/dj/.plenv/versions/5.36.0/lib/perl5/site_perl/5.36.0/Test/Perl/Critic.pm line 121.
# 
#   [CodeLayout::RequireTidyCode] Code is not tidy at line 1, near 'package Test::Trial;'.  (Severity: 1)
t/author-critic.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests 

Test Summary Report
-------------------
t/author-critic.t (Wstat: 256 (exited 1) Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=1, Tests=1,  1 wallclock secs ( 0.01 usr  0.01 sys +  0.89 cusr  0.20 csys =  1.11 CPU)
Result: FAIL
Failed 1/1 test programs. 1/1 subtests failed.
make: *** [Makefile:841: test_dynamic] Error 1
error running make test





Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant