Enforce naming conventions via Perl::Critic#4
Open
lmist wants to merge 1 commit into
Open
Conversation
Add a focused .perlcriticrc enabling the NamingConventions::Capitalization and ProhibitAmbiguousNames policies so identifier naming is machine-checkable rather than review-by-eye. The config encodes the de-facto standard already used across lib/ (CamelCase packages, snake_case subs/vars with leading _ for private/builder subs, ALL_CAPS constants/globals) and is tuned to pass clean on the current tree (110 files, 0 violations) so it can serve as a CI gate. Document the conventions in README (new 'Coding conventions' section) and CLAUDE.md. Rename the camelCase $operationId/$opId locals in Langertha::Role::OpenAPI to snake_case to match the surrounding style; the OpenAPI spec key and POD term 'operationId' are unchanged (behaviour-preserving). Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the Naming Consistency agent-readiness signal by making the project's identifier conventions machine-checkable instead of review-by-eye.
What changed
.perlcriticrc(new): a focused Perl::Critic profile enabling only the naming policies (NamingConventions::Capitalization+NamingConventions::ProhibitAmbiguousNames) so the gate stays low-noise. It encodes the de-facto standard already used acrosslib/:CamelCasepackages (withvLLMexempted — upstream brand capitalization)snake_casesubroutines/methods, leading_allowed for private/builder subs (_build_api_key,_build__json)snake_caselexical variablessnake_caseorALL_CAPSpackage globals/constants ($VERSION,%ROLE_TO_CAPS)BUILD,FOREIGNBUILDARGS, …) exempted by exact namelib/Langertha/Role/OpenAPI.pm: renamed the only genuine deviations — the camelCase locals$operationId/$opId— to$operation_id, matching their snake_case neighbours. The OpenAPI spec key and POD termoperationIdare unchanged. Behaviour-preserving.perlcritic lib/ bin/.Verification
perlcritic --profile .perlcriticrc lib/ bin/→ 110 files scanned, 0 violations, exit 0 (Perl::Critic 1.156).Langertha::Role::OpenAPIcompiles clean after the rename (verified with full runtime deps).The profile is deliberately tuned to pass clean on the current tree, so it can be wired into CI as an enforcement gate going forward.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>