'''Check that parameters without key as title breaks validation.'''
withpytest.raises(RuleValidationError,match=fr'^Rule {rule.id} should have a parameter name declared with `.name` before the bock, for each parameter'):
'''Check that forgetting the language for sources breaks validation'''
rule=invalid_rule('S100','cfamily')
withpytest.raises(RuleValidationError,match=re.escape(f'Rule {rule.id} has non highlighted code example in section "Noncompliant Code Example".\nUse [source,cpp] or [source,text] before the opening \'----\'.')):
'''Check that forgetting the language for sources breaks validation in case of multiple blocks too'''
rule=invalid_rule('S100','java')
withpytest.raises(RuleValidationError,match=re.escape(f'Rule {rule.id} has non highlighted code example in section "Noncompliant Code Example".\nUse [source,java] or [source,text] before the opening \'----\'.')):
'''Check that forgetting the language for sources breaks validation'''
rule=invalid_rule('S100','csharp')
withpytest.raises(RuleValidationError,match=re.escape(f'Rule {rule.id} has unknown language "unknown" in code example in section "Noncompliant Code Example".\nAre you looking for "csharp"?')):