Skip to content

--only breaks next "normal" runs #9485

Closed

Description

@ghbob

Bug Report

Subject Details
Rector version 2.2.7

After running --only a "normal" run finishes instantly, telling me:

[OK] Rector is done!

process --dry-run --clear-cache works again.

Minimal PHP Code Causing Issue

Expected Behaviour

After --only, non---only runs should run "normally" and show all results again.
Or maybe I misunderstood how it should work and it caches the --only run and therefore has nothing to do before the next --clear-cache?

If that's the case, a short info about it here would be great: https://getrector.com/documentation/run-single-rule

Thanks!

Activity

  1. ghbob commented on Nov 6, 2025

    @ghbob
    Author

    looks like a cache thing:

    1. process --dry-run --clear-cache
    2. process --only="ClosureReturnTypeRector", ok, does its thing (30 files)
    3. process --only="AddArrowFunctionReturnTypeRector, does its thing but only on the files from the --only rule above? (10 files)
    4. process --only="AddArrowFunctionReturnTypeRector" --clear-cache does the rest (28 files)
  2. samsonasik commented on Nov 6, 2025

    @samsonasik
    Member

    The possible solution is enforce clear cache for run --only, like in the experimental kaizen feature (the kaizen feature removed tho)

  3. samsonasik commented on Nov 20, 2025

    @samsonasik
    Member

    I am going to close it, the --only command is used for apply on speficic rule, usually for apply multiple PRs as a use case, and use --clear-cache is expected if you want to start over.

    Tweaking it will make it too complicated just to make it works, as it will need verify previous command is using --only or not, and in current command without --only, that means another cache entry is needed.

    Thank you for understanding.

  4. ghbob commented on Nov 20, 2025

    @ghbob
    Author

    @samsonasik makes sense but I'd suggest to add this info to: https://getrector.com/documentation/run-single-rule otherwise this is not clear at all.

    thanks for your effort!

  5. samsonasik commented on Nov 20, 2025

    @samsonasik
    Member

    The website is open source, feel free to provide PR

    https://github.com/rectorphp/getrector-com/tree/main/resources/docs

    Thank you.

  6. github-actions commented on Apr 26, 2026

    @github-actions
    Contributor

    This issue has been automatically locked because it has been closed for 150 days. Please open a new issue if you have a similar problem.

  7. locked as resolved and limited conversation to collaborators on Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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