From b751d79a98ebd1bfce3d5bab3c797a9c2960fbd8 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 17 Jun 2025 07:19:14 +0200 Subject: [PATCH] Update yamllint config, fix YAML. --- .yamllint-extra-docs | 53 ++++++++++++++++++++++++++++++++++ antsibull-nox.toml | 1 + docs/docsite/rst/api-guide.rst | 2 +- docs/docsite/rst/ssh-guide.rst | 26 ++++++++--------- 4 files changed, 68 insertions(+), 14 deletions(-) create mode 100644 .yamllint-extra-docs diff --git a/.yamllint-extra-docs b/.yamllint-extra-docs new file mode 100644 index 0000000..7e24c0f --- /dev/null +++ b/.yamllint-extra-docs @@ -0,0 +1,53 @@ +--- +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later +# SPDX-FileCopyrightText: 2025 Felix Fontein + +extends: default + +ignore: | + /changelogs/ + +rules: + line-length: + max: 160 + level: error + document-start: disable + document-end: + present: false + truthy: + level: error + allowed-values: + - 'true' + - 'false' + indentation: + spaces: 2 + indent-sequences: true + key-duplicates: enable + trailing-spaces: enable + new-line-at-end-of-file: disable + hyphens: + max-spaces-after: 1 + empty-lines: + max: 2 + max-start: 0 + max-end: 0 + commas: + max-spaces-before: 0 + min-spaces-after: 1 + max-spaces-after: 1 + colons: + max-spaces-before: 0 + max-spaces-after: 1 + brackets: + min-spaces-inside: 0 + max-spaces-inside: 0 + braces: + min-spaces-inside: 0 + max-spaces-inside: 1 + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true + comments: + min-spaces-from-content: 1 + comments-indentation: false diff --git a/antsibull-nox.toml b/antsibull-nox.toml index 776e49f..8391654 100644 --- a/antsibull-nox.toml +++ b/antsibull-nox.toml @@ -18,6 +18,7 @@ run_yamllint = true yamllint_config = ".yamllint" yamllint_config_plugins = ".yamllint-docs" yamllint_config_plugins_examples = ".yamllint-examples" +yamllint_config_extra_docs = ".yamllint-extra-docs" run_mypy = false [sessions.docs_check] diff --git a/docs/docsite/rst/api-guide.rst b/docs/docsite/rst/api-guide.rst index be4bfa3..9df17fc 100644 --- a/docs/docsite/rst/api-guide.rst +++ b/docs/docsite/rst/api-guide.rst @@ -191,7 +191,7 @@ When this playbook completed successfully, you should be able to use the HTTPS a .. code-block:: yaml+jinja - community.routeros.api: - ... + # ... tls: true validate_certs: true validate_cert_hostname: true diff --git a/docs/docsite/rst/ssh-guide.rst b/docs/docsite/rst/ssh-guide.rst index 685038e..ac1f65b 100644 --- a/docs/docsite/rst/ssh-guide.rst +++ b/docs/docsite/rst/ssh-guide.rst @@ -66,22 +66,22 @@ With the above inventory, you can use the following playbook to execute ``/syste gather_facts: false tasks: - - name: Gather system resources - community.routeros.command: - commands: - - /system resource print - register: system_resource_print + - name: Gather system resources + community.routeros.command: + commands: + - /system resource print + register: system_resource_print - - name: Show system resources - debug: - var: system_resource_print.stdout_lines + - name: Show system resources + debug: + var: system_resource_print.stdout_lines - - name: Gather facts - community.routeros.facts: + - name: Gather facts + community.routeros.facts: - - name: Show a fact - debug: - msg: "First IP address: {{ ansible_net_all_ipv4_addresses[0] }}" + - name: Show a fact + debug: + msg: "First IP address: {{ ansible_net_all_ipv4_addresses[0] }}" This results in the following output: