-
Notifications
You must be signed in to change notification settings - Fork 396
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
Adding Scans for Deprecated Function in Core #3386
Conversation
@aweingarten might make sense to add this to the validate:all (similar to how we did the security one) so it runs as part of the standard validation process, then we can disable parts of it. |
also, IMHO, this should be disabled by default. |
2de94e8
to
8b86389
Compare
1: Added this to the validate all call. |
50df8e3
to
495ca67
Compare
@aweingarten i'm ok with it running, as long as it's not scanning files. so maybe just comment out the file sets by default? |
FYI looks like phpcs validation failures on the build failure |
a2a24d1
to
91fd0d3
Compare
PHPCS addressed |
@mikemadison13 okay I think all the feedback has been addressed. Just nailing down one build failure. How do you want this to be socialized/documented? |
91d6f55
to
0fc083d
Compare
honestly, we don't have a section on validation in the docs (that i see). we probably need to refactor the testing docs to better differentiate between automated testing and validation that occurs in blt. let me think on this a bit and get back to you. |
Sounds good. I am thinking that we should also probably think about adding it to the the release notes so that people start enabling it. Also once we get this turned on for deprecation, increasing the sensitivity of PHPstan to Level 2-7 scans is also freaking awesome. It's really worth considering nudging people as we head towards D9. Checkout the results of the scan for Acquia connector. |
So @mikemadison13 I'm an idiot. There is an obvious answer here. What if we make this work like PHPCS where we only scan the files that have changed rather than all the things? That way we gently make the world a better place without immediate whiplash? |
@aweingarten i really like that idea, although i would be interested in benchmarking it. i do think that creates some disparity between "why are my changed files getting deprecation scans" and my others ones aren't. i do think we need this to be on globally or off globally, so maybe the commit scan needs to respect the same rules as the normal scan (just within the changed fileset) |
So anecdotally the time for our custom files is under 30 seconds. As for the disparity it already exists for PHPCS so I think we are okay. |
it does, but re: #3366 i'm trying to change that since commit hooks find different things than blt validate and that is driving me batty. |
e98e155
to
4206872
Compare
5aaf8e2
to
ba9385f
Compare
The disconnect between pre-commit validation and Rather, I'd like to see this run alongside all of the other validations during In 10.0.x, it can be enabled by default, if we can get this PR in before 10.0.0 drops. But it should have a message clearly indicating how to disable it when/if it fails. In 9.2.x, it should be disabled by default (if we decide to backport it to 9.2.x at all). |
9233985
to
ff2d28a
Compare
@danepowell
Can you elaborate on this? Let me know what you are looking for here. I thought that the phpstan scans were built into |
composer.json
Outdated
"phpunit/phpunit": "^4.8|^6.5", | ||
"squizlabs/php_codesniffer": "^3.0.1" | ||
"squizlabs/php_codesniffer": "^3.0.1", |
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.
Think this trailing comma isn't valid JSON
The problem with PHPCS is that if you pass it a list of files to check (i.e. during git pre-commit hook), it will always scan those files even if they wouldn't otherwise be scanned according to the defined filesets in BLT and/or phpcs.xml.dist. As long as this filters the file list (i.e. scans an intersection between git changed files and the phpstan fileset) it should be fine. |
Looks like tests are still failing, and there are still some comments from Matt to address. |
@danepowell I should have time this weekend to devote to this PR! |
Given the dismissive nature of the maintainer here: #3438 and the lack of support on getting local testing working I'm going to close this PR. It's not worth the effort struggling to make this work. |
This PR will scan custom code in the standard locations for deprecated functions and fail the build if they are found. This will help the progression to D9!
It should the same patterns as PHPCS or Symfony Security Scans