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

Various comment sniffs: fix fixer conflicts #1812

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Dec 25, 2017

Another small PR to deal with fixer conflicts.

When a docblock comment is unfinished and at the end of a file - typically found in live coding situations -, fixer conflicts would occur through a combination of the Generic.Files.(No)Newline, Generic.Commenting.DocComment, Squiz.Commenting.DocCommentAlignment and the Squiz.Commenting.FileComment sniffs.

The fixer conflicts can be reproduced by checking out the first commit, which just contains the tests demonstrating the issue, and running:
phpcbf -p -s -vv ./src/Standards/Generic/Tests/Commenting/DocCommentUnitTest.inc --standard=Squiz
and
phpcbf -p -s -vv ./src/Standards/Squiz/Tests/Commenting/FileCommentUnitTest.2.inc --standard=Squiz

The changes made in the second commit basically just prevent the sniffs from throwing errors/fixing when no valid docblock closer tag is found.

@gsherwood
Copy link
Member

Just out of interest, are you running auto-fixes during live coding? If so, how is that working out?

@jrfnl
Copy link
Contributor Author

jrfnl commented Jan 2, 2018

Just out of interest, are you running auto-fixes during live coding? If so, how is that working out?

@gsherwood I'm not, but I am aware that there are IDEs out there which do.

I'm currently still finding these fixer conflicts based on the ruleset tests as discussed in #1645 (comment) (still some 60-something fixer conflicts to go... )

@gsherwood gsherwood added this to the 3.2.3 milestone Jan 7, 2018
@gsherwood
Copy link
Member

Thanks for these fixes

@gsherwood gsherwood merged commit a77d1ca into squizlabs:master Jan 17, 2018
gsherwood added a commit that referenced this pull request Jan 17, 2018
@jrfnl jrfnl deleted the feature/various-comment-sniffs-fixer-conflicts branch January 17, 2018 03:41
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