... about a mismatch in line endings when the code "template" is defined using a heredoc with Linux line endings, while the code snippets being inserted into the code "template" were using line endings matching the OS on which the tests were being run.
File::addMessage(): do not ignore Internal errors when scanning selectively
When either the --sniffs=... CLI parameter is used, or the --exclude=... CLI parameter, the File::addMessage() method bows out when an error is passed which is not for one of the selected sniffs/is for one of the excluded sniffs.
Unfortunately, this "bowing out" did not take Internal errors into account, meaning those were now hidden, while those - IMO - should always be thrown as they generally inform the end-user of something wrong with the file which impacts the scan results (mixed line endings/no code found etc).
Fixed now.
Includes updating two test files to allow for seeing internal errors.
Suggested changelog entry
Internal errors will no longer be suppressed when the --sniffs or --exclude CLI arguments are used.
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] This change is only breaking for integrators, not for external standards or end-users.
[ ] Documentation improvement
👉🏻 This could be considered a breaking change, though I'm not sure whether it should be. Opinions welcome.
Most typically, this change may impact tests for external standards which don't expect Internal errors.
Description
ErrorSuppressionTest: prevent Internal errors
... about a mismatch in line endings when the code "template" is defined using a heredoc with Linux line endings, while the code snippets being inserted into the code "template" were using line endings matching the OS on which the tests were being run.
File::addMessage(): do not ignore Internal errors when scanning selectively
When either the
--sniffs=...
CLI parameter is used, or the--exclude=...
CLI parameter, theFile::addMessage()
method bows out when an error is passed which is not for one of the selected sniffs/is for one of the excluded sniffs.Unfortunately, this "bowing out" did not take
Internal
errors into account, meaning those were now hidden, while those - IMO - should always be thrown as they generally inform the end-user of something wrong with the file which impacts the scan results (mixed line endings/no code found etc).Fixed now.
Includes updating two test files to allow for seeing internal errors.
Suggested changelog entry
Internal errors will no longer be suppressed when the
--sniffs
or--exclude
CLI arguments are used.Types of changes
👉🏻 This could be considered a breaking change, though I'm not sure whether it should be. Opinions welcome.
Most typically, this change may impact tests for external standards which don't expect
Internal
errors.