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..

Hello, is there a recommendation to use some of PHPstorm’s built-in codequality checkers (CodeSniffe

s.kroll
s.kroll Posts: 118 🪐 - Explorer

Hello,
is there a recommendation to use some of PHPstorm’s built-in codequality checkers (CodeSniffer, Mess Detector, CS Fixer) with matching rulesets?
Or are there maybe even some config-profiles for PHPstorm (Preferences > Editor > Code Style > PHP), or PHP Inspections Plugins?
An “official” IDE ruleset could help to get bad things directly highlighted while development 😉

Comments

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 🧑🏻‍🚀 - Cadet

    there is no “official recommendation” - it’s totally up to you. Inside of the team, we have completely different degree of using phpStorm features from member to member. Some one prefers console more, someone likes using phpstorm features as much as it can give.

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 🧑🏻‍🚀 - Cadet

    we do plan to collect and release some tips and tricks for phpstorm in the future!

  • s.kroll
    s.kroll Posts: 118 🪐 - Explorer

    Thank you, Andriy. We are looking forward to it.

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 🧑🏻‍🚀 - Cadet

    but so far yes, you can use existing config files for phpcs, md and also configure shortcuts for custom checks, like f.e. phpstan or so. I can’t remember exactly where/what it is.. maybe @ULMK1EG9Z could you pls share what are you using?

  • Sylvain Gaffie
    Sylvain Gaffie Sprykee Posts: 18 🧑🏻‍🚀 - Cadet

    I use the external tool feature in phpstorm, so that I can run phpstan and phpcs/phpcbf on the file I am looking at (saves time, running on project takes forever on some project). You can also use that to run a single test.
    But this is not "official" Spryker.

  • s.kroll
    s.kroll Posts: 118 🪐 - Explorer

    Thank you Sylvain. We will evaluate this for our project 👌

  • Sylvain Gaffie
    Sylvain Gaffie Sprykee Posts: 18 🧑🏻‍🚀 - Cadet
    edited March 2020

    then you can assign each tool to a keyboard shortcut.
    or you can find it in ctrl+shift+a. I recommand you use a keyword (zelf here) to find them quickly.

  • s.kroll
    s.kroll Posts: 118 🪐 - Explorer

    Never tried it on this level 😄 Thanks for the hints

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 🧑🏻‍🚀 - Cadet

    thanks Sylvain 👍

  • s.kroll
    s.kroll Posts: 118 🪐 - Explorer

    One more thing, just to be sure:
    The demoshop-bundled phpcs and the ./config/ruleset.xml are meant to be used for core-development (e.g. /vendor/spryker) or for the project itself (/src/Pyz)

  • Sylvain Gaffie
    Sylvain Gaffie Sprykee Posts: 18 🧑🏻‍🚀 - Cadet

    In that folder, it is meant to be used for your project with your alterations.