Skip to content

Endless loop of : [OK] 1 file has been changed by Rector #9661

@t-liesche-tqgg

Description

@t-liesche-tqgg

Bug Report

Subject Details
Rector version 2.3.7

We can't really tell what's going on, but in some of our projects the CI pipeline started failing after upgrading rector to version 2.3.7. Downgrading the library to 2.3.6 fixes the issue.

Minimal PHP Code Causing Issue

`vendor/bin/rector --debug
[info] Sets loaded based on installed packages:

  • /opt/host/projects/***/vendor/rector/rector/vendor/rector/rector-phpunit/config/sets/phpunit120.php
  • /opt/host/projects/***/vendor/rector/rector/vendor/rector/rector-phpunit/config/sets/phpunit125.php
  • /opt/host/projects/***/vendor/rector/rector/vendor/rector/rector-symfony/config/sets/symfony/symfony7/symfony70/symfony70-http-foundation.php
  • /opt/host/projects/***/vendor/rector/rector/vendor/rector/rector-symfony/config/sets/symfony/symfony7/symfony72/symfony72-http-foundation.php

[...]

1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

[OK] 1 file has been changed by Rector`

There is not a single error or change indication in the list of processed files.

Running the command repeatedly will always print the exact same output without actually changing anything. Dry run fails as well with return code 2:

`vendor/bin/rector --dry-run
1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

[OK] 1 file would have been changed (dry-run) by Rector`

Expected Behaviour

Rector should either fix the code or not fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions