Skip to content
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

Enhancement: Require and use ergebnis/composer-normalize #115

Merged
merged 4 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ For details, take a look at the following workflow configuration files:

## Coding Standards

We use [`ergebnis/composer-normalize`](https://github.com/ergebnis/composer-normalize) to normalize `composer.json`.

We are using [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer) to enforce coding standards in PHP files.

Run
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ jobs:
with:
dependencies: "${{ matrix.dependencies }}"

- name: "Run ergebnis/composer-normalize"
run: "composer normalize --ansi --dry-run"

- name: "Create cache directory for friendsofphp/php-cs-fixer"
run: "mkdir -p .build/php-cs-fixer"

Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
it: coding-standards static-code-analysis ## Runs the coding-standards and static-code-analysis targets

.PHONY: coding-standards
coding-standards: vendor ## Fixes code style issues with friendsofphp/php-cs-fixer
coding-standards: vendor ## Normalizes composer.json with ergebnis/composer-normalize and fixes code style issues with friendsofphp/php-cs-fixer
composer normalize
mkdir -p .build/php-cs-fixer/
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --diff --show-progress=dots --verbose

Expand Down
22 changes: 13 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"name": "teapot/status-code",
"type": "library",
"description": "PHP HTTP Response Status code library",
"license": "MIT",
"type": "library",
"keywords": [
"http"
],
"homepage": "https://github.com/teapot-php/status-code",
"license": "MIT",
"authors": [
{
"name": "Barney Hanlon",
Expand All @@ -17,19 +16,15 @@
"email": "am@localheinz.com"
}
],
"homepage": "https://github.com/teapot-php/status-code",
"require": {
"php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.42.0",
"ergebnis/php-cs-fixer-config": "^6.21.0",
"vimeo/psalm": "^5.21.1"
},
"config": {
"platform": {
"php": "7.4.33"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"Teapot\\StatusCode\\": "src"
Expand All @@ -39,5 +34,14 @@
"exclude": [
"/*, !/src"
]
},
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true
},
"platform": {
"php": "7.4.33"
},
"sort-packages": true
}
}
Loading