MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / test_sarif_default_configuration

Function test_sarif_default_configuration

test/cli/sarif_test.py:413–427  ·  view source on GitHub ↗

Test that rules have default configuration with level.

()

Source from the content-addressed store, hash-verified

411
412
413def test_sarif_default_configuration():
414 """Test that rules have default configuration with level."""
415 sarif = run_sarif_check(BASIC_TEST_CODE)
416
417 run = sarif["runs"][0]
418 driver = run["tool"]["driver"]
419 rules = driver["rules"]
420
421 for rule in rules:
422 # Check for defaultConfiguration.level (#13885)
423 assert "defaultConfiguration" in rule
424 assert "level" in rule["defaultConfiguration"]
425
426 level = rule["defaultConfiguration"]["level"]
427 assert level in ["error", "warning", "note", "none"]
428
429
430def test_sarif_rule_properties():

Callers

nothing calls this directly

Calls 1

run_sarif_checkFunction · 0.85

Tested by

no test coverage detected