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

Add [file] + [rule] debug info on --debug + fix literal number downgrade type change to string #2302

Merged
merged 4 commits into from May 12, 2022

Conversation

TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented May 12, 2022

Fixes https://github.com/symplify/symplify/runs/6405930856?check_suite_focus=true


As there are dozens of rule that can be applied on a file, the combination of both is always crutial for debugging.
Before we had only all files or all rules at the same time, making it hard to find the duo.

Now Rector will print both right next to each other so it's easier to find even in big logs:

image

Ref #2292 (comment)

@TomasVotruba TomasVotruba changed the title tv misc Add [file] + [rule] debug info on --debug May 12, 2022
@TomasVotruba TomasVotruba changed the title Add [file] + [rule] debug info on --debug Add [file] + [rule] debug info on --debug + fix literal number downgrade type change to string May 12, 2022
Comment on lines 110 to 118
// we have to hack around tokens to get original value, see https://github.com/nikic/PHP-Parser/pull/832
$oldTokens = $this->file->getOldTokens();
$tokenValue = $oldTokens[$node->getStartTokenPos()][1] ?? null;

if ($tokenValue === null) {
return true;
}

return true;
return ! str_contains($tokenValue, '_');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully we can get rid of this global token access after raw value is supported nativelly in both LNumber and DNumber:

@TomasVotruba TomasVotruba merged commit 93cf392 into main May 12, 2022
@TomasVotruba TomasVotruba deleted the tv-misc branch May 12, 2022 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants