Skip to content

Properly comply with PHPCS naming conventions - #2

Merged
tomasnorre merged 3 commits into
tomasnorre:ci-fix-strict-types-snifffrom
jrfnl:feature/fix-sniff-namingconventions-properly
Nov 15, 2024
Merged

tomasnorre merged 3 commits into
tomasnorre:ci-fix-strict-types-snifffrom
jrfnl:feature/fix-sniff-namingconventions-properly

Conversation

@jrfnl

@jrfnl jrfnl commented Nov 15, 2024

Copy link
Copy Markdown

👉 Note: the first commit is the only one necessary to fix the issue you were experiencing. The second and third commits are "best practice" fixes as I had the repo open now anyway.

Properly comply with PHPCS naming conventions

Note: I've not changed the composer.json file, but it could also be considered to leave the sniff namespace the same and to change the "Exercism\\": "src", config in the composer.json file to "Exercism\\": "src\\Exercism",.

ExplainStrictTypesSniff: use proper error code

The class name is already translated to a sniff name, so no need to duplicate it. Also not a good idea to use backslashes in the error code as that makes configuration in the XML file more fiddly.

PHPCS config: include sniff from installed standard by name

Note: I've not changed the `composer.json` file, but it could also be considered to leave the sniff namespace the same and to change the `"Exercism\\": "src",` config in the `composer.json` file to `"Exercism\\": "src\\Exercism",`.
The class name is already translated to a sniff name, so no need to duplicate it. Also not a good idea to use backslashes in the error code as that makes configuration in the XML file more fiddly.

@tomasnorre tomasnorre left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR.
Looks good to me, but will let the others have a say too.

@tomasnorre
tomasnorre merged commit ed8d16a into tomasnorre:ci-fix-strict-types-sniff Nov 15, 2024
@jrfnl
jrfnl deleted the feature/fix-sniff-namingconventions-properly branch November 15, 2024 12:46
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.

2 participants