Skip to content

Commit b8ca66c

Browse files
spawniacleptric
andauthored
Clean up setup and docs (#686)
Co-authored-by: Michi Hoffmann <[email protected]>
1 parent 04bad6b commit b8ca66c

File tree

5 files changed

+49
-38
lines changed

5 files changed

+49
-38
lines changed

CONTRIBUTING.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,40 @@ Thank you for contributing!
2626

2727
## Development environment
2828

29+
### Requirements
30+
31+
Make sure that you have PHP 7.2+ installed. Version 7.4 or higher is required to run style checkers. On macOS, we recommend using brew to install PHP. For Windows, we recommend an official PHP.net release.
32+
33+
You may use [make](https://www.gnu.org/software/make) to take advantage of the provided [Makefile](Makefile).
34+
2935
### Clone the repository
3036

3137
```bash
3238
git clone [email protected]:getsentry/sentry-laravel.git
3339
```
3440

35-
Make sure that you have PHP 7.2+ installed. Version 7.4 or higher is required to run style checkers. On macOS, we recommend using brew to install PHP. For Windows, we recommend an official PHP.net release.
36-
3741
### Install the dependencies
3842

39-
Dependencies are managed through [Composer](https://getcomposer.org/):
43+
Dependencies are managed through [Composer](https://getcomposer.org).
4044

4145
```bash
4246
composer install
4347
```
4448

4549
### Running tests
4650

47-
Tests can then be run via [PHPUnit](https://phpunit.de/):
51+
Tests can be run via [PHPUnit](https://phpunit.de).
52+
53+
```bash
54+
composer tests
55+
```
56+
57+
### Code style
58+
59+
The code is automatically formatted through [php-cs-fixer](https://cs.symfony.com).
4860

4961
```bash
50-
vendor/bin/phpunit
62+
composer phpcs
5163
```
5264

5365
## Releasing a new version
@@ -57,7 +69,7 @@ vendor/bin/phpunit
5769
Prerequisites:
5870

5971
- All changes that should be released must be in the `master` branch.
60-
- Every commit should follow the [Commit Message Format](https://develop.sentry.dev/commit-messages/#commit-message-format) convention.
72+
- Every commit should follow the [Commit Message Format](https://develop.sentry.dev/commit-messages#commit-message-format) convention.
6173

6274
Manual Process:
6375

@@ -81,7 +93,7 @@ There is a sequence diagram visualizing all this in the [README.md](https://gith
8193

8294
### Versioning Policy
8395

84-
This project follows [semver](https://semver.org/), with three additions:
96+
This project follows [semver](https://semver.org), with three additions:
8597

8698
- Semver says that major version `0` can include breaking changes at any time. Still, it is common practice to assume that only `0.x` releases (minor versions) can contain breaking changes while `0.x.y` releases (patch versions) are used for backwards-compatible changes (bugfixes and features). This project also follows that practice.
8799

Makefile

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
.PHONY: test
1+
.PHONY: develop
2+
develop: vendor update-submodules setup-git
23

3-
develop: update-submodules
4-
composer install --dev
5-
make setup-git
4+
vendor: composer.lock
5+
composer install
66

7+
composer.lock: composer.json
8+
composer update
9+
10+
.PHONY: update-submodules
711
update-submodules:
812
git submodule init
913
git submodule update
1014

11-
cs:
12-
vendor/bin/php-cs-fixer fix --config=.php_cs --verbose --diff
13-
14-
cs-dry-run:
15-
vendor/bin/php-cs-fixer fix --config=.php_cs --verbose --diff --dry-run
16-
17-
test:
18-
vendor/bin/phpunit
19-
15+
.PHONY: setup-git
2016
setup-git:
2117
git config branch.autosetuprebase always
18+
19+
.PHONY: phpcs
20+
phpcs:
21+
composer phpcs
22+
23+
.PHONY: tests
24+
tests:
25+
composer tests

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
2+
<a href="https://sentry.io?utm_source=github&utm_medium=logo" target="_blank">
33
<img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
44
</a>
55
</p>
@@ -15,11 +15,11 @@ _Bad software is everywhere, and we're tired of it. Sentry is on a mission to he
1515
[![Monthly Downloads](https://poser.pugx.org/sentry/sentry-laravel/d/monthly)](https://packagist.org/packages/sentry/sentry-laravel)
1616
[![Discord](https://img.shields.io/discord/621778831602221064)](https://discord.gg/cWnMQeA)
1717

18-
This is the official Laravel SDK for [Sentry](https://sentry.io/)
18+
This is the official Laravel SDK for [Sentry](https://sentry.io).
1919

2020
## Getting Started
2121

22-
The installation step below work on the latest versions of the Laravel framework (8.x, 9.x and 10.x).
22+
The installation steps below work on versions 8.x, 9.x and 10.x of the Laravel framework.
2323

2424
For other Laravel or Lumen versions see:
2525

@@ -37,9 +37,9 @@ Install the `sentry/sentry-laravel` package:
3737
composer require sentry/sentry-laravel
3838
```
3939

40-
Enable capturing unhandled exception to report to Sentry by making the following change to your `App/Exceptions/Handler.php`:
40+
Enable capturing unhandled exception to report to Sentry by making the following change to your `app/Exceptions/Handler.php`:
4141

42-
```php {filename:App/Exceptions/Handler.php}
42+
```php {filename:app/Exceptions/Handler.php}
4343
use Sentry\Laravel\Integration;
4444

4545
public function register(): void
@@ -72,7 +72,7 @@ SENTRY_LARAVEL_DSN=___PUBLIC_DSN___
7272
use function Sentry\captureException;
7373

7474
try {
75-
$this->functionFailsForSure();
75+
$this->functionThatMayFail();
7676
} catch (\Throwable $exception) {
7777
captureException($exception);
7878
}
@@ -103,7 +103,7 @@ The Laravel and Lumen version listed below were supported in previous versions:
103103

104104
Please refer to [CONTRIBUTING.md](CONTRIBUTING.md).
105105

106-
## Getting help/support
106+
## Getting Help/Support
107107

108108
If you need help setting up or configuring the Laravel SDK (or anything else in the Sentry universe) please head over to the [Sentry Community on Discord](https://discord.com/invite/Ww9hbqr). There is a ton of great people in our Discord community ready to help you!
109109

@@ -116,4 +116,4 @@ If you need help setting up or configuring the Laravel SDK (or anything else in
116116

117117
## License
118118

119-
Licensed under the MIT license, see [`LICENSE`](LICENSE)
119+
Licensed under the MIT license, see [`LICENSE`](LICENSE).

composer.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,11 @@
4949
}
5050
},
5151
"scripts": {
52-
"tests": [
53-
"vendor/bin/phpunit --verbose"
54-
],
55-
"tests-travis": [
56-
"XDEBUG_MODE=coverage vendor/bin/phpunit --verbose --configuration phpunit.xml --coverage-clover test/clover.xml"
57-
],
58-
"tests-report": [
59-
"XDEBUG_MODE=coverage vendor/bin/phpunit --verbose --configuration phpunit.xml --coverage-html test/html-report"
60-
],
6152
"phpcs": [
6253
"vendor/bin/php-cs-fixer fix --verbose --diff --dry-run"
54+
],
55+
"tests": [
56+
"vendor/bin/phpunit --verbose"
6357
]
6458
},
6559
"extra": {

config/sentry.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
return [
44

5+
// @see https://docs.sentry.io/product/sentry-basics/dsn-explainer/
56
'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')),
67

78
// The release version of your application
@@ -77,7 +78,7 @@
7778

7879
// @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#traces-sample-rate
7980
'traces_sample_rate' => env('SENTRY_TRACES_SAMPLE_RATE') === null ? null : (float)env('SENTRY_TRACES_SAMPLE_RATE'),
80-
81+
8182
'profiles_sample_rate' => env('SENTRY_PROFILES_SAMPLE_RATE') === null ? null : (float)env('SENTRY_PROFILES_SAMPLE_RATE'),
8283

8384
];

0 commit comments

Comments
 (0)