Skip to content

Commit 595eab2

Browse files
committed
docs: add changelog for new v2 release and adjust README
1 parent 3dff412 commit 595eab2

File tree

2 files changed

+49
-11
lines changed

2 files changed

+49
-11
lines changed

CHANGELOG.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,47 @@
11
# Changelog
22

3+
## v2.0.0 - December 2024
34

4-
## [Unreleased] - 2024-05-21
5+
This version is a major release and includes breaking changes.
6+
Adjust your configuration, apply the fixes and review code for the new version.
7+
8+
### PER Coding Style 2.0
9+
PER Coding Style 2.0 (https://www.php-fig.org/per/coding-style/) was introduced.
10+
This leads to some adjustments in the code which most probably can be autofixed with `ecs check --fix`.
11+
Review your code after running the fixer.
12+
13+
Rules applied to the set can be found here: https://cs.symfony.com/doc/ruleSets/PER-CS2.0.html. This is the base from which we make our own small adjustments.
14+
"Concat Space" for example, is a rule which has already been applied to the Symfony rule set in the past, which we enforce in the standard everywhere.
15+
16+
### Unify rule sets
17+
Removed `whatwedo-wordpress.php` and `whatwedo-symfony.php` in favor of `whatwedo-common.php`. If you have used `whatwedo-symfony.php` or `whatwedo-wordpress.php`, you have to switch to `whatwedo-common.php` in the config.
18+
19+
### Update ECS Configuration
20+
Update your configuration (`ecs.php`) to the new version and adjust to your preferences. See our example file in the root of this repository.
21+
22+
## Technical
23+
24+
### Changed
25+
- Unify rule sets (https://github.com/whatwedo/PhpCodingStandard/issues/17)
26+
- Minor update to `symplify/easy-coding-standard 12.4`
27+
28+
### Added
29+
- DynamicSet `@PER-CS2.0` was added to the configuration (https://github.com/whatwedo/PhpCodingStandard/issues/19)
30+
- Add `MultilinePromotedPropertiesFixer` (https://github.com/whatwedo/PhpCodingStandard/issues/27)
31+
- Add `MultilinePromotedPropertiesFixer` (https://github.com/whatwedo/PhpCodingStandard/issues/27)
32+
- Add `PhpdocToReturnTypeFixer` and `PhpdocToParamTypeFixer`
33+
- `NoDoctrineMigrationsGeneratedCommentFixer` is now part of the default configuration (https://github.com/whatwedo/PhpCodingStandard/issues/16)
34+
- `ConcatSpaceFixer` => `'spacing' => 'none'` is now part of the default configuration (https://github.com/whatwedo/PhpCodingStandard/issues/15)
35+
36+
### Removed
37+
- Remove deprecated `NoTrailingCommaInListCallFixer`
38+
- `AssignmentInConditionSniff` is skipped
39+
40+
---
41+
42+
## v1.2.5 - March 2024
543

644
### Changed
745

8-
- update to `symplify/easy-coding-standard ^12`
46+
- Update to `symplify/easy-coding-standard ^12`
47+
- Dump Fixer added

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# PhpCodingStandard
44

55
This project is a set of coding standard rules, which we are using at [whatwedo](https://whatwedo.ch). It's heavily based on [Simplify/EasyCodingStandard](https://github.com/Symplify/EasyCodingStandard).
6+
It's based on PER Coding Style 2.0 (https://www.php-fig.org/per/coding-style/).
67

78
## Installation
89

@@ -20,26 +21,24 @@ composer require whatwedo/php-coding-standard
2021
You can run the checks without project specific configuration using one of following commands:
2122

2223
```
23-
vendor/bin/ecs check SRC_DIRECTORY --config vendor/whatwedo/php-coding-standard/config/whatwedo-symfony.php # Symfony projects
24-
vendor/bin/ecs check SRC_DIRECTORY --config vendor/whatwedo/php-coding-standard/config/whatwedo-wordpress.php # WordPress projects
25-
vendor/bin/ecs check SRC_DIRECTORY --config vendor/whatwedo/php-coding-standard/config/whatwedo-common.php # Common PHP projects
24+
vendor/bin/ecs check SRC_DIRECTORY --config vendor/whatwedo/php-coding-standard/config/whatwedo-common.php
2625
```
2726

28-
2927
### With custom configuration
3028

31-
If you want to add additional checkers or exclude files, you have to create an `ecs.php` file in your own project root directory.
29+
But we suggest to create an `ecs.php` file in your own project root directory.
30+
There's a sample configuration file in the root of this repository.
3231

3332
```php
3433
<?php
3534
declare(strict_types=1);
3635

3736
use Symplify\EasyCodingStandard\Config\ECSConfig;
3837

39-
return static function (ECSConfig $ecsConfig): void {
38+
return static function (ECSConfig $config): void {
4039
/*
41-
// Remove rules with $ecsConfig->skip()
42-
$ecsConfig->skip([
40+
// Remove rules with $config->skip()
41+
$config->skip([
4342
SlevomatCodingStandard\Sniffs\Variables\UnusedVariableSniff::class => null,
4443

4544
// Explicitly remove some rules in a specific files
@@ -50,7 +49,7 @@ return static function (ECSConfig $ecsConfig): void {
5049
*/
5150

5251
// This need to come last
53-
$ecsConfig->sets([__DIR__ . '/vendor/whatwedo/php-coding-standard/config/whatwedo-common.php']);
52+
$config->sets([__DIR__ . '/vendor/whatwedo/php-coding-standard/config/whatwedo-common.php']);
5453
};
5554
```
5655

0 commit comments

Comments
 (0)