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

Rector hangs on a particular file #7649

Closed
rcmcdonald91 opened this issue Dec 8, 2022 · 4 comments
Closed

Rector hangs on a particular file #7649

rcmcdonald91 opened this issue Dec 8, 2022 · 4 comments
Labels

Comments

@rcmcdonald91
Copy link

rcmcdonald91 commented Dec 8, 2022

Bug Report

Subject Details
Rector version e.g. v0.15 (invoke vendor/bin/rector --version)

Minimal PHP Code Causing Issue

https://github.com/pfsense/pfsense/blob/master/src/etc/inc/priv.defs.inc

This file is one that is automatically generated, so it is skipped during normal Rector passes. However, this file is problematic for Rector. Rector just hangs processing this file and I haven't been able to work out why that is

Expected Behaviour

Rector should not hang

@samsonasik
Copy link
Member

Looking at your rector config, it seems you are using custom rector rule

https://github.com/pfsense/pfsense/blob/63a0efce7eb90ddea102e79a6750d4c19605f1cf/rector.php#L39

The bug may be in logic in your rule, you can debug with rector-debugging https://github.com/rectorphp/rector-debugging or other tools with -vvv command.

Also try using other existing rector rule, if the issue persist, that can be something todo:

@samsonasik
Copy link
Member

@staabm created PR on phpstan side for improve performance on huge array:

hopefully that will resolve it 👍

@staabm
Copy link
Contributor

staabm commented Dec 19, 2022

you are right that this might get faster with the linked PR. the file is using function calls (gettext), so it won't benefit from the linked PR as it is not constant.

the file itself looks like it would not benefit from using phpstan/rector on it, therefore I think it should be put on the ignore path for both tools though

@samsonasik
Copy link
Member

Ok 👍 , based on @staabm suggestion, ignore the file is the way to go, as the file itself is autogenerated.

I am closing it then ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants