Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly comply with PHPCS naming conventions #2

Conversation

jrfnl
Copy link

@jrfnl jrfnl commented Nov 15, 2024

👉 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.
Copy link
Owner

@tomasnorre tomasnorre left a comment

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
13 checks passed
@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