Add --junitxml export to sigma check with bug fixes and tests#91
Open
Copilot wants to merge 4 commits into
Open
Add --junitxml export to sigma check with bug fixes and tests#91Copilot wants to merge 4 commits into
--junitxml export to sigma check with bug fixes and tests#91Copilot wants to merge 4 commits into
Conversation
Copilot
AI
changed the title
[WIP] Fix code according to review comments
Add Jun 15, 2026
--junitxml export to sigma check with bug fixes and tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements JUnit XML output for
sigma check(from PR #83), fixing anUnboundLocalErroridentified in review and adding test coverage.Changes
sigma/cli/check.pyimport xml.etree.ElementTree as ET,SEVERITY_ICONSdict, andgenerate_junit_report()— groups results into<testsuite>elements by error/issue type--junitxml <path>option; wire throughcheck()andload_and_check_rules()via an optionaljunit_resultslist parameterSigmaConditionErrorhandler, the original PR referencedrule_name/file_pathvariables that were never defined in that code path, causing anUnboundLocalError. Now reads directly from the currentruleobject:Noneseverity values with(res.get("severity") or "ok").lower()/(res.get("severity") or "UNKNOWN").upper()SigmaErroris caughttests/test_check.pytest_check_junitxml_creates_file— verifies the XML file is created, well-formed, and rooted at<testsuites>test_check_junitxml_invalid— verifies failure entries are written for rules with parsing errors and that eachtestsuite/@failurescount exactly matches the number of<failure>child elementsBoth tests use
tests/files/invalidwith--pass-on-errorto avoid the pre-existing network dependency on MITRE D3FEND data that already affectstest_check_valid.