Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
var-spacing: fix multiline nested JSON false positive (#1672)
* E206: Increase testing accuracy VariableHasSpacesRule testing was limited to ensuring that the number of error was matching an expected number. This could have potential limitation where for example a commit prevents an real linting error from being raised and in the same time raises an invalid one. This commit aims at improving this rule's testing by ensuring that errors are raised only on a controlled set of lines. Related to: #1671 * E206: Add testing for false positive nested JSON This commit adds 4 new tasks in example playbook used for VariableHasSpacesRule testing. One of these rule is a nested multiline JSON object which has its opening and closing brackets spanned on different lines. And this rule raises false positive error. Related to #1671 * E206: Fix multiline nested JSON false positive When using a nested JSON object spanned on multiple lines in a Jinja2 context ansible-lint raises a false positive E206 error. This commit extends the regex in charge of excluding false positive JSON objects so that it handles multiline matching. Fixes #1671 Co-authored-by: Sorin Sbarnea <ssbarnea@redhat.com>
- Loading branch information
Showing
2 changed files
with
53 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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