Create CamelCaseVariableNameRule rule and set up AI instructions#4
Merged
Create CamelCaseVariableNameRule rule and set up AI instructions#4
Conversation
Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new PHPStan rule to enforce camelCase variable names with configurable options, along with corresponding tests and configuration updates.
- Implemented
CamelCaseVariableNameRuleand itsConfigclass - Added NEON configuration files and PHPUnit tests covering default and option-enabled scenarios
- Updated
extension.neonto register new parameters and service; added AI instructions
Reviewed Changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Rules/CamelCaseVariableName/config/configured_rule.neon | Base include for the new rule |
| tests/Rules/CamelCaseVariableName/config/allow_underscore_prefix.neon | Config to allow underscore prefixes |
| tests/Rules/CamelCaseVariableName/config/allow_consecutive_uppercase.neon | Config to allow consecutive uppercase letters |
| tests/Rules/CamelCaseVariableName/config/all_options_true.neon | Combined config enabling both options |
| tests/Rules/CamelCaseVariableName/Fixture/ExampleClass.php | Fixture with various variable naming patterns |
| tests/Rules/CamelCaseVariableName/DefaultOptionsTest.php | Tests default rule behavior |
| tests/Rules/CamelCaseVariableName/AllowUnderscorePrefixTest.php | Tests underscore-prefix setting |
| tests/Rules/CamelCaseVariableName/AllowConsecutiveUppercaseTest.php | Tests consecutive-uppercase setting |
| tests/Rules/CamelCaseVariableName/AllOptionsTrueTest.php | Tests when both options are enabled |
| src/Rules/CamelCaseVariableName/Config.php | New config class for the rule’s options |
| src/Rules/CamelCaseVariableName/CamelCaseVariableNameRule.php | Rule implementation enforcing camelCase variables |
| config/extension.neon | Added parameter schema, defaults, and service |
| .github/copilot-instructions.md | AI coding instructions for contributors |
Comments suppressed due to low confidence (1)
tests/Rules/CamelCaseVariableName/DefaultOptionsTest.php:18
- [nitpick] Add a test scenario with valid camelCase variable names to verify that no errors are reported for correctly named variables.
$this->analyse([
Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@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.
This creates the
CamelCaseVariableNameRulerule and sets up an AI instructions file because peer pressure and dammit it kind of works sometimes.