Skip to content

fix(ValueObject): FileDiff first line number is below as expected#6746

Merged
TomasVotruba merged 1 commit intorectorphp:mainfrom
neilime:fix-value-object-file-diff-first-line-number-below-as-expected
Feb 20, 2025
Merged

fix(ValueObject): FileDiff first line number is below as expected#6746
TomasVotruba merged 1 commit intorectorphp:mainfrom
neilime:fix-value-object-file-diff-first-line-number-below-as-expected

Conversation

@neilime
Copy link
Copy Markdown
Contributor

@neilime neilime commented Feb 20, 2025

/This PR fixes an issue with printed line number in report:

The line number of file is below than expected (1 less than the line in file).

Example:

Console output:

> tools/vendor/bin/rector process src '--dry-run'
 2/2 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
2 files with changes
====================

1) src/CssLint/CliArgs.php:41

    ---------- begin diff ----------
@@ @@

         foreach ($arguments as $sArgument) {
             // --foo --bar=baz
-            if (substr($sArgument, 0, 2) == '--') {

Note

The console outputs says that a change diff is starting at line 41

File src/CssLint/CliArgs.php:

image

Warning

We can see that the diff change starts at line 42, not 41

@neilime neilime marked this pull request as ready for review February 20, 2025 09:19
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
@TomasVotruba TomasVotruba merged commit b176480 into rectorphp:main Feb 20, 2025
44 checks passed
@TomasVotruba
Copy link
Copy Markdown
Member

Thank you 🙏

@neilime neilime deleted the fix-value-object-file-diff-first-line-number-below-as-expected branch February 20, 2025 09:56
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants