diff --git a/yamllint/rules/braces.py b/yamllint/rules/braces.py index 42ecede..d3c03fb 100644 --- a/yamllint/rules/braces.py +++ b/yamllint/rules/braces.py @@ -154,14 +154,15 @@ DEFAULT = {'forbid': False, def check(conf, token, prev, next, nextnext, context): - if conf['forbid'] == True and isinstance(token, yaml.FlowMappingStartToken): + if (conf['forbid'] is True and + isinstance(token, yaml.FlowMappingStartToken)): yield LintProblem(token.start_mark.line + 1, token.end_mark.column + 1, 'forbidden flow mapping') elif (conf['forbid'] == 'non-empty' and - isinstance(token, yaml.FlowMappingStartToken) and - not isinstance(next, yaml.FlowMappingEndToken)): + isinstance(token, yaml.FlowMappingStartToken) and + not isinstance(next, yaml.FlowMappingEndToken)): yield LintProblem(token.start_mark.line + 1, token.end_mark.column + 1, 'forbidden flow mapping') diff --git a/yamllint/rules/brackets.py b/yamllint/rules/brackets.py index fa4fcc4..01fee87 100644 --- a/yamllint/rules/brackets.py +++ b/yamllint/rules/brackets.py @@ -155,14 +155,15 @@ DEFAULT = {'forbid': False, def check(conf, token, prev, next, nextnext, context): - if conf['forbid'] == True and isinstance(token, yaml.FlowSequenceStartToken): + if (conf['forbid'] is True and + isinstance(token, yaml.FlowSequenceStartToken)): yield LintProblem(token.start_mark.line + 1, token.end_mark.column + 1, 'forbidden flow sequence') elif (conf['forbid'] == 'non-empty' and - isinstance(token, yaml.FlowSequenceStartToken) and - not isinstance(next, yaml.FlowSequenceEndToken)): + isinstance(token, yaml.FlowSequenceStartToken) and + not isinstance(next, yaml.FlowSequenceEndToken)): yield LintProblem(token.start_mark.line + 1, token.end_mark.column + 1, 'forbidden flow sequence')