Skip to content

Declare perlcritic policy distributions as develop prereqs - #203

Merged
oalders merged 3 commits into
mainfrom
fix-199
Oct 7, 2026
Merged

oalders merged 3 commits into
mainfrom
fix-199

Conversation

@oalders

@oalders oalders commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Closes #199

Changes

  • Add Perl::Critic::Bangs, Perl::Critic::Freenode and Perl::Critic::Moose to [Prereqs / DevelopRequires] in dist.ini. These provide the Bangs::*, Freenode::* and Moose::* policies (and the moose theme) that perlcriticrc enables. Bangs is pinned to 1.10, the release that added ProhibitDebuggingModules.
  • Declare Perl::Critic::Policy::Variables::ProhibitUnusedVarsStricter (0.116, the latest release) so CI installs and enforces it. It is now enabled explicitly in perlcriticrc, so a missing install fails loudly instead of being skipped, with allow_if_computed_by = pushd for File::pushd scope guards.
  • Fix the 12 existing ProhibitUnusedVarsStricter violations. Private helpers that never used $self (_is_word_interpreted_as_string in Document.pm; _classify, _sections, _reorder_section and _unit in Sorter.pm) are now called as plain functions, matching existing helpers such as _elem_loc. Unused list slots in three test files are replaced with undef.
  • cpanfile regenerated with dzil build. The incidental META.json / README.md churn from the build was not committed.

Testing

  • Reproduced the bug locally: with Bangs missing, perlcritic aborts with Policy "Perl::Critic::Policy::Bangs::ProhibitDebuggingModules" is not installed.
  • With Bangs and ProhibitUnusedVarsStricter 0.116 installed, precious lint --all passes on every file.
  • dzil build reproduces the committed cpanfile.
  • prove -lr -j8 t: all 98 files / 333 tests pass.

🤖 Generated with Claude Code · Opus 5.5

perlcriticrc enables policies from Perl::Critic::Bangs,
Perl::Critic::Freenode and Perl::Critic::Moose, but none of them were
declared, so a dev environment built from the develop prereqs could be
missing them and perlcritic would refuse to run. Bangs is pinned to 1.10,
the release that added ProhibitDebuggingModules. cpanfile regenerated
via dzil build.

Fixes #199

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.71%. Comparing base (db0baf4) to head (cc14eda).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #203   +/-   ##
=======================================
  Coverage   88.71%   88.71%           
=======================================
  Files          10       10           
  Lines        1134     1134           
  Branches      271      271           
=======================================
  Hits         1006     1006           
  Misses         73       73           
  Partials       55       55           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

oalders and others added 2 commits October 7, 2026 15:43
Declare Perl::Critic::Policy::Variables::ProhibitUnusedVarsStricter
(0.116, the latest release) as a develop prereq so CI installs it, and
enable it explicitly in perlcriticrc so a missing install fails loudly
rather than the policy being silently skipped. pushd scope guards are
exempted via allow_if_computed_by.

Fix the existing violations by discarding unused $self and other unused
list-assignment slots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_is_word_interpreted_as_string, _classify, _sections and
_reorder_section never used $self, and _unit only used it to call
_classify. Make them plain functions, matching existing helpers such as
_elem_loc and _extract_symbols_from_snippet, instead of discarding the
invocant with undef.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oalders
oalders marked this pull request as ready for review October 7, 2026 18:30
@oalders
oalders merged commit 575d663 into main Oct 7, 2026
25 checks passed
@oalders
oalders deleted the fix-199 branch October 7, 2026 18:31
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

Successfully merging this pull request may close these issues.

Declare perlcritic policy distributions as develop prereqs

1 participant