Skip to content

Conversation

@vukanac
Copy link
Contributor

@vukanac vukanac commented Mar 23, 2023

  • Add make sniff
  • Add make sniff-fix
  • Add sniff step in CI
  • Fix code to pass CS check
  • Fix bug in ExceptionMessageSniff to reduce the scope of targets only to classes ending with *Exception,
    -> problem with full body check full instead of only exception message still exists, just now is only in Exceptions.

@vukanac vukanac marked this pull request as draft March 23, 2023 12:12
@vukanac vukanac self-assigned this Mar 23, 2023
@vukanac
Copy link
Contributor Author

vukanac commented Mar 23, 2023

I can confirm the bug with ExceptionMessageSniff still exists as explained in #18 (comment)
It complains on self :) with message:

FILE: /Users/v.vukanac/github/flyeralarm/php-code-validator/custom-standards/Flyeralarm/Sniffs/File/ExceptionMessageSniff.php
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------
 8 | ERROR | Exclamationmarks are not allowed in Exceptionmessages
   |       | (Flyeralarm.File.ExceptionMessage.ExceptionMessageWithInvalidCharacter)
 8 | ERROR | Full stops are not allowed in Exceptionmessages (Flyeralarm.File.ExceptionMessage.ExceptionMessageWithInvalidCharacter)
-------------------------------------------------------------------------------------------------------------------------------------------

and it's because somewhere in the body of the class there are . (line 43) and ! (line 35)!

vukanac referenced this pull request Mar 23, 2023
…ending with *Exception

* The problem with checking all strings in class body instead only of message still exists
* https://github.com/flyeralarm/php-code-validator/pull/29\#issuecomment-1481121548
@vukanac vukanac marked this pull request as ready for review March 23, 2023 13:02
@vukanac
Copy link
Contributor Author

vukanac commented Mar 23, 2023

This PR fixes (or reduces) the problem with the bug explains in #18.
It also incorporates many changes from it.

@vukanac vukanac requested a review from MichelHartmann March 23, 2023 13:03
@vukanac vukanac merged commit e2bdd7e into master Mar 24, 2023
@MichelHartmann MichelHartmann deleted the IN-1729-sniff branch March 24, 2023 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants