Skip to content

Conversation

@AlexSkrypnyk
Copy link
Member

@AlexSkrypnyk AlexSkrypnyk commented Nov 24, 2025

Reverts #10

Summary by CodeRabbit

Release Notes

  • Documentation

    • Updated all references and guidelines to reflect snake_case naming enforcement for local variables and parameters.
  • Refactor

    • Simplified naming convention checks to focus exclusively on snake_case. Removed support for alternative naming formats.
    • Updated error codes for improved clarity: rules now consistently reference snake_case validation standards.

✏️ Tip: You can customize this high-level summary in your review settings.

@AlexSkrypnyk AlexSkrypnyk merged commit 64ff353 into main Nov 24, 2025
9 of 10 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Nov 24, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The PR refactors naming convention sniffs from supporting multiple naming formats to snake_case only, renaming AbstractVariableNamingSniff to AbstractSnakeCaseSniff and its concrete implementations to LocalVariableSnakeCaseSniff and ParameterSnakeCaseSniff. The base class API removes format-configurable methods and retains only snake_case validation. All tests, error codes, documentation, and configuration are updated accordingly.

Changes

Cohort / File(s) Change Summary
Core Sniff Classes
src/DrevOps/Sniffs/NamingConventions/AbstractSnakeCaseSniff.php, src/DrevOps/Sniffs/NamingConventions/LocalVariableSnakeCaseSniff.php, src/DrevOps/Sniffs/NamingConventions/ParameterSnakeCaseSniff.php
Renamed from format-agnostic classes; removed format property and methods (isCamelCase(), isValidFormat(), toCamelCase(), toFormat()); simplified to snake_case-only validation. Error codes updated from *Naming/*NotCamelCase to *SnakeCase/NotSnakeCase.
Configuration & Metadata
src/DrevOps/ruleset.xml, README.md, composer.json
Updated rule references and documentation from LocalVariableNaming/ParameterNaming to LocalVariableSnakeCase/ParameterSnakeCase; removed camelCase configuration options and keywords; simplified project description.
Unit Tests
tests/Unit/AbstractVariableSnakeCaseSniffTest.php, tests/Unit/LocalVariableSnakeCaseSniffTest.php, tests/Unit/ParameterSnakeCaseSniffTest.php
Renamed test classes and updated imports/coverage annotations to match new sniff names. Removed 9 test methods related to camelCase detection, format conversion, and format validation. Updated setUp to reference new sniff identifiers.
Functional Tests
tests/Functional/LocalVariableSnakeCaseSniffFunctionalTest.php, tests/Functional/ParameterSnakeCaseSniffFunctionalTest.php
Renamed test classes and updated $sniffSource property to reference new snake_case sniff identifiers instead of legacy naming conventions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Removed public API methods: Verify that removal of isCamelCase(), isValidFormat(), toCamelCase(), and toFormat() from the base class does not break external consumers.
  • Error code changes: Confirm error code migration from *NotCamelCase to *NotSnakeCase is complete across all references and does not affect existing configurations or tools depending on old codes.
  • Removed test methods: Ensure removal of 9 test methods (camelCase detection, format validation, conversion tests) is intentional and coverage is maintained for remaining functionality.
  • Configuration consistency: Verify that ruleset.xml, README, and composer.json changes align with the new class names and that no stale references remain.

Possibly related PRs

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert-10-feature/allow-chose-case

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 135ce69 and d37fc21.

📒 Files selected for processing (12)
  • CLAUDE.md (9 hunks)
  • README.md (3 hunks)
  • composer.json (1 hunks)
  • src/DrevOps/Sniffs/NamingConventions/AbstractSnakeCaseSniff.php (1 hunks)
  • src/DrevOps/Sniffs/NamingConventions/LocalVariableSnakeCaseSniff.php (2 hunks)
  • src/DrevOps/Sniffs/NamingConventions/ParameterSnakeCaseSniff.php (3 hunks)
  • src/DrevOps/ruleset.xml (1 hunks)
  • tests/Functional/LocalVariableSnakeCaseSniffFunctionalTest.php (4 hunks)
  • tests/Functional/ParameterSnakeCaseSniffFunctionalTest.php (5 hunks)
  • tests/Unit/AbstractVariableSnakeCaseSniffTest.php (10 hunks)
  • tests/Unit/LocalVariableSnakeCaseSniffTest.php (1 hunks)
  • tests/Unit/ParameterSnakeCaseSniffTest.php (2 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

@AlexSkrypnyk AlexSkrypnyk deleted the revert-10-feature/allow-chose-case branch November 24, 2025 12:07
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (135ce69) to head (d37fc21).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##             main       #11      +/-   ##
===========================================
+ Coverage   99.51%   100.00%   +0.48%     
===========================================
  Files           6         6              
  Lines         409       387      -22     
===========================================
- Hits          407       387      -20     
+ Misses          2         0       -2     

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

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.

3 participants