mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-13 12:02:09 +02:00
rename *.yml to *.yaml
This commit is contained in:
parent
85f698b71c
commit
0db2b07d49
4
.gitattributes
vendored
4
.gitattributes
vendored
@ -21,5 +21,5 @@ LICENSE export-ignore
|
||||
ecs.yml export-ignore
|
||||
phpstan.neon export-ignore
|
||||
phpunit.xml export-ignore
|
||||
create-rector.yml.dist export-ignore
|
||||
rector.yml export-ignore
|
||||
create-rector.yaml.dist export-ignore
|
||||
rector.yaml export-ignore
|
||||
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
/rector.yml
|
||||
/rector.yaml
|
||||
/temp
|
||||
!/temp/.gitkeep
|
||||
/example
|
||||
@ -8,10 +8,10 @@ composer.lock
|
||||
.idea/
|
||||
|
||||
/demo
|
||||
rector-symfony.yml
|
||||
|
||||
.phpunit.result.cache
|
||||
|
||||
# often customized locally - example on Github is just fine
|
||||
create-rector.yml
|
||||
create-rector.yaml
|
||||
phpstan-dependencies.json
|
||||
phpstan-paths.txt
|
||||
|
@ -12,6 +12,6 @@ WORKDIR /rector
|
||||
COPY . /rector
|
||||
COPY --from=composer /app .
|
||||
|
||||
CMD ["bin/rector", "process", "/project", "--dry-run", "--config", "/project/rector.yml"]
|
||||
CMD ["bin/rector", "process", "/project", "--dry-run", "--config", "/project/rector.yaml"]
|
||||
|
||||
# TODO: dev with xdebug extension for local development
|
10
README.md
10
README.md
@ -63,10 +63,10 @@ Rector relies on project and autoloading of its classes. To specify own autoload
|
||||
vendor/bin/rector process ../project --autoload-file ../project/vendor/autoload.php
|
||||
```
|
||||
|
||||
Or make use of `rector.yml` config:
|
||||
Or make use of `rector.yaml` config:
|
||||
|
||||
```yaml
|
||||
# rector.yml
|
||||
# rector.yaml
|
||||
parameters:
|
||||
autoload_paths:
|
||||
- 'vendor/squizlabs/php_codesniffer/autoload.php'
|
||||
@ -78,7 +78,7 @@ parameters:
|
||||
You can also **exclude files or directories** (with regex or [fnmatch](http://php.net/manual/en/function.fnmatch.php)):
|
||||
|
||||
```yaml
|
||||
# rector.yml
|
||||
# rector.yaml
|
||||
parameters:
|
||||
exclude_paths:
|
||||
- '*/src/*/Tests/*'
|
||||
@ -87,7 +87,7 @@ parameters:
|
||||
Do you want to use whole set, except that one rule? Exclude it:
|
||||
|
||||
```yaml
|
||||
# rector.yml
|
||||
# rector.yaml
|
||||
parameters:
|
||||
exclude_rectors:
|
||||
- 'Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector'
|
||||
@ -123,7 +123,7 @@ vendor/bin/rector process "src/Symfony/Component/*/Tests" --level phpunit60 --dr
|
||||
|
||||
### B. Custom Sets
|
||||
|
||||
1. Create `rector.yml` with desired Rectors:
|
||||
1. Create `rector.yaml` with desired Rectors:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
|
@ -1,3 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
# trailing whitespaces
|
||||
sed -i -E 's#\s+$##g' config/level/*/*.yml docs/*.md README.md
|
||||
sed -i -E 's#\s+$##g' config/level/*/*.yaml docs/*.md README.md
|
||||
|
8
config/config.yaml
Normal file
8
config/config.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
imports:
|
||||
- { resource: '../packages/**/config/config.yaml' }
|
||||
- { resource: 'services.yaml' }
|
||||
|
||||
parameters:
|
||||
exclude_paths: []
|
||||
exclude_rectors: []
|
||||
autoload_paths: []
|
@ -1,8 +0,0 @@
|
||||
imports:
|
||||
- { resource: '../packages/**/config/config.yml' }
|
||||
- { resource: 'services.yml' }
|
||||
|
||||
parameters:
|
||||
exclude_paths: []
|
||||
exclude_rectors: []
|
||||
autoload_paths: []
|
@ -1,5 +1,5 @@
|
||||
imports:
|
||||
- { resource: "mysql_to_mysqli.yml" }
|
||||
- { resource: "mysql_to_mysqli.yaml" }
|
||||
|
||||
services:
|
||||
Rector\Php\Rector\FunctionLike\Php4ConstructorRector: ~
|
@ -1,3 +1,3 @@
|
||||
imports:
|
||||
# underscore naming to namespaced classes changes
|
||||
- { resource: 'underscore-to-namespace.yml' }
|
||||
- { resource: 'underscore-to-namespace.yaml' }
|
@ -1,3 +1,3 @@
|
||||
imports:
|
||||
# underscore naming to namespaced classes changes
|
||||
- { resource: 'underscore-to-namespace.yml' }
|
||||
- { resource: 'underscore-to-namespace.yaml' }
|
@ -28,4 +28,4 @@ code_after: |
|
||||
|
||||
source: # e.g. link to RFC or headline in upgrade guide, 1 or more in the list
|
||||
- ""
|
||||
level: "" # e.g. symfony30.yml, target config to append this rector to
|
||||
level: "" # e.g. symfony30.yaml, target config to append this rector to
|
@ -4,7 +4,7 @@
|
||||
|
||||
## 1. Finds all files and Load Configured Rectors
|
||||
|
||||
- The application finds files in source you provide and registeres Rectors - from `--level`, `--config` or local `rector.yml`
|
||||
- The application finds files in source you provide and registeres Rectors - from `--level`, `--config` or local `rector.yaml`
|
||||
- Then it iterates all found files and applies relevant Rectors to them.
|
||||
- *Rector* in this context is 1 single class that modifies 1 thing, e.g. changes class name
|
||||
|
||||
@ -59,7 +59,7 @@ E.g. in this case, first will be changed `@expectedException` annotation to meth
|
||||
then a method `setExpectedException` to `expectedException`.
|
||||
|
||||
```yaml
|
||||
# rector.yml
|
||||
# rector.yaml
|
||||
services:
|
||||
Rector\PHPUnit\Rector\ExceptionAnnotationRector: ~
|
||||
|
||||
|
@ -97,7 +97,7 @@ final class MyFirstRector extends AbstractRector
|
||||
}
|
||||
```
|
||||
|
||||
## 3. Register it `rector.yml`
|
||||
## 3. Register it `rector.yaml`
|
||||
|
||||
```diff
|
||||
services:
|
||||
@ -113,10 +113,10 @@ vendor/bin/rector process src --dry-run
|
||||
vendor/bin/rector process src
|
||||
```
|
||||
|
||||
If you use `rector.yml` from another directory or another name, set it with `--config` option:
|
||||
If you use `rector.yaml` from another directory or another name, set it with `--config` option:
|
||||
|
||||
```bash
|
||||
vendor/bin/rector process src --config ../custom-rector.yml
|
||||
vendor/bin/rector process src --config ../custom-rector.yaml
|
||||
```
|
||||
|
||||
That's it!
|
||||
|
@ -81,7 +81,7 @@ final class CreateRectorCommand extends Command implements ContributorCommandInt
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$configuration = $this->configurationFactory->createFromConfigFile(getcwd() . '/create-rector.yml');
|
||||
$configuration = $this->configurationFactory->createFromConfigFile(getcwd() . '/create-rector.yaml');
|
||||
$templateVariables = $this->templateVariablesFactory->createFromConfiguration($configuration);
|
||||
|
||||
foreach ($this->findTemplateFileInfos() as $smartFileInfo) {
|
||||
|
@ -133,7 +133,7 @@ final class ConfigurationFactory
|
||||
|
||||
$finder = Finder::create()->files()
|
||||
->in($this->levelsDirectory)
|
||||
->name(sprintf('#%s(\.yml)?$#', $level));
|
||||
->name(sprintf('#%s(\.yaml)?$#', $level));
|
||||
|
||||
/** @var SplFileInfo[] $fileInfos */
|
||||
$fileInfos = iterator_to_array($finder->getIterator());
|
||||
|
@ -19,6 +19,6 @@ final class JmsInjectAnnotationRectorTest extends AbstractRectorTestCase
|
||||
|
||||
protected function provideConfig(): string
|
||||
{
|
||||
return __DIR__ . '/config.yml';
|
||||
return __DIR__ . '/config.yaml';
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ final class EregToPcreTransformer
|
||||
private $pcreDelimiter;
|
||||
|
||||
/**
|
||||
* Change this via services configuratoin in rector.yml if you need it
|
||||
* Change this via services configuratoin in rector.yaml if you need it
|
||||
* Single type is chosen to prevent every regular with different delimiter.
|
||||
*/
|
||||
public function __construct(string $pcreDelimiter = '#')
|
||||
|
@ -25,6 +25,6 @@ final class EachRectorTest extends AbstractRectorTestCase
|
||||
|
||||
protected function provideConfig(): string
|
||||
{
|
||||
return __DIR__ . '/config.yml';
|
||||
return __DIR__ . '/config.yaml';
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,6 @@ final class Php72RectorTest extends AbstractRectorTestCase
|
||||
|
||||
protected function provideConfig(): string
|
||||
{
|
||||
return __DIR__ . '/config_php72.yml';
|
||||
return __DIR__ . '/config_php72.yaml';
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ final class SymfonyKernelParameterGuard
|
||||
// ensure value is not null nor empty
|
||||
if ($kernelClass === null || $kernelClass === '') {
|
||||
throw new InvalidConfigurationException(sprintf(
|
||||
'Make sure "%s" parameters is set in rector.yml in "parameters:" section',
|
||||
'Make sure "%s" parameters is set in rector.yaml in "parameters:" section',
|
||||
Option::KERNEL_CLASS_PARAMETER
|
||||
));
|
||||
}
|
||||
|
@ -13,6 +13,6 @@ final class ContainerGetToConstructorInjectionRectorTest extends AbstractRectorT
|
||||
|
||||
protected function provideConfig(): string
|
||||
{
|
||||
return __DIR__ . '/config.yml';
|
||||
return __DIR__ . '/config.yaml';
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,6 @@ final class GetToConstructorInjectionRectorTest extends AbstractRectorTestCase
|
||||
|
||||
protected function provideConfig(): string
|
||||
{
|
||||
return __DIR__ . '/config.yml';
|
||||
return __DIR__ . '/config.yaml';
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ final class InvalidConfigurationConstructorInjectionRectorTest extends AbstractR
|
||||
{
|
||||
$this->expectException(InvalidConfigurationException::class);
|
||||
$this->expectExceptionMessage(
|
||||
'Make sure "kernel_class" parameters is set in rector.yml in "parameters:" section'
|
||||
'Make sure "kernel_class" parameters is set in rector.yaml in "parameters:" section'
|
||||
);
|
||||
|
||||
$this->doTestFiles([__DIR__ . '/Fixture/fixture.php.inc']);
|
||||
|
@ -22,6 +22,6 @@ final class SecondInvalidConfigurationConstructorInjectionRectorTest extends Abs
|
||||
|
||||
protected function provideConfig(): string
|
||||
{
|
||||
return __DIR__ . '/invalid-config-2.yml';
|
||||
return __DIR__ . '/invalid-config-2.yaml';
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,6 @@ final class ThirdInvalidConfigurationConstructorInjectionRectorTest extends Abst
|
||||
|
||||
protected function provideConfig(): string
|
||||
{
|
||||
return __DIR__ . '/invalid-config-3.yml';
|
||||
return __DIR__ . '/invalid-config-3.yaml';
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ final class AfterRectorCodingStyle
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private const ECS_AFTER_RECTOR_CONFIG = __DIR__ . '/../../ecs-after-rector.yml';
|
||||
private const ECS_AFTER_RECTOR_CONFIG = __DIR__ . '/../../ecs-after-rector.yaml';
|
||||
|
||||
/**
|
||||
* @param string[] $source
|
||||
|
@ -146,6 +146,6 @@ final class Application extends SymfonyApplication
|
||||
|
||||
private function getDefaultConfigPath(): string
|
||||
{
|
||||
return getcwd() . '/rector.yml';
|
||||
return getcwd() . '/rector.yaml';
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ final class RectorKernel extends Kernel
|
||||
|
||||
public function registerContainerConfiguration(LoaderInterface $loader): void
|
||||
{
|
||||
$loader->load(__DIR__ . '/../../config/config.yml');
|
||||
$loader->load(__DIR__ . '/../../config/config.yaml');
|
||||
|
||||
foreach ($this->extraConfigFiles as $extraConfigFile) {
|
||||
$loader->load($extraConfigFile);
|
||||
|
@ -24,7 +24,7 @@ final class RectorGuard
|
||||
}
|
||||
|
||||
throw new NoRectorsLoadedException(sprintf(
|
||||
'We need some rectors to run:%s* register them in rector.yml under "services:"%s* use "--level <level>"%s* or "--config <file>.yml"',
|
||||
'We need some rectors to run:%s* register them in rector.yaml under "services:"%s* use "--level <level>"%s* or "--config <file>.yaml"',
|
||||
PHP_EOL,
|
||||
PHP_EOL,
|
||||
PHP_EOL
|
||||
|
@ -22,6 +22,6 @@ final class ExcludePathsTest extends AbstractConfigurableContainerAwareTestCase
|
||||
|
||||
protected function provideConfig(): string
|
||||
{
|
||||
return __DIR__ . '/config/config-with-excluded-paths.yml';
|
||||
return __DIR__ . '/config/config-with-excluded-paths.yaml';
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user