Skip to content

Commit a2e4301

Browse files
committed
Add more docs, refactor formatters
1 parent 9cf0db5 commit a2e4301

File tree

9 files changed

+517
-17
lines changed

9 files changed

+517
-17
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ composer diff -p # include platform dependencies
8484
composer diff -f json # Output as JSON instead of table
8585
```
8686

87+
You can find more documentation in the [docs](docs) directory.
88+
8789
### Strict mode
8890

8991
To help you control your dependencies, you may pass `--strict` option when running in CI. If there are any changes detected, a non-zero exit code will be returned.
@@ -99,6 +101,11 @@ Exit code of the command is built using following bit flags:
99101

100102
You may check for individual flags or simply check if the status is greater or equal 8 if you don't want to downgrade any package.
101103

104+
# Contributing
105+
106+
Composer Diff is an open source project that welcomes pull requests and issues from anyone.
107+
Before opening pull requests, please consider reading our short [Contribution Guidelines](docs/CONTRIBUTING.md).
108+
102109
# Similar packages
103110

104111
While there are several existing packages offering similar functionality:

docs/CONTRIBUTING.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Contributing guidelines
2+
3+
Any contributions (issues, pull requests, code review, ideas, etc.) are welcome.
4+
Here are a few guidelines to be aware of:
5+
6+
- Include tests for any new features or bug fixes.
7+
- All new features should target the `main` branch.
8+
- All code must follow the project coding style standards which will be enforced by [StyleCI](https://styleci.io/).
9+
10+
Since this project has rather strict coding standards, which include:
11+
- PHPStan level 6
12+
- 100% test coverage
13+
- 100% MSI (Mutation Score Indicator)
14+
- Compatibility with PHP 5.3.2 up to 8.0 and newer
15+
16+
It might be a bit challenging to get started but fret not,
17+
as the maintainers will be happy to assist you should you have any questions or need help with your contribution.
18+
Even if the tests fail, don't worry, as the maintainers will help you fix them.
19+
20+
## Getting started
21+
22+
1. Fork the repository on GitHub.
23+
2. Clone your fork locally.
24+
3. Run `composer install` to install the dependencies.
25+
4. Create a new branch for your feature or bug fix.
26+
5. Write code and tests for your new feature or bug fix.
27+
6. Run the tests (`vendor/bin/simple-phpunit`) to be sure everything is working.
28+
7. Push your branch to your fork on GitHub.
29+
8. Create a pull request to the `main` branch.
30+
9. Wait for the maintainers to review your pull request.
31+
32+
## Testing against a real project
33+
34+
Sometimes it's easier to check your changes when you have an actual project where a bug occurs rather than reproducing it in a test.
35+
While this package works as a Composer plugin, it might seem difficult to test your changes against a real project.
36+
37+
Consider a following example:
38+
39+
- `~/work/my-project` - path to my project
40+
- `~/work/composer-diff` - path to this repository
41+
42+
Running the `composer-diff` command with your changes against your project is as simple as:
43+
44+
```shell
45+
cd ~/work/my-project # Navigate to your project directory
46+
~/work/composer-diff/composer-diff # Run the composer-diff command from this repository
47+
```
48+
49+
You can specify any other options as well like `--no-dev`, `--with-platform`, etc.

0 commit comments

Comments
 (0)