Skip to content

Commit

Permalink
chore: move php-cs-fixer to vendor-bin
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
  • Loading branch information
st3iny committed Aug 5, 2024
1 parent fb95633 commit 8daf1c1
Show file tree
Hide file tree
Showing 7 changed files with 992 additions and 2,580 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/nbproject/private/
tests/.phpunit.result.cache
/vendor
/vendor-bin/*/vendor
composer.phar

/.php_cs.cache
Expand Down
3 changes: 2 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
require_once './vendor/autoload.php';
require_once './vendor-bin/php-cs-fixer/vendor/autoload.php';

use Nextcloud\CodingStandard\Config;

Expand All @@ -17,5 +17,6 @@
->notPath('l10n')
->notPath('src')
->notPath('vendor')
->notPath('vendor-bin')
->in(__DIR__);
return $config;
4 changes: 4 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Files: composer.json composer.lock
Copyright: 2018 Nextcloud GmbH and Nextcloud contributors
License: AGPL-3.0-or-later

Files: vendor-bin/php-cs-fixer/composer.json vendor-bin/php-cs-fixer/composer.lock
Copyright: 2024 Nextcloud GmbH and Nextcloud contributors
License: AGPL-3.0-or-later

Files: package.json package-lock.json tests/phpunit.xml
Copyright: 2019 Nextcloud GmbH and Nextcloud contributors
License: AGPL-3.0-or-later
Expand Down
17 changes: 11 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,18 @@
}
],
"scripts": {
"cs:check": "php-cs-fixer fix --dry-run --diff",
"cs:fix": "php-cs-fixer fix",
"cs:check": "vendor-bin/php-cs-fixer/vendor/php-cs-fixer/shim/php-cs-fixer fix --dry-run --diff",
"cs:fix": "vendor-bin/php-cs-fixer/vendor/php-cs-fixer/shim/php-cs-fixer fix",
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l",
"test": "phpunit -c tests/phpunit.xml",
"test:unit": "phpunit -c tests/phpunit.xml tests/Unit",
"test:unit:dev": "phpunit -c tests/phpunit.xml tests/Unit --no-coverage"
"test:unit:dev": "phpunit -c tests/phpunit.xml tests/Unit --no-coverage",
"post-install-cmd": ["@composer bin all install --ansi"],

This comment has been minimized.

Copy link
@Altahrim

Altahrim Aug 6, 2024

This change break the build for NC 30 beta 4.
When using composer install --no-dev --optimize-autoloader -v we get:

> post-install-cmd: @composer bin all install --ansi

In Application.php line 720:

  [Symfony\Component\Console\Exception\CommandNotFoundException]
  Command "bin" is not defined.

This comment has been minimized.

Copy link
@ChristophWurst

ChristophWurst Aug 6, 2024

Member

@st3iny guess the bin plugin has to be a prod dependency

This comment has been minimized.

This comment has been minimized.

Copy link
@st3iny

st3iny Aug 6, 2024

Author Member

TIL! I always think that composer works like npm 🙈

Here is the fix: #901

"post-update-cmd": ["@composer bin all update --ansi"]
},
"require-dev": {
"christophwurst/nextcloud_testing": "^0.12.4",
"nextcloud/coding-standard": "^0.5.0 || ^1.0.0"
"bamarni/composer-bin-plugin": "^1.8.2",
"christophwurst/nextcloud_testing": "^0.12.4"
},
"config": {
"sort-packages": true,
Expand All @@ -39,7 +41,10 @@
"autoloader-suffix": "SuspiciousLogin",
"platform": {
"php": "8.0"
}
},
"allow-plugins": {
"bamarni/composer-bin-plugin": true
}
},
"autoload" : {
"psr-4": {
Expand Down
Loading

0 comments on commit 8daf1c1

Please sign in to comment.