Skip to content

feat: add configurable severity levels for sniffs#2

Merged
jordikroon merged 2 commits into
mainfrom
feature/dynamic-severity
Apr 23, 2026
Merged

feat: add configurable severity levels for sniffs#2
jordikroon merged 2 commits into
mainfrom
feature/dynamic-severity

Conversation

@jordikroon
Copy link
Copy Markdown
Member

Change default violation severity from WARNING to ERROR and add support for overriding severity via sniff properties.

Change default violation severity from WARNING to ERROR and add support for overriding severity via sniff properties. The severity level is now resolved from configuration using Severity::tryFrom() with validation that throws LogicException if an invalid severity is configured. Add missing Severity use statements and document the exception in PHPDoc comments across all affected sniffs.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 23, 2026

PHPUnit 13.1.7 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.5.5 with Xdebug 3.5.1
Configuration: /home/runner/work/docbook-cs/docbook-cs/phpunit.xml.dist

...............................................................  63 / 231 ( 27%)
............................................................... 126 / 231 ( 54%)
............................................................... 189 / 231 ( 81%)
..........................................                      231 / 231 (100%)

Time: 00:00.801, Memory: 22.00 MB

OK (231 tests, 401 assertions)

Generating code coverage report in Clover XML format ... done [00:00.006]

Generating code coverage report in HTML format ... done [00:00.117]


Code Coverage Report Summary:
  Classes: 100.00% (24/24)
  Methods: 100.00% (124/124)
  Lines:   100.00% (819/819)

Remove unused imports of DocbookCS\Report\Severity from three sniff
classes that no longer reference this class.
@jordikroon jordikroon merged commit ace2ce8 into main Apr 23, 2026
3 checks passed
@jordikroon jordikroon deleted the feature/dynamic-severity branch April 30, 2026 17:18
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