-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add attribute sniffs #296
Add attribute sniffs #296
Conversation
Our test fixtures should be updated to reflect the proposed change. |
@derrabus have a look if I did it properly |
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.
You'll also need to adapt the report summary
A TOTAL OF 429 ERRORS AND 0 WARNINGS WERE FOUND IN 46 FILES
and all the patches
I think |
is there some tool which generates the patches? seems tedious to do this by hand... |
I am trying the makefile
|
I am sorry, I tried to make the patches work, but I only created mess. I have forced pushed back the latest version which has expected_report.txt for PHP8.1 working fine, please somebody do the dirty work and finish the patches for 7.2-8.0. @kukulich I have also added the |
Yeah, updating the patches is a pain, I'll give it a try. Also, I'll retarget to 11.0, which is the correct branch according to https://www.doctrine-project.org/projects/doctrine-coding-standard/en/stable/reference/index.html#testing |
Ugh I should have started with that 🤦 |
@@ -530,7 +530,7 @@ diff --git a/tests/input/arrow-functions-format.php b/tests/input/arrow-function | |||
index d3903ff..8a358e8 100644 | |||
--- a/tests/input/arrow-functions-format.php |
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 wonder why there are so many changes 🤔 something is wrong. Should I clean it up?
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.
Maybe what I did was wrong? How do you usually proceed? What I did was:
- edit the patch to remove the hunk about the expected report, so that it applies
- apply the patch
- set the correct php version in
phpcs.xml.dist
- run
vendor/bin/phpcs $(find tests/input/* | sort) --report=summary --report-file=tests/expected_report.txt
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.
Depends, I sometimes do it by hand. I have re-applied patches on 11.x branch and there are little changes only.
I guess this must be run on related php version vendor/bin/phpcs $(find tests/input/* | sort) --report=summary --report-file=tests/expected_report.txt
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.
@simPod I experienced the same issue, this is why I asked for somebody to finish it. Yes, it seems PHP version running the phpcs is relevant. I guess it also installs different versions of composer dependencies, especially for e.g. 7.2
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 believe nobody here likes the patches but that's the best we've got. I'll look into it.
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.
Yes, there are sniffs that are enabled/disabled by detected PHP version - and it’s intentional here.
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 forced the php version in step 3 of my process (otherwise the tests would be red)
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.
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.
You mean #298
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.
Yes. I have done +1 but somebody opened a PR meanwhile :D
Add new attribute sniffs to doctrine standard