exercism / php

Exercism exercises in PHP.
https://exercism.org/tracks/php
MIT License
144 stars 139 forks source link

ci: Fix strict types sniff #857

Closed tomasnorre closed 3 hours ago

tomasnorre commented 6 days ago

Resolves the problem from Updating to "squizlabs/php_codesniffer": "3.11.0"

tomasnorre commented 6 days ago

I'm a little confused that the exclude isn't respected anymore. From a quick glance all errors are from example.php or *Test.php which both should be excluded.

<rule ref="src/Sniffs/StrictTypes/ExplainStrictTypesSniff.php">
  <exclude-pattern>*/*Test\.php</exclude-pattern>
  <exclude-pattern>*/.meta/*\.php</exclude-pattern>
  <exclude-pattern>src/*</exclude-pattern>
  <exclude-pattern>contribution/*.php</exclude-pattern>
</rule>
mk-mxp commented 5 days ago

Well, looks like the sniff name generation has gone wrong and so the excludes are not applied for our sniff. Would you mind opening an issue at PHPCodeSniffer and report the problem?

tomasnorre commented 3 days ago

It's now working ready for review.

I'm personally self in doubt about the src/Exercism/ directory, if that should be called something else.

tomasnorre commented 19 hours ago

Which version of PHP CodeSniffer is required as a minimum, so that the name change works with the exclude-pattern? This should be set in composer.json "require-dev": { "squizlabs/php_codesniffer": "^3.11.?" } accordingly.

3.11.1, I'll update composer.json too.