Skip to content
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
19 changes: 18 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,25 @@
"magento-hackathon/magento-composer-installer": "^3.1 || ^2.1 || ^4.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": ">=3.4",
"macopedia/phpstan-magento1": "^1.0.4",
"phpstan/phpstan": "^1.8"
"magento-ecg/coding-standard": "^4.4",
"phpcompatibility/php-compatibility": "^9.3",
"phpmd/phpmd": "^2.12",
"phpstan/phpstan": "^1.8",
"squizlabs/php_codesniffer": "^3.7"
},
"scripts": {
"set-phpcs-paths": [
"[ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility,vendor/magento-ecg/coding-standard",
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a way not to hardcode vendor?

Copy link
Contributor Author

@sreichel sreichel Aug 17, 2022

Choose a reason for hiding this comment

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

Tried with COMPOSER_VENDOR_DIR ....

... if you set COMPOSER_VENDOR_DIR as ENV variable it works ...

ddev config.yaml:

web_environment: [
  COMPOSER_VENDOR_DIR=test
]

composer.json

    "set-phpcs-paths": [
      "[ $COMPOSER_DEV_MODE -eq 0 ] || $COMPOSER_VENDOR_DIR/bin/phpcs --config-set installed_paths $COMPOSER_VENDOR_DIR/phpcompatibility/php-compatibility,$COMPOSER_VENDOR_DIR/magento-ecg/coding-standard",
      "[ $COMPOSER_DEV_MODE -eq 0 ] || $COMPOSER_VENDOR_DIR/bin/phpcs -i"
    ],

Having custom vendor dir is an edge case ... i'd not change it.

Edit:

  • set vendor-dir in composer.json is not required in this case
  • set vendor-dir in composer.json DOES NOT set COMPOSER_VENDOR_DIR

"[ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs -i"
],
"post-install-cmd": [
"@set-phpcs-paths"
],
"post-update-cmd": [
"@set-phpcs-paths"
]
},
"conflict": {
"n98/n98_layouthelper": "*"
Expand Down
Loading