Skip to content

perl: strict perlcritic default with noise drops and no-critic guards #14683

Open

Description

@TrapsterDK

Where

  • quality/tiers/perlcritic/strict.perlcriticrc:1-6: severity 1, drops RequireTidyCode only. standard: severity 3.
  • quality/adapter/src/commands.rs:262-267: with no bound config, --noprofile --severity=5.
  • quality/tools.bzl:1730-1748: perlcritic, no severity(). docs/cli/commands/quality.md:422.
  • perl/rules/defs.bzl:67: no interpreter warning flags. perl/tools/perlcritic_smoke_test.sh:7 uses severity 5.

Fix

Guard rules (do first):

  • TestingAndDebugging::RequireUseStrict, RequireUseWarnings, ProhibitNoStrict, ProhibitNoWarnings (allow_with_category_restriction = 1).
  • BuiltinFunctions::ProhibitStringyEval, InputOutput::RequireCheckedSyscalls (functions = :builtins), RequireCheckedOpen, RequireCheckedClose, ProhibitTwoArgOpen, ProhibitBarewordFileHandles, Subroutines::ProhibitExplicitReturnUndef.
  • Miscellanea::ProhibitUselessNoCritic, ProhibitUnrestrictedNoCritic. Adapter check: ## no critic (Policy) needs a reason.
  • Adapter check: use warnings FATAL => 'all'.

Then:

  • Default is severity 1 with this drop list: CodeLayout::RequireTidyCode, RequireTrailingCommas, ProhibitParensWithBuiltins, ValuesAndExpressions::ProhibitMagicNumbers, RequireNumberSeparators, ProhibitNoisyQuotes, ProhibitEmptyQuotes, ProhibitInterpolationOfLiterals, RequireInterpolationOfMetachars, ProhibitConstantPragma, ControlStructures::ProhibitPostfixControls, RegularExpressions::RequireExtendedFormatting, RequireDotMatchAnything, RequireLineBoundaryMatching, Documentation::RequirePodSections, RequirePodAtEnd, Modules::RequireVersionVar, ProhibitMultiplePackages, Subroutines::RequireArgUnpacking.
  • Use it when no config is bound (commands.rs:262-267). Update the smoke test.
  • perlcritic severity() map. Update quality.md:422.

Excluded

ErrorHandling::RequireCarping, ProhibitExcessComplexity thresholds, RequireUseUTF8, and the drop list above.

Test

  • Negative fixture per guard (no use strict, string eval, unchecked open, two-arg open, bareword handle, return undef, bare ## no critic) fails dx lint.
  • commands_tests.rs:1673 argv for the default profile.
  • Clean fixture passes. tier = "standard" still passes.

Verify every rule ID and flag against the pinned tool version before landing; some come from memory.

Part of #14647

Activity

  1. added
    cloud-pool
    on Nov 22, 2026
  2. TrapsterDK commented on Nov 22, 2026

    @TrapsterDK
    CollaboratorAuthor

    Paths in this issue are from an old layout. Branch from origin/main; quality code is in core/quality/, wrappers in /private/. Rebase on #14647 (strict default) and #14685 (severity floor).

    Related: #14691 makes perlcritic a default linter.

    🤖 Generated with Claude Code

  3. TrapsterDK commented on Nov 22, 2026

    @TrapsterDK
    CollaboratorAuthor

    cloud-claim bebd684c


    Generated by Claude Code

  4. added
    cloud-taken
    and removed
    cloud-pool
    on Nov 22, 2026
  5. TrapsterDK commented on Nov 22, 2026

    @TrapsterDK
    CollaboratorAuthor

    Next slice: #14711 (on the train) lands the strict tier drop list, the ProhibitNoWarnings and RequireCheckedSyscalls parameters and guard fixtures in the perlcritic smoke test. Left: the adapter checks (## no critic (Policy) needs a reason; use warnings FATAL => 'all') need the shared agent-guard hook from #14647; the unbound-config path in perlcritic_check (commands.rs PERLCRITIC_DEFAULT_ARGS, still --noprofile --severity=5) and its argv test should switch to the strict profile.


    Generated by Claude Code

  6. added
    cloud-pool
    and removed
    cloud-taken
    on Nov 23, 2026
  7. TrapsterDK commented on Nov 23, 2026

    @TrapsterDK
    CollaboratorAuthor

    cloud-claim 4225d8f7


    Generated by Claude Code

  8. added
    cloud-taken
    and removed
    cloud-pool
    on Nov 23, 2026
  9. TrapsterDK commented on Nov 23, 2026

    @TrapsterDK
    CollaboratorAuthor

    Next slice: #14727 (on the train) removes the severity 5 --noprofile fallback, so perlcritic always runs the bound tier profile. What's left is the adapter guard: ## no critic (Policy) must give a reason, and use warnings FATAL => 'all' should be checked. It can be a perl_guard.rs in core/quality/adapter, wired like zig_guard.rs from #14715, with negative fixtures for each case.


    Generated by Claude Code

  10. added
    cloud-pool
    and removed
    cloud-taken
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cloud-pool

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions