-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Correct pluralization of the word space/spaces depending on the spacing value #3881
Closed
DannyvdSluijs
wants to merge
5
commits into
squizlabs:master
from
DannyvdSluijs:ImproveMessageReadabilityForMissingSpaces
Closed
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cf5cad1
fix: Correct pluralization of the word space/spaces depending on the …
DannyvdSluijs ed9d2b8
style: Correct code style violations
DannyvdSluijs 2d51a63
Generic/ArrayIndent: add test covering the change
jrfnl a99c2d5
Squiz/ArrayDeclaration: test for CloseBraceNotAligned
jrfnl 5e03f11
fix: Correct pluralization of the word space/spaces depending on the …
DannyvdSluijs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Detailed notes:
|
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sniff has three distinct error messages, which each use the "spaces" phrasing.
The last one (close brace) has now been adjusted, but the other two messages still have the same issue.
I also noted that there are no tests covering this change as
indent 1
isn't used in the test file. While this wouldn't make a difference for the automated tests (as those don't test the actual error message), not having those tests there means that the change cannot easily be tested manually either and that code coverage goes down.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jrfnl thanks for the review and detailed messages. You mentioned the other two cases not being updated. This is a good spot and also shows that the words being used in the messages can be all over the place. Based on your other PR I searched the code base for
spaces
being mentioned in the error message. Searching for%s spaces
in the codebase shows a total of 42 occurrences. This PR was drafted by searching forspace(s)
and fixing those.What do you thing would be the desired approach here? Fix all the
spaces
occurrences using this same PR or target those for another PR (which I'm happy to create as well)With regards to the coverage going done due the missing test that is actually somewhat of a valid point. I can look into adding these where possible. My only concern would be the amount of cases where I needed to tweak some of the config of class property values to get to the correct scenario to return the specific error message. Any tips you can share on how to approach that?
Also looking ahead at your other comment I guess answering this would help on that instance as well.
Happy to tweak the PR but some nudge into the correct direction would be helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, I'd keep this PR for the sniffs which are already being handled in it and would open separate PR(s) for changes to other sniffs. That way, this PR won't get blocked for merge by the new set of changes..
As a general rule of thumb, I normally try to keep PRs small and self-contained. That way, each PR can be reviewed and merged on their own merit. This prevents an incomplete or incorrect change to one file blocking the merge of the other changes, which may be perfectly ready to go.
It also makes it easier to review PRs, as a reviewer only needs to focus on one thing at a time and there is no risk of a PR getting blocked because it contains multiple different decision points (5 decisions: yes, 1: no, PR can't get merged).
Does that help ?
Well, to test the changes in the PR, I actually created some tests (locally) for the existing changes which weren't being hit by the tests. Would it help you if I would push those tests to this branch so you can see the tests I added (and how to change the sniff properties from within a test file) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, valid points indeed. Most just wanted to make sure we are aligned here.
So I'll make sure that for any file already touched in this PR the issues with the words
spaces
is also addressed.Yes if you can please or if pushing is too much of a hassle feel free to drop some diff content here and I can take it from there as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No hassle, I check remote branches out locally anyway to test them. The tests should now show in your branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoot! I just noticed the tests are failing now as I tested your changes in isolation (excluded the other error messages from the sniff). Let me fix that up. (I will force push the changes, so give me a moment before you pull the changes in)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've corrected all the plural cases on
spaces
in the files touched in this PR.Looking at the tests and your additions I was mostly overwhelmed by the structure. How would you even check if specific cases are covered?