summaryrefslogtreecommitdiffstats
path: root/src/ansiblelint/rules/no_tabs.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:06:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:06:49 +0000
commit2fe34b6444502079dc0b84365ce82dbc92de308e (patch)
tree8fedcab52bbbc3db6c5aa909a88a7a7b81685018 /src/ansiblelint/rules/no_tabs.md
parentInitial commit. (diff)
downloadansible-lint-2fe34b6444502079dc0b84365ce82dbc92de308e.tar.xz
ansible-lint-2fe34b6444502079dc0b84365ce82dbc92de308e.zip
Adding upstream version 6.17.2.upstream/6.17.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/ansiblelint/rules/no_tabs.md')
-rw-r--r--src/ansiblelint/rules/no_tabs.md38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/ansiblelint/rules/no_tabs.md b/src/ansiblelint/rules/no_tabs.md
new file mode 100644
index 0000000..7895122
--- /dev/null
+++ b/src/ansiblelint/rules/no_tabs.md
@@ -0,0 +1,38 @@
+# no-tabs
+
+This rule checks for the tab character. The `\t` tab character can result in
+unexpected display or formatting issues. You should always use spaces instead of
+tabs.
+
+!!! note
+
+ This rule does not trigger alerts for tab characters in the ``ansible.builtin.lineinfile`` module.
+
+## Problematic Code
+
+```yaml
+---
+- name: Example playbook
+ hosts: all
+ tasks:
+ - name: Do not trigger the rule
+ ansible.builtin.lineinfile:
+ path: some.txt
+ regexp: '^\t$'
+ line: 'string with \t inside'
+ - name: Trigger the rule with a debug message
+ ansible.builtin.debug:
+ msg: "Using the \t character can cause formatting issues." # <- Includes the tab character.
+```
+
+## Correct Code
+
+```yaml
+---
+- name: Example playbook
+ hosts: all
+ tasks:
+ - name: Do not trigger the no-tabs rule
+ ansible.builtin.debug:
+ msg: "Using space characters avoids formatting issues."
+```