Added cspell:ignore sniff.

Adds a custom phpcs sniff (Canvas.Commenting.CspellIgnorePlacement) that enforces file-level cspell:ignore comments to be placed on the line immediately after the namespace declaration, before any use statements. Inline cspell:ignore comments inside class/function scope are allowed anywhere. The rule is registered in the Canvas custom ruleset.xml with an exclusion for tests/fixtures/*.

AI-Generated: Yes (Used Claude Code to generate the sniff).

Testing instructions

  • Run composer run phpcs — the sniff should flag any file-level cspell:ignore comments not in the canonical position (line after the namespace declaration).
  • Verify that inline cspell:ignore comments inside a class or function body are not flagged.
  • Verify that files under tests/fixtures/ are excluded.

Closes #3591597 (closed)

Edited by Christian López Espínola

Merge request reports

Loading