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

Universal/RequireFinalClass: various tweaks #164

Merged
merged 3 commits into from
Dec 1, 2022

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Dec 1, 2022

Universal/RequireFinalClass: make tests more descriptive

Universal/RequireFinalClass: always record the metric

As things were, the sniff would bow out if the opening brace for the class could not be found (yet) and would also not record the not abstract, not final metric in that case, even though for similar code using abstract or final, the metric would be recorded.

This commit ensures the not abstract, not final metric will now be recorded either way.

Universal/RequireFinalClass: act on more cases

As things were, the sniff would bow out if the opening brace for the class could not be found (yet).

This commit changes the sniff to act in more cases, i.e. it does require for a (non-empty) token after the class keyword, but once that token is found, the sniff will act.

Includes minor changes to how the message text is build up to prevent weird code snippets being show in the message.

Includes additional test.

As things were, the sniff would bow out if the opening brace for the class could not be found (yet) and would also not record the `not abstract, not final` metric in that case, even though for similar code using `abstract` or `final`, the metric _would_ be recorded.

This commit ensures the `not abstract, not final` metric will now be recorded either way.
As things were, the sniff would bow out if the opening brace for the class could not be found (yet).

This commit changes the sniff to act in more cases, i.e. it does require for a (non-empty) token after the `class` keyword, but once that token is found, the sniff will act.

Includes minor changes to how the message text is build up to prevent weird code snippets being show in the message.

Includes additional test.
@jrfnl jrfnl added this to the 1.0.0-alpha4 milestone Dec 1, 2022
@jrfnl jrfnl merged commit f1aa289 into develop Dec 1, 2022
@jrfnl jrfnl deleted the universal/requirefinalclass-various-tweaks branch December 1, 2022 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant