Skip to content

feat(sniffs): allow // nosemgrep directives in comment-style sniffs#19

Merged
kodyhagen-gh merged 3 commits into
releasefrom
feat/nosemgrep-comment-exception
Jun 29, 2026
Merged

feat(sniffs): allow // nosemgrep directives in comment-style sniffs#19
kodyhagen-gh merged 3 commits into
releasefrom
feat/nosemgrep-comment-exception

Conversation

@kodyhagen-gh

Copy link
Copy Markdown
Contributor

Summary

Exempts nosemgrep directive comments from the BSU comment-style sniffs, the same way phpcs:, @codeCoverageIgnore, and @phpstan are already exempt.

  • SingleLineCommentSniff (own-line comments) and InlineCommentSniff (trailing comments) now skip any comment containing nosemgrep, so // nosemgrep: <rule-id> -- reason no longer gets flagged or auto-converted to a block comment.
  • This lets consumers suppress a semgrep finding inline (// nosemgrep: ...) without the comment tripping the standard's "use /* */" / "use PHPDoc" rules.

Added PASS fixtures for both the standalone and trailing forms; npm run lint and npm test are green.

@kodyhagen-gh
kodyhagen-gh merged commit d8ceca4 into release Jun 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant