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

Rename .php_cs -> .php-cs-fixer.dist.php #5691

Merged

Conversation

jeffwidman
Copy link
Member

@jeffwidman jeffwidman commented Sep 12, 2022

Fix deprecation warning by renaming the config file:

  15.95 > php-cs-fixer fix --diff --verbose '--dry-run'
  16.10 You are running PHP CS Fixer v2, which is not maintained anymore. Please update to v3.
  16.10 You may find an UPGRADE guide at https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v3.3.0/UPGRADE-v3.md .
  16.10 If you need help while solving warnings, ask at https://gitter.im/PHP-CS-Fixer, we will help you!
  16.10
  16.10 PHP CS Fixer 2.19.3 Testament by Fabien Potencier and Dariusz Ruminski
  16.10 Runtime: PHP 7.4.30
  16.10 Loaded config default from "/opt/composer/v1/.php_cs".
  16.14 ......
  16.26 Legend: ?-unknown, I-invalid file syntax (file ignored), S-skipped (cached or empty file), .-no changes, F-fixed, E-error
  16.26
  16.26 Checked all files in 0.134 seconds, 14.000 MB memory used
  16.26
  16.26 Detected deprecations in use:
  16.26 - Configuration file `.php_cs` is deprecated, rename to `.php-cs-fixer.php`.

From https://github.com/dependabot/dependabot-core/actions/runs/3040792095/jobs/4897247001#step:6:6736

The warning suggests to rename to php-cs-fixer.php. However, looking
at https://github.com/keradus/PHP-CS-Fixer/blob/master/UPGRADE-v3.md I
see that is the recommended file name for the local development config file. The
distributed one should be .php-cs-fixer.dist.php, so I used that
instead. More details on the distinction between the two types of files
here: PHP-CS-Fixer/PHP-CS-Fixer#5607

@jeffwidman jeffwidman requested a review from a team as a code owner September 12, 2022 22:27
@jeffwidman jeffwidman force-pushed the rename-php_cs-to-php-cs-fixer.php branch from 17b4859 to 38da0fb Compare September 12, 2022 22:35
@jeffwidman jeffwidman requested a review from a team September 12, 2022 22:35
@jeffwidman jeffwidman force-pushed the rename-php_cs-to-php-cs-fixer.php branch from 38da0fb to 2668005 Compare September 12, 2022 22:51
@jeffwidman jeffwidman changed the title Rename .php_cs -> .php-cs-fixer.php Rename .php_cs -> .php-cs-fixer.dist.php Sep 12, 2022
@jeffwidman jeffwidman self-assigned this Sep 12, 2022
jeffwidman added a commit to jeffwidman/dependabot-core that referenced this pull request Sep 12, 2022
Per https://phpstan.org/config-reference#config-file:
> The usual practice is to have `phpstan.neon.dist` or `phpstan.dist.neon`
> under version control, and allow the user to override certain settings
> in their environment (on their own computer or on a continuous
> integration server) by creating `phpstan.neon` that’s present in
> `.gitignore` file.

I picked `phpstan.dist.neon` for consistency with
`.php-cs-fixer.dist.php` config (dependabot#5691).

I didn't add the file to `.gitignore` because I actually want to know if
there starts being a new file under that name and see it in git...
@jeffwidman
Copy link
Member Author

Confirmed in https://github.com/dependabot/dependabot-core/actions/runs/3041101428/jobs/4897886119#step:4:6715 that it's using the new config file location:

Loaded config default from "/opt/composer/v1/.php-cs-fixer.dist.php".

Fix deprecation warning by renaming the config file:
```
  15.95 > php-cs-fixer fix --diff --verbose '--dry-run'
  16.10 You are running PHP CS Fixer v2, which is not maintained anymore. Please update to v3.
  16.10 You may find an UPGRADE guide at https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v3.3.0/UPGRADE-v3.md .
  16.10 If you need help while solving warnings, ask at https://gitter.im/PHP-CS-Fixer, we will help you!
  16.10
  16.10 PHP CS Fixer 2.19.3 Testament by Fabien Potencier and Dariusz Ruminski
  16.10 Runtime: PHP 7.4.30
  16.10 Loaded config default from "/opt/composer/v1/.php_cs".
  16.14 ......
  16.26 Legend: ?-unknown, I-invalid file syntax (file ignored), S-skipped (cached or empty file), .-no changes, F-fixed, E-error
  16.26
  16.26 Checked all files in 0.134 seconds, 14.000 MB memory used
  16.26
  16.26 Detected deprecations in use:
  16.26 - Configuration file `.php_cs` is deprecated, rename to `.php-cs-fixer.php`.
```

From https://github.com/dependabot/dependabot-core/actions/runs/3040792095/jobs/4897247001#step:6:6736

The warning suggests to rename to `php-cs-fixer.php`. However, looking
at https://github.com/keradus/PHP-CS-Fixer/blob/master/UPGRADE-v3.md I
see that is the recommended file name for the _local development_ config file. The
distributed one should be `.php-cs-fixer.dist.php`, so I used that
instead. More details on the distinction between the two types of files
here: PHP-CS-Fixer/PHP-CS-Fixer#5607
@jeffwidman jeffwidman force-pushed the rename-php_cs-to-php-cs-fixer.php branch from 2668005 to 99a79c0 Compare September 13, 2022 06:45
@jeffwidman jeffwidman merged commit 888ea83 into dependabot:main Sep 13, 2022
jeffwidman added a commit to jeffwidman/dependabot-core that referenced this pull request Sep 13, 2022
Per https://phpstan.org/config-reference#config-file:
> The usual practice is to have `phpstan.neon.dist` or `phpstan.dist.neon`
> under version control, and allow the user to override certain settings
> in their environment (on their own computer or on a continuous
> integration server) by creating `phpstan.neon` that’s present in
> `.gitignore` file.

I picked `phpstan.dist.neon` for consistency with
`.php-cs-fixer.dist.php` config (dependabot#5691).

I didn't add the file to `.gitignore` because I actually want to know if
there starts being a new file under that name and see it in git...
@pavera pavera mentioned this pull request Oct 31, 2022
@jeffwidman jeffwidman deleted the rename-php_cs-to-php-cs-fixer.php branch April 25, 2023 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants