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'm using spryker/code-sniffer 0.16.5 and want to disable the DocBlockConstSniff. I added this to th

U01LKKBK97T
U01LKKBK97T Posts: 287 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

I'm using spryker/code-sniffer 0.16.5 and want to disable the DocBlockConstSniff. I added this to the ruleset.xml, but it doesn't work.

<rule ref="vendor/spryker/code-sniffer/Spryker/Sniffs">
    <exclude name="vendor/spryker/code-sniffer/Spryker/Sniffs/Commenting/DocBlockConstSniff.php"/>
</rule>

Code sniffer still complains about Doc Block for const missing. Did anybody manage to successfully disable specific sniffs?

Comments

  • UQ958DA4U
    UQ958DA4U Posts: 232 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    Name needs to be the name and not the path.

    For example:

    <rule ref="vendor/spryker/code-sniffer/Spryker/ruleset.xml">
            <exclude name="Spryker.Commenting.FileDocBlock" />
        </rule>
    
  • Chemaclass
    Chemaclass Tech Lead Spryker Solution Partner Posts: 213 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    Try something like this:

    <rule ref="SlevomatCodingStandard.TypeHints">
      <exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"></exclude>
      <exclude name="SlevomatCodingStandard.TypeHints.DisallowArrayTypeHintSyntax"></exclude>
      <exclude name="SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint"></exclude>
      <exclude name="SlevomatCodingStandard.TypeHints.LongTypeHints"></exclude>
      <exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration"></exclude>
      <exclude name="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint"></exclude>
    </rule>
    
  • U01LKKBK97T
    U01LKKBK97T Posts: 287 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    Thanks guys, will give it a try.

    I sticked to the documentation so far, which seems to be wrong then: https://documentation.spryker.com/docs/updating-a-spryker-based-project

  • U01LKKBK97T
    U01LKKBK97T Posts: 287 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    Got it, this one is working:

    <rule ref="vendor/spryker/code-sniffer/Spryker/ruleset.xml">
        <exclude name="Spryker.Commenting.DocBlockConst" />
    </rule>
    
  • Yeah, someone who didn't try this wrote those docs
    I provided a fix as PR: https://github.com/spryker/documentation/pull/348/files
    Always also otherwise refer to the actual repo docs (README), as those are more likely to be fully in sync with the actual implementation.

  • U01LKKBK97T
    U01LKKBK97T Posts: 287 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    @UQK3ZPJEN Thanks for the quick response again.

    Regarding the online docs I'd appreciate if it would be kept up to date regularly. Imho it doesn't make sense to have an online documentation that is not reliable.