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

chore(deps): bump rector/rector from 0.19.8 to v1 (main) #9410

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Feb 28, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
rector/rector (source) ^0.19.8 -> ^1.0.1 age adoption passing confidence

Release Notes

rectorphp/rector (rector/rector)

v1.0.1: Released Rector 1.0.1

Compare Source

New Features 🥳

  • [Custom] Add "detect-node" command to help with writing custom rules (#​5576)
  • [Config] Add registerService() method to allow container extension (#​5591)
  • [TypeDeclaration] Add AddTestsVoidReturnTypeWhereNoReturnRector (#​5611)
  • [PHP 8.0] Add always class to AnnotationToAttribute to include string to ::class reference conversion (#​5619)
  • [CodeQuality] Add StaticToSelfStaticMethodCallOnFinalClassRector (#​5621)

Bugfixes 🐛

  • ExplicitBoolCompareRector: skip phpdoc (#​5567), Thanks @​staabm!
  • Fix ArrayTypeMapper to handle arrays with UnionType items (#​8225) (#​5568), Thanks @​pkvach!
  • [Configuration] Fix detect /vendor on root project on vendor analyzed on VendorMissAnalyseGuard (#​5569)
  • Fix missing / suffix on VendorMissAnalyseGuard (#​5571)
  • [PHP81] Skip after is_string on object call on NullToStrictStringFuncCallArgRector (#​5572)
  • [Config] Make sure only one of type-declaration/dead-code or with*Level() is used to avoid duplicates (#​5578)
  • Fix undefined MHASH_* constant on running downgrade from php 8.0 (#​5585)
  • [NodeTypeResolver] Ignore PHPStan internal error on PHPStanNodeScopeResolver on NodeScopeResolver::processNodes() (#​5586)
  • [Php81] Skip possible array on NullToStrictStringFuncCallArgRector (#​5587)
  • [Php81] Skip another possible cast array to string on NullToStrictStringFuncCallArgRector (#​5589)
  • [Transform] Allow class const fetch value on rules() on RectorConfigBuilderRector (#​5596)
  • [Performance] Use strlen() early before loop on VendorMissAnalyseGuard (#​5597)
  • Copy subtype phpdoc on ClassPropertyAssignToConstructorPromotionRector (#​8438) (#​5603), Thanks @​pkvach!
  • config method must be static, to avoid creating rule before loading related ctor services (#​5606)
  • fix config for configured rule (rectorphp/rector-src@5edb023)
  • [PHP 8.0] Fix annotation to attribute in case of FQN class without () (#​5609)
  • [Php80] Support windows new line line DoctrineAnnotationDecorator::LONG_ANNOTATION_REGEX (#​5610)
  • [Php81] Handle after open parentheses on AnnotationToAttributeRector (#​5613)
  • [BetterPhpDocParser] Move split new line with @​\ to regex to support windows new line (#​5615)
  • [Php81] Handle nested Fqcn UniqueConstraint on NestedAnnotationToAttributeRector (#​5614)
  • [DX] Accept Y/y for confirmation of init config (#​5616)
  • [CodeQuality] Skip private static call from static:: on LocallyCalledStaticMethodToNonStaticRector (#​5620)
  • [PostRector] Skip remove unused imports on used in multiple docs in single node (#​5604)
  • [DeadCode] Skip sub type false => bool on RemoveUselessVarTagRector (#​5588)

Removed 💀

  • [DeadCode] Skip with magic __get() on RemoveUnusedPromotedPropertyRector (#​5573)
  • [DX] Remove phpstan strict rules to ease contributing (#​5579)
  • [DX] Remove type covarege, as handled by phpstan itself (#​5583)
  • [DeadCode] Handle used in assign return on RemoveUnusedPrivatePropertyRector (#​5608)

v1.0.0: Released Rector 1.0.0 🎉🎉🎉

Compare Source

The stable Rector version is here. It was about time and we've done all planned changes by the end of 2023.


What could be better time and place to release a stable Rector than live on stage during talk 🎉


While this release brings stable API, it will be easier to stay up to date as well. The 1.x versioning behaves as expected with composer update (compared to special 0.x).

Our main focus is on improving developers experience. This release brings new features that help with custom rules writing, adding Rector to CI and adding Rector to any legacy project in general.


Some features are partially available in previous version, but we'd like to highligh them because since 1.0 you can use them all together.


Zen Config with Autocomplete

If you run Rector for the first time, it will create a rector.php config with your project paths for you. In past we used various class constants references to add commonly used rule sets. This required knowledge about these classes and was often missed.

We've changed this to work with single configuration class. It provides autocomplete for available sets, including attributes:

use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withPreparedSets(codeQuality: true, codingStyle: true)
    ->withAttributesSets(symfony: true, doctrine: true)
    ->withPaths([
        __DIR__ . '/src',
        __DIR__ . '/tests',
    ])
    ->withRootFiles();

PHP Sets Automated

To keep up to date with you PHP, now you can use single method:

use Rector\Config\RectorConfig;

return RectorConfig::configure()
    ->withPhpSets();

It learns about PHP version from your composer.json and will always keep sync with your required PHP version. No need to double check rector.php configuration anymore.


Streamline Integration to Projects

We're also adding 2 experimental methods, that make Rector integration to new projects easier. Before, you could run whole type declaration or read code set, see 1000 changed files and rather close it being overwhelmed. Instead, we want to take it slow, as we do with our custom upgrades as well:

use Rector\Config\RectorConfig;

return RectorConfig::configure()
     ->withTypeCoverageLevel(10)
     ->withDeadCodeLevel(10)

Now you can improve your code base one rule at a time. The rules are sorted from the easiest to integrate, e.g. add void to closure, to more complex one. That way you can improve your code base in your own pace. We're collecting feedback on rule order, so the levels will likely change.


New and Improved Commands

  • We added a new command to generate bare custom rule files and structure for you:
vendor/bin/rector custom-rule

Call the command, type the rule name and rule, its test and composer autoload is generated for you. So you can focus on the contents of refactor() method.


  • We improve the command, that generates Github and Gitlab CI setup files, so you can let Rector work for you:
vendor/bin/rector setup-ci

The command handles generic setup for you and then guides you to register needed access.


Configuration

📅 Schedule: Branch creation - "before 5am on wednesday" in timezone Europe/Vienna, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@ChristophWurst ChristophWurst merged commit 0ad7ee0 into main Feb 28, 2024
37 checks passed
@ChristophWurst ChristophWurst deleted the renovate/main-rector-rector-1.x branch February 28, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant