Skip to content

Commit 7ce5c61

Browse files
chore: update configuration files for consistency and clarity; adjust .editorconfig, .gitattributes, .gitignore, .styleci.yml, and README.md. (#6)
1 parent 7110f8f commit 7ce5c61

16 files changed

Lines changed: 203 additions & 124 deletions

.ecrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"\\.min\\.css$",
66
"\\.min\\.js$",
77
"^vendor/",
8-
"^runtime/"
8+
"^runtime/",
9+
"scaffold-lock\\.json$"
910
]
1011
}

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ trim_trailing_whitespace = true
1313
[*.js]
1414
indent_size = 2
1515

16+
[*.scss]
17+
indent_size = 2
18+
19+
[*.css]
20+
indent_size = 2
21+
22+
[package.json]
23+
indent_size = 2
24+
25+
[package-lock.json]
26+
indent_size = 2
27+
1628
[*.md]
1729
indent_size = 2
1830
trim_trailing_whitespace = false

.gitattributes

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,21 @@
2222
*.ttf binary
2323

2424
# Exclude files from the archive
25-
/.github/dependabot.yml export-ignore
26-
/.github/workflows export-ignore
25+
/.editorconfig export-ignore
26+
/.gitattributes export-ignore
27+
/.github export-ignore
28+
/.gitignore export-ignore
29+
/.styleci.yml export-ignore
2730
/codeception.yml export-ignore
31+
/composer-require-checker.json export-ignore
2832
/docs export-ignore
33+
/ecs.php export-ignore
2934
/infection.json* export-ignore
3035
/phpstan*.neon* export-ignore
3136
/phpunit.xml.dist export-ignore
37+
/rector.php export-ignore
3238
/runtime export-ignore
39+
/scaffold-lock.json export-ignore
3340
/tests export-ignore
3441

3542
# Avoid merge conflicts in CHANGELOG
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"Exclude": [
3+
"phpstan-baseline\\.neon$",
4+
"^tests/runtime/",
5+
"\\.min\\.css$",
6+
"\\.min\\.js$",
7+
"^vendor/",
8+
"^runtime/",
9+
"scaffold-lock\\.json$"
10+
]
11+
}

.github/linters/.gitleaks.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
title = "gitleaks config"
22

3-
[[allowlists]]
3+
[allowlist]
44
description = "Allow test fixture data with dummy credentials"
55
paths = [
66
'''tests/support/data/.*\.php''',

.gitignore

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# AI agents (if present)
2+
.codex
3+
.claude
4+
15
# codecoverage (if present)
26
code_coverage
37

@@ -24,13 +28,14 @@ nbproject
2428
# node_modules (if present)
2529
node_modules
2630
package-lock.json
27-
28-
# phpstorm project (if present)
29-
.idea
31+
!src/assets/package-lock.json
3032

3133
# phpactor (if present)
3234
.phpactor.*
3335

36+
# phpstorm project (if present)
37+
.idea
38+
3439
# phpunit (if present)
3540
.phpunit.cache
3641
.phpunit.result.cache
@@ -52,3 +57,4 @@ Thumbs.db
5257
.buildpath
5358
.project
5459
.settings
60+
phpunit.xml

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ tests/runtime/**
1616

1717
# Tool configs maintained by hand to keep their array order meaningful.
1818
composer-require-checker.json
19+
20+
# Auto-generated by yii2-extensions/scaffold; never hand-edited.
21+
scaffold-lock.json

.styleci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
preset: psr12
22
risky: true
33

4-
version: 8.1
4+
version: 8.3
55

66
finder:
77
exclude:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## 0.3.0 Under development
9+
10+
- feat!: ship `ecs.php` and `rector.php` wrappers from `src/config/` via `scaffold.json`; metadata moves to `php-forge/baseline`.
11+
812
## 0.2.0 May 04, 2026
913

1014
- docs: add social media badge for following on X in `README.md`.

README.md

Lines changed: 31 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,29 @@
1313
<em>Share one set of rules across multiple repositories via Composer.</em>
1414
</p>
1515

16-
## Features
16+
## System requirements
1717

18-
<picture>
19-
<source media="(min-width: 768px)" srcset="./docs/svgs/features.svg">
20-
<img src="./docs/svgs/features-mobile.svg" alt="Feature Overview" style="width: 100%;">
21-
</picture>
18+
- [`PHP`](https://www.php.net/downloads) 8.3 or higher.
19+
- [`Composer`](https://getcomposer.org/download/) for dependency management.
2220

2321
## Installation
2422

2523
```bash
26-
composer require php-forge/coding-standard:^0.2 --dev
24+
composer require php-forge/coding-standard:^0.3 --dev
2725
```
2826

27+
Or add the dependency manually to `composer.json`:
28+
29+
```json
30+
{
31+
"require-dev": {
32+
"php-forge/coding-standard": "^0.3"
33+
}
34+
}
35+
```
36+
37+
Then run `composer update`.
38+
2939
## Configuration files
3040

3141
This package ships shared ECS and Rector configurations under
@@ -127,15 +137,11 @@ return static function (RectorConfig $rectorConfig): void {
127137
};
128138
```
129139

130-
## Scaffolded distribution (optional)
140+
## Scaffolded distribution
131141

132-
This package is also a [`yii2-extensions/scaffold`](https://github.com/yii2-extensions/scaffold) provider.
133-
134-
When the scaffold plugin is installed and authorized, `composer install` distributes the canonical metadata and
135-
super-linter configs into your repository root automatically; so the ECS / Rector wrappers above and the shared linter
136-
rules stay in lock-step across every repository that opts in.
137-
138-
Opt in by adding the plugin and authorizing this package as a provider:
142+
This package is a [`yii2-extensions/scaffold`](https://github.com/yii2-extensions/scaffold) provider for the
143+
**root `ecs.php` and `rector.php` wrapper templates** (sourced from `src/config/` via `scaffold.json`). Consumers can
144+
opt in by allowing the plugin and listing this package as an authorised provider:
139145

140146
```bash
141147
composer require yii2-extensions/scaffold:^0.1 --dev
@@ -150,6 +156,7 @@ composer require yii2-extensions/scaffold:^0.1 --dev
150156
},
151157
"extra": {
152158
"scaffold": {
159+
"auto": false,
153160
"allowed-packages": [
154161
"php-forge/coding-standard"
155162
]
@@ -158,45 +165,20 @@ composer require yii2-extensions/scaffold:^0.1 --dev
158165
}
159166
```
160167

161-
On the next `composer install` / `composer update`, these files land in your repository root:
162-
163-
| File | Mode | Purpose |
164-
| ------------------------------------ | ---------- | -------------------------------------------------------- |
165-
| `.editorconfig` | `replace` | Editor settings (UTF-8, LF, indent) |
166-
| `.gitattributes` | `replace` | Text/binary handling, archive excludes |
167-
| `.gitignore` | `append` | Common ignore patterns; project-specific lines preserved |
168-
| `.styleci.yml` | `replace` | StyleCI config (PSR-12 + risky) |
169-
| `.ecrc` | `replace` | editor-config-checker exclusions |
170-
| `.prettierignore` | `replace` | Paths Prettier should skip |
171-
| `.prettierrc.json` | `replace` | Prettier formatting rules |
172-
| `.stylelintignore` | `replace` | Paths stylelint should skip |
173-
| `composer-require-checker.json` | `preserve` | Composer require-checker whitelist (project-specific) |
174-
| `.github/linters/actionlint.yml` | `replace` | actionlint config for Super-Linter |
175-
| `.github/linters/.codespellrc` | `replace` | codespell config |
176-
| `.github/linters/.gitleaks.toml` | `replace` | gitleaks config |
177-
| `.github/linters/.markdown-lint.yml` | `replace` | markdownlint config |
178-
| `ecs.php` | `preserve` | ECS wrapper for the project root |
179-
| `rector.php` | `preserve` | Rector wrapper for the project root |
180-
181-
Mode semantics:
182-
183-
- `replace`: lock-step with this package. Local edits trigger a warning and the file is skipped on update.
184-
Use `vendor/bin/scaffold reapply <file> --force` to re-sync.
185-
- `append`: provider content is appended to the existing file. Project lines are never blown away.
186-
- `preserve`: file is written once on first install and never overwritten.
187-
188-
The scaffolded `ecs.php` / `rector.php` ship with `83` as the default PHP target; switch to `81`, `82`, or `84` to match
189-
your minimum PHP version. Mode `preserve` protects your edits across `composer update`.
190-
191-
### Scaffold commands
168+
With `auto: false`, the plugin does not run on `composer install`; sync the wrappers manually:
192169

193170
```bash
194-
vendor/bin/scaffold status # show which files are synced/modified/missing
195-
vendor/bin/scaffold diff <file> # diff between local and provider version
196-
vendor/bin/scaffold reapply [<file>] [--force] # re-apply provider content
197-
vendor/bin/scaffold eject <file> # stop tracking a file (kept on disk)
171+
vendor/bin/scaffold reapply --provider=php-forge/coding-standard
198172
```
199173

174+
Both wrappers ship in mode `preserve`; written once on first install, never overwritten so consumer edits to paths
175+
or PHP target version survive subsequent runs.
176+
177+
## Related packages
178+
179+
For dev environment scaffolding, see [`php-forge/baseline`](https://github.com/php-forge/baseline). The two packages
180+
are independent; adopt either, both, or neither.
181+
200182
## Composer scripts
201183

202184
Follow the same convention used across PHP Forge repositories:
@@ -210,10 +192,6 @@ Follow the same convention used across PHP Forge repositories:
210192
}
211193
```
212194

213-
## Documentation
214-
215-
- 📚 [Installation Guide](docs/installation.md)
216-
217195
## Package information
218196

219197
[![PHP](https://img.shields.io/badge/%3E%3D8.3-777BB4.svg?style=for-the-badge&logo=php&logoColor=white)](https://www.php.net/releases/8.3/en.php)

0 commit comments

Comments
 (0)