generated from yii-tools/template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
fix(docs): Update command syntax in development.md and testing.md for clarity and consistency.
#121
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,42 @@ | ||
| # Development | ||
|
|
||
| This document describes development workflows and maintenance tasks for this repository. | ||
| This document describes development workflows and maintenance tasks for the project. | ||
|
|
||
| ## Local setup | ||
| ## Sync Metadata | ||
|
|
||
| Install dependencies: | ||
| To keep configuration files synchronized with the latest template updates, use the `sync-metadata` command. This command | ||
| downloads the latest configuration files from the template repository. | ||
|
|
||
| ```bash | ||
| composer install | ||
| composer sync-metadata | ||
| ``` | ||
|
|
||
| ## Project scripts | ||
| ### Updated Files | ||
|
|
||
| The project exposes a small set of Composer scripts for validation. | ||
| This command updates the following configuration files: | ||
|
|
||
| | Script | Command | Purpose | | ||
| | ---------------------- | ----------------------------------- | ------------------------------------ | | ||
| | `test` | `composer run test` | Run the PHPUnit test suite | | ||
| | `psalm` | `composer run psalm` | Run static analysis | | ||
| | `easy-coding-standard` | `composer run easy-coding-standard` | Run ECS coding standards | | ||
| | `check-dependencies` | `composer run check-dependencies` | Verify declared runtime dependencies | | ||
| | File | Purpose | | ||
| | ------------------ | -------------------------------------------- | | ||
| | `.editorconfig` | Editor settings and code style configuration | | ||
| | `.gitattributes` | Git attributes and file handling rules | | ||
| | `.gitignore` | Git ignore patterns and exclusions | | ||
| | `.styleci.yml` | StyleCI code style analysis configuration | | ||
| | `infection.json5` | Infection mutation testing configuration | | ||
| | `phpstan.neon` | PHPStan static analysis configuration | | ||
| | `phpunit.xml.dist` | PHPUnit test configuration | | ||
|
|
||
| ## Notes | ||
| ### When to Run | ||
|
|
||
| - Keep changes minimal and consistent with existing code and behavior. | ||
| - Documentation and code comments are English-only. | ||
| Run this command in the following scenarios: | ||
|
|
||
| - **Periodic Updates** - Monthly or quarterly to benefit from template improvements. | ||
| - **After Template Updates** - When the template repository has new configuration improvements. | ||
| - **Before Major Releases** - Ensure your project uses the latest best practices. | ||
| - **When Issues Occur** - If configuration files become outdated or incompatible. | ||
|
|
||
| ### Important Notes | ||
|
|
||
| - This command overwrites existing configuration files with the latest versions from the template. | ||
| - Ensure you have committed any custom configuration changes before running this command. | ||
| - Review the updated files after syncing to ensure they work with your specific project needs. | ||
| - Some projects may require customizations after syncing configuration files. | ||
terabytesoftw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,58 +1,82 @@ | ||
| # Testing | ||
|
|
||
| This package provides a consistent set of Composer scripts for local validation. | ||
| This package provides a consistent set of [Composer](https://getcomposer.org/) scripts for local validation. | ||
|
|
||
| Tool references: | ||
|
|
||
| - [Composer Require Checker](https://github.com/maglnet/ComposerRequireChecker) for dependency definition checks. | ||
| - [Easy Coding Standard (ECS)](https://github.com/easy-coding-standard/easy-coding-standard) for coding standards. | ||
| - [Psalm](https://psalm.dev/) for static analysis. | ||
| - [Infection](https://infection.github.io/) for mutation testing. | ||
| - [PHPStan](https://phpstan.org/) for static analysis. | ||
| - [PHPUnit](https://phpunit.de/) for unit tests. | ||
| - [Rector](https://github.com/rectorphp/rector) for automated refactoring. | ||
|
|
||
| ## Automated refactoring (Rector) | ||
|
|
||
| Run Rector to apply automated code refactoring. | ||
|
|
||
| ```bash | ||
| composer rector | ||
| ``` | ||
|
|
||
| ## Coding standards (ECS) | ||
|
|
||
| Run Easy Coding Standard (ECS) and apply fixes. | ||
|
|
||
| ```bash | ||
| composer run easy-coding-standard | ||
| composer ecs | ||
| ``` | ||
|
|
||
| ## Dependency definition check | ||
|
|
||
| Verify that runtime dependencies are correctly declared in `composer.json`. | ||
|
|
||
| ```bash | ||
| composer run check-dependencies | ||
| composer check-dependencies | ||
| ``` | ||
|
|
||
| ## Mutation testing (Infection) | ||
|
|
||
| Run mutation testing. | ||
|
|
||
| ```bash | ||
| composer mutation | ||
| ``` | ||
|
|
||
| Run mutation testing with static analysis enabled. | ||
|
|
||
| ```bash | ||
| composer mutation-static | ||
| ``` | ||
|
|
||
| ## Static analysis (Psalm) | ||
| ## Static analysis (PHPStan) | ||
|
|
||
| Run static analysis. | ||
|
|
||
| ```bash | ||
| composer run psalm | ||
| composer static | ||
| ``` | ||
|
|
||
| ## Unit tests (PHPUnit) | ||
|
|
||
| Run the full test suite. | ||
|
|
||
| ```bash | ||
| composer run test | ||
| composer tests | ||
| ``` | ||
|
|
||
| ## Passing extra arguments | ||
|
|
||
| Composer scripts support forwarding additional arguments using `--`. | ||
|
|
||
| Example: run a specific PHPUnit test or filter by name. | ||
| Run PHPUnit with code coverage report generation. | ||
|
|
||
| ```bash | ||
| composer run test -- --filter AssetManagerTest | ||
| composer tests -- --coverage-html code_coverage | ||
| ``` | ||
|
|
||
| Example: run Psalm with a different memory limit. | ||
| Run PHPStan with a different memory limit. | ||
|
|
||
| ```bash | ||
| composer run psalm -- --memory-limit=512M | ||
| composer static -- --memory-limit=512M | ||
| ``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.