What are the Slack Archives?
Itโs a history of our time together in the Slack Community! Thereโs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonโt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
I updated `spryker/git-hook` recently and my pre commit hook is failing now with: ```ERROR: the "APP
I updated spryker/git-hook
recently and my pre commit hook is failing now with:
ERROR: the "APPLICATION_ROOT_DIR/phpcs.xml" coding standard is not installed. The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, config, mpdf, SlevomatCodingStandard, decimal-object, development, GlueStreamSpecific, Spryker and SprykerStrict
Seems it's related to this commit: https://github.com/spryker/git-hook/commit/ce5f46583fb9d98db7983c08b89187915c0d06b9
I haven't had a phpcs.xml on project level so far and I'd like to keep using it from the core. What would I have to do to accomplish that?
Comments
-
Before, it was using
config/ruleset.xml
as a default, which I do have on project level. Any idea how to make it keep using this?0 -
giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐ง๐ปโ๐ - Cadet
I did not update githook module but u need the phpcs.xml at root level on project..
config/ruleset.xml is the old one..0 -
With the same content?
0 -
giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐ง๐ปโ๐ - Cadet
yes..
0 -
Seems to work, thx.
0 -
Since spryker/git-hook is always taken from dev-master, those changes had been released. Please make sure to announce changes like this or start versioning that package.
0 -
And how would you tell the console command
code:sniff:style
to look for phpcs.xml instead of config/ruleset.xml?0 -
giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐ง๐ปโ๐ - Cadet
\Pyz\Zed\Development\DevelopmentConfig::getCodingStandard
0 -
giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐ง๐ปโ๐ - Cadet
/** * @return string */ public function getCodingStandard(): string { return APPLICATION_ROOT_DIR . DIRECTORY_SEPARATOR . 'phpcs.xml'; }
0 -
Great, thx.
0 -
Is there a chance to customize the pre-commit template that gets copied when running the composer script?
Background: since we run git commit locally, PHP can not be found under#!/usr/bin/php
Therefore we need something like
#!/usr/bin/env php
to let the system choose the location for php
0 -
Second: After the last update we get an error due to missing defined constant
APPLICATION_ROOT_DIR
on line 70 in CodeStyleSniffConfiguration. Anyone else? Could aslo has to do with moving to PHP8
0 -
Both can be solved actually by adapting the pre-commit template from
```
!/usr/bin/php
<?php
define('PROJECT_ROOT', DIR . '/../..');
define('PATH_PREFIX', DIRECTORY_SEPARATOR);require PROJECT_ROOT . '/vendor/autoload.php';
use GitHook\Hook\SprykerPreCommit;
$console = new SprykerPreCommit();
$console->run();or so
0 -
giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐ง๐ปโ๐ - Cadet
yes, i made the same 1 year ago...
0 -
okay, but how ๐
0 -
i see no โhookโ to replace the template that is used ^^
0 -
giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐ง๐ปโ๐ - Cadet
i will write u back later... ok? now in meeting
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 78 Spryker News
- 936 Developer Corner
- 793 Spryker Development
- 90 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 27 Job Opportunities
- 3.2K ๐ Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 33 Product & Business Questions
- 69 Spryker Safari Questions
- 50 Random