Skip to content

Commit

Permalink
[#186] Added normalizer for composer.json.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed May 16, 2024
1 parent 844514c commit 30d2ab8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ jobs:
- name: Install dependencies
run: composer install

- name: Validate composer.json
run: |
composer --verbose validate
composer normalize --dry-run
- name: Check coding standards
run: composer lint
continue-on-error: ${{ vars.CI_LINT_IGNORE_FAILURE == '1' }}
Expand Down
32 changes: 17 additions & 15 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "yournamespace/yourproject",
"type": "library",
"description": "Provides yourproject functionality.",
"license": "GPL-2.0-or-later",
"type": "library",
"authors": [
{
"name": "Your Name",
Expand All @@ -24,6 +24,7 @@
"bamarni/composer-bin-plugin": "^1.8",
"dealerdirect/phpcodesniffer-composer-installer": "^1",
"drupal/coder": "^8.3",
"ergebnis/composer-normalize": "^2.42",
"mikey179/vfsstream": "^1.6",
"opis/closure": "^3.6",
"phpmd/phpmd": "^2.13",
Expand All @@ -44,14 +45,24 @@
"tests/phpunit"
]
},
"bin": [
"php-command",
"php-script"
],
"config": {
"sort-packages": true,
"allow-plugins": {
"bamarni/composer-bin-plugin": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
"dealerdirect/phpcodesniffer-composer-installer": true,
"ergebnis/composer-normalize": true
},
"sort-packages": true
},
"scripts": {
"build": [
"@composer bin box require --dev humbug/box",
"box validate",
"box compile"
],
"lint": [
"cp php-script php-script.php && phpcs && rm php-script.php",
"phpmd --exclude vendor,vendor-bin,node_modules . text phpmd.xml",
Expand All @@ -63,15 +74,6 @@
"cp php-script php-script.php && phpcbf && rm php-script.php"
],
"test": "phpunit --no-coverage",
"test-coverage": "phpunit",
"build": [
"@composer bin box require --dev humbug/box",
"box validate",
"box compile"
]
},
"bin": [
"php-command",
"php-script"
]
"test-coverage": "phpunit"
}
}

1 comment on commit 30d2ab8

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.