mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 23:21:22 -07:00
Add error info if tabs are found in the yaml (#18343)
If a yaml file fails to load because of tabs being used for formatting, detect that and show a error message with more details.
This commit is contained in:
parent
e8e09f3df6
commit
51e3ef89a9
4 changed files with 41 additions and 1 deletions
|
@ -116,3 +116,20 @@ Could be written as:
|
|||
foo: '"bad" "wolf"'
|
||||
"""
|
||||
|
||||
YAML_COMMON_LEADING_TAB_ERROR = """\
|
||||
There appears to be a tab character at the start of the line.
|
||||
|
||||
YAML does not use tabs for formatting. Tabs should be replaced with spaces.
|
||||
|
||||
For example:
|
||||
- name: update tooling
|
||||
vars:
|
||||
version: 1.2.3
|
||||
# ^--- there is a tab there.
|
||||
|
||||
Should be written as:
|
||||
- name: update tooling
|
||||
vars:
|
||||
version: 1.2.3
|
||||
# ^--- all spaces here.
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue