rename *.yml to *.yaml

This commit is contained in:
Tomas Votruba 2019-02-03 18:46:45 +01:00
parent 85f698b71c
commit 0db2b07d49
115 changed files with 59 additions and 59 deletions

4
.gitattributes vendored
View File

@ -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
View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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
View File

@ -0,0 +1,8 @@
imports:
- { resource: '../packages/**/config/config.yaml' }
- { resource: 'services.yaml' }
parameters:
exclude_paths: []
exclude_rectors: []
autoload_paths: []

View File

@ -1,8 +0,0 @@
imports:
- { resource: '../packages/**/config/config.yml' }
- { resource: 'services.yml' }
parameters:
exclude_paths: []
exclude_rectors: []
autoload_paths: []

View File

@ -1,5 +1,5 @@
imports:
- { resource: "mysql_to_mysqli.yml" }
- { resource: "mysql_to_mysqli.yaml" }
services:
Rector\Php\Rector\FunctionLike\Php4ConstructorRector: ~

View File

@ -1,3 +1,3 @@
imports:
# underscore naming to namespaced classes changes
- { resource: 'underscore-to-namespace.yml' }
- { resource: 'underscore-to-namespace.yaml' }

View File

@ -1,3 +1,3 @@
imports:
# underscore naming to namespaced classes changes
- { resource: 'underscore-to-namespace.yml' }
- { resource: 'underscore-to-namespace.yaml' }

View File

@ -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

View File

@ -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: ~

View File

@ -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!

View File

@ -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) {

View File

@ -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());

View File

@ -19,6 +19,6 @@ final class JmsInjectAnnotationRectorTest extends AbstractRectorTestCase
protected function provideConfig(): string
{
return __DIR__ . '/config.yml';
return __DIR__ . '/config.yaml';
}
}

View File

@ -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 = '#')

View File

@ -25,6 +25,6 @@ final class EachRectorTest extends AbstractRectorTestCase
protected function provideConfig(): string
{
return __DIR__ . '/config.yml';
return __DIR__ . '/config.yaml';
}
}

View File

@ -16,6 +16,6 @@ final class Php72RectorTest extends AbstractRectorTestCase
protected function provideConfig(): string
{
return __DIR__ . '/config_php72.yml';
return __DIR__ . '/config_php72.yaml';
}
}

View File

@ -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
));
}

View File

@ -13,6 +13,6 @@ final class ContainerGetToConstructorInjectionRectorTest extends AbstractRectorT
protected function provideConfig(): string
{
return __DIR__ . '/config.yml';
return __DIR__ . '/config.yaml';
}
}

View File

@ -18,6 +18,6 @@ final class GetToConstructorInjectionRectorTest extends AbstractRectorTestCase
protected function provideConfig(): string
{
return __DIR__ . '/config.yml';
return __DIR__ . '/config.yaml';
}
}

View File

@ -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']);

View File

@ -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';
}
}

View File

@ -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';
}
}

View File

@ -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

View File

@ -146,6 +146,6 @@ final class Application extends SymfonyApplication
private function getDefaultConfigPath(): string
{
return getcwd() . '/rector.yml';
return getcwd() . '/rector.yaml';
}
}

View File

@ -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);

View File

@ -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

View File

@ -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