From 8bd68e7e41d9c1bff4a3bd6d2b1b306b2bbc78c8 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 7 Jun 2025 17:47:22 +0200 Subject: [PATCH] Remove and prevent trailing whitespace (#10199) * Remove trailing whitespace. * Add no-trailing-whitespace extra test. * Re-add needed trailing whitespace. * Remove one more trailing whitespace. --- antsibull-nox.toml | 12 ++++++++++++ ...ions-lists_of_dictionaries-keep_keys.rst.j2 | 2 +- ...ns-lists_of_dictionaries-remove_keys.rst.j2 | 2 +- ...s-lists_of_dictionaries-replace_keys.rst.j2 | 2 +- ...mations-lists_of_dictionaries-keep_keys.rst | 2 +- ...tions-lists_of_dictionaries-remove_keys.rst | 2 +- ...ions-lists_of_dictionaries-replace_keys.rst | 2 +- ...ract_informations-lists_of_dictionaries.rst | 2 +- .../targets/cargo/tasks/test_directory.yml | 2 +- .../consul/tasks/consul_binding_rule.yml | 2 +- .../filter_remove_keys/vars/main/tests.yml | 2 +- .../filter_to_prettytable/tasks/main.yml | 4 ++-- .../targets/filter_version_sort/tasks/main.yml | 2 +- .../targets/github_key/vars/main.yml | 2 +- .../targets/gitlab_branch/tasks/main.yml | 6 +++--- .../defaults/main.yml | 8 ++++---- .../gitlab_group_variable/tasks/main.yml | 2 +- .../integration/targets/gitlab_label/README.md | 4 ++-- .../targets/gitlab_milestone/README.md | 4 ++-- .../defaults/main.yml | 8 ++++---- .../gitlab_project_variable/tasks/main.yml | 4 ++-- .../targets/homebrew/tasks/casks.yml | 6 +++--- .../targets/ini_file/tasks/tests/01-value.yml | 15 ++++----------- .../targets/ini_file/tasks/tests/02-values.yml | 16 ++++++++-------- .../tasks/tests/06-modify_inactive_option.yml | 2 +- .../iso_customize/tasks/iso_customize.yml | 2 +- .../targets/iso_customize/tasks/iso_mount.yml | 2 +- .../targets/iso_customize/tasks/main.yml | 4 ++-- .../integration/targets/jboss/tasks/jboss.yml | 6 +++--- .../targets/kernel_blacklist/handlers/main.yml | 1 - .../keycloak_authentication/tasks/main.yml | 8 ++++---- .../tasks/main.yml | 2 +- .../keycloak_client_rolescope/tasks/main.yml | 8 ++++---- .../keycloak_component_info/tasks/main.yml | 6 +++--- .../targets/keycloak_role/vars/main.yml | 8 ++++---- .../keycloak_userprofile/tasks/main.yml | 4 ++-- .../targets/lvg/tasks/test_pvresize.yml | 6 +++--- tests/integration/targets/mail/tasks/main.yml | 2 +- tests/integration/targets/mqtt/tasks/main.yml | 2 +- tests/integration/targets/nomad/files/job.hcl | 2 +- .../integration/targets/odbc/defaults/main.yml | 6 +++--- .../targets/one_image_info/tasks/main.yml | 2 +- .../targets/one_vnet/tasks/main.yml | 2 +- .../tasks/setup_redis_cluster.yml | 4 ++-- .../targets/setup_rundeck/defaults/main.yml | 2 +- .../targets/shutdown/tasks/main.yml | 6 +++--- .../targets/systemd_info/tasks/main.yml | 8 ++++---- .../targets/terraform/vars/main.yml | 6 +++--- .../targets/timezone/tasks/test.yml | 2 +- .../targets/zypper/tasks/zypper.yml | 18 +++++++++--------- 50 files changed, 119 insertions(+), 115 deletions(-) diff --git a/antsibull-nox.toml b/antsibull-nox.toml index 87aafee80f..a35be2b895 100644 --- a/antsibull-nox.toml +++ b/antsibull-nox.toml @@ -24,6 +24,18 @@ run_no_unwanted_files = true no_unwanted_files_module_extensions = [".py"] no_unwanted_files_yaml_extensions = [".yml"] run_action_groups = true +run_no_trailing_whitespace = true +no_trailing_whitespace_skip_paths = [ + "tests/integration/targets/iso_extract/files/test.iso", + "tests/integration/targets/java_cert/files/testpkcs.p12", + "tests/integration/targets/one_host/files/testhost/tmp/opennebula-fixtures.json.gz", + "tests/integration/targets/one_template/files/testhost/tmp/opennebula-fixtures.json.gz", + "tests/integration/targets/setup_flatpak_remote/files/repo.tar.xz", +] +no_trailing_whitespace_skip_directories = [ + "tests/unit/plugins/modules/interfaces_file/interfaces_file_fixtures/golden_output/", + "tests/unit/plugins/modules/interfaces_file/interfaces_file_fixtures/input/", +] [[sessions.extra_checks.action_groups_config]] name = "consul" diff --git a/docs/docsite/helper/keep_keys/filter_guide-abstract_informations-lists_of_dictionaries-keep_keys.rst.j2 b/docs/docsite/helper/keep_keys/filter_guide-abstract_informations-lists_of_dictionaries-keep_keys.rst.j2 index 77281549ba..64ac1ff0c2 100644 --- a/docs/docsite/helper/keep_keys/filter_guide-abstract_informations-lists_of_dictionaries-keep_keys.rst.j2 +++ b/docs/docsite/helper/keep_keys/filter_guide-abstract_informations-lists_of_dictionaries-keep_keys.rst.j2 @@ -36,7 +36,7 @@ gives result: {{ tests.0.result | to_yaml(indent=2) | indent(5) }} - + .. versionadded:: 9.1.0 * The results of the below examples 1-5 are all the same: diff --git a/docs/docsite/helper/remove_keys/filter_guide-abstract_informations-lists_of_dictionaries-remove_keys.rst.j2 b/docs/docsite/helper/remove_keys/filter_guide-abstract_informations-lists_of_dictionaries-remove_keys.rst.j2 index 62b25c344c..6c201d5b4e 100644 --- a/docs/docsite/helper/remove_keys/filter_guide-abstract_informations-lists_of_dictionaries-remove_keys.rst.j2 +++ b/docs/docsite/helper/remove_keys/filter_guide-abstract_informations-lists_of_dictionaries-remove_keys.rst.j2 @@ -36,7 +36,7 @@ gives result: {{ tests.0.result | to_yaml(indent=2) | indent(5) }} - + .. versionadded:: 9.1.0 * The results of the below examples 1-5 are all the same: diff --git a/docs/docsite/helper/replace_keys/filter_guide-abstract_informations-lists_of_dictionaries-replace_keys.rst.j2 b/docs/docsite/helper/replace_keys/filter_guide-abstract_informations-lists_of_dictionaries-replace_keys.rst.j2 index fb0af32f2f..0c0ba8f0be 100644 --- a/docs/docsite/helper/replace_keys/filter_guide-abstract_informations-lists_of_dictionaries-replace_keys.rst.j2 +++ b/docs/docsite/helper/replace_keys/filter_guide-abstract_informations-lists_of_dictionaries-replace_keys.rst.j2 @@ -37,7 +37,7 @@ gives result: {{ tests.0.result | to_yaml(indent=2) | indent(5) }} - + .. versionadded:: 9.1.0 * The results of the below examples 1-3 are all the same: diff --git a/docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries-keep_keys.rst b/docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries-keep_keys.rst index 488cb2ce7d..3549d29ba7 100644 --- a/docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries-keep_keys.rst +++ b/docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries-keep_keys.rst @@ -44,7 +44,7 @@ gives - {k0_x0: A0, k1_x1: B0} - {k0_x0: A1, k1_x1: B1} - + .. versionadded:: 9.1.0 * The results of the below examples 1-5 are all the same: diff --git a/docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries-remove_keys.rst b/docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries-remove_keys.rst index 03d4710f3a..4ac87ab79c 100644 --- a/docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries-remove_keys.rst +++ b/docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries-remove_keys.rst @@ -46,7 +46,7 @@ gives - k2_x2: [C1] k3_x3: bar - + .. versionadded:: 9.1.0 * The results of the below examples 1-5 are all the same: diff --git a/docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries-replace_keys.rst b/docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries-replace_keys.rst index ba1bcad502..d0eb202bfe 100644 --- a/docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries-replace_keys.rst +++ b/docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries-replace_keys.rst @@ -53,7 +53,7 @@ gives k2_x2: [C1] k3_x3: bar - + .. versionadded:: 9.1.0 * The results of the below examples 1-3 are all the same: diff --git a/docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries.rst b/docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries.rst index 42737c44b7..64a82536d8 100644 --- a/docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries.rst +++ b/docs/docsite/rst/filter_guide-abstract_informations-lists_of_dictionaries.rst @@ -4,7 +4,7 @@ SPDX-License-Identifier: GPL-3.0-or-later .. _ansible_collections.community.general.docsite.filter_guide.filter_guide_abstract_informations.lists_of_dicts: - + Lists of dictionaries ^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/integration/targets/cargo/tasks/test_directory.yml b/tests/integration/targets/cargo/tasks/test_directory.yml index f4275ede68..b0b7120388 100644 --- a/tests/integration/targets/cargo/tasks/test_directory.yml +++ b/tests/integration/targets/cargo/tasks/test_directory.yml @@ -24,7 +24,7 @@ path: "{{ manifest_path }}" regexp: '^version = ".*"$' line: 'version = "1.0.0"' - + - name: Ensure package is uninstalled community.general.cargo: name: "{{ package_name }}" diff --git a/tests/integration/targets/consul/tasks/consul_binding_rule.yml b/tests/integration/targets/consul/tasks/consul_binding_rule.yml index 57f487d146..1ada2a330b 100644 --- a/tests/integration/targets/consul/tasks/consul_binding_rule.yml +++ b/tests/integration/targets/consul/tasks/consul_binding_rule.yml @@ -18,7 +18,7 @@ 0iT9wCS0DRTXu269V264Vf/3jvredZiKRkgwlL9xNAwxXFg0x/XFw005UWVRIkdg cKWTjpBP2dPwVZ4WWC+9aGVd+Gyn1o0CLelf4rEjGoXbAAEgAqeGUxrcIlbjXfbc mwIDAQAB - -----END PUBLIC KEY----- + -----END PUBLIC KEY----- - name: Create a binding rule community.general.consul_binding_rule: diff --git a/tests/integration/targets/filter_remove_keys/vars/main/tests.yml b/tests/integration/targets/filter_remove_keys/vars/main/tests.yml index a4767ea799..45b89ba62d 100644 --- a/tests/integration/targets/filter_remove_keys/vars/main/tests.yml +++ b/tests/integration/targets/filter_remove_keys/vars/main/tests.yml @@ -37,4 +37,4 @@ tests: - {k0_x0: A1, k1_x1: B1, k2_x2: [C1], k3_x3: bar} result: - {k1_x1: B0, k2_x2: [C0], k3_x3: foo} - - {k1_x1: B1, k2_x2: [C1], k3_x3: bar} + - {k1_x1: B1, k2_x2: [C1], k3_x3: bar} diff --git a/tests/integration/targets/filter_to_prettytable/tasks/main.yml b/tests/integration/targets/filter_to_prettytable/tasks/main.yml index 69f25ad59c..95d4118e27 100644 --- a/tests/integration/targets/filter_to_prettytable/tasks/main.yml +++ b/tests/integration/targets/filter_to_prettytable/tasks/main.yml @@ -237,7 +237,7 @@ - failure_result is failed - > "Expected a list of header names, got a string" in failure_result.msg - + - name: Test empty data with non-dictionary column_alignments (expect failure) block: - set_fact: @@ -263,7 +263,7 @@ - failure_result is failed - > "Expected a string for column_alignments value, got a int" in failure_result.msg - + - name: Test empty data with invalid alignment value in column_alignments (expect failure) block: - set_fact: diff --git a/tests/integration/targets/filter_version_sort/tasks/main.yml b/tests/integration/targets/filter_version_sort/tasks/main.yml index 08985d1bae..e7a7e3757c 100644 --- a/tests/integration/targets/filter_version_sort/tasks/main.yml +++ b/tests/integration/targets/filter_version_sort/tasks/main.yml @@ -8,7 +8,7 @@ # 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 -- name: validate that versions are properly sorted in a stable way +- name: validate that versions are properly sorted in a stable way assert: that: - "['a-1.9.rpm', 'a-1.10-1.rpm', 'a-1.09.rpm', 'b-1.01.rpm', 'a-2.1-0.rpm', 'a-1.10-0.rpm'] | community.general.version_sort == ['a-1.9.rpm', 'a-1.09.rpm', 'a-1.10-0.rpm', 'a-1.10-1.rpm', 'a-2.1-0.rpm', 'b-1.01.rpm']" diff --git a/tests/integration/targets/github_key/vars/main.yml b/tests/integration/targets/github_key/vars/main.yml index 076392298e..23ac841f98 100644 --- a/tests/integration/targets/github_key/vars/main.yml +++ b/tests/integration/targets/github_key/vars/main.yml @@ -8,4 +8,4 @@ test_key_name: "ansible-test-key" github_api_url: "https://api.github.com" enterprise_api_url: "https://github.company.com/api/v3" enterprise_api_url_trailing: "https://github.company.com/api/v3/" -test_pubkey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTgvwjlRHZ8E1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ test@example.com" +test_pubkey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTgvwjlRHZ8E1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ test@example.com" diff --git a/tests/integration/targets/gitlab_branch/tasks/main.yml b/tests/integration/targets/gitlab_branch/tasks/main.yml index 19d90e15cf..ee39f452fc 100644 --- a/tests/integration/targets/gitlab_branch/tasks/main.yml +++ b/tests/integration/targets/gitlab_branch/tasks/main.yml @@ -22,7 +22,7 @@ initialize_with_readme: true state: present -- name: Create branch {{ gitlab_branch }} +- name: Create branch {{ gitlab_branch }} community.general.gitlab_branch: api_url: https://gitlab.com api_token: secret_access_token @@ -54,12 +54,12 @@ branch: "{{ gitlab_branch }}" state: absent register: delete_branch - + - name: Test module is idempotent assert: that: - delete_branch is changed - + - name: Clean up {{ gitlab_project_name }} gitlab_project: server_url: "{{ gitlab_host }}" diff --git a/tests/integration/targets/gitlab_group_access_token/defaults/main.yml b/tests/integration/targets/gitlab_group_access_token/defaults/main.yml index 1b0dab2892..16d4208e08 100644 --- a/tests/integration/targets/gitlab_group_access_token/defaults/main.yml +++ b/tests/integration/targets/gitlab_group_access_token/defaults/main.yml @@ -8,8 +8,8 @@ # 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 -gitlab_api_token: -gitlab_api_url: +gitlab_api_token: +gitlab_api_url: gitlab_validate_certs: false -gitlab_group_name: -gitlab_token_name: +gitlab_group_name: +gitlab_token_name: diff --git a/tests/integration/targets/gitlab_group_variable/tasks/main.yml b/tests/integration/targets/gitlab_group_variable/tasks/main.yml index 39a3a5df8d..2627080e38 100644 --- a/tests/integration/targets/gitlab_group_variable/tasks/main.yml +++ b/tests/integration/targets/gitlab_group_variable/tasks/main.yml @@ -242,7 +242,7 @@ - gitlab_group_variable_state is changed when: gitlab_premium_tests is defined -- name: apply again the environment scope change +- name: apply again the environment scope change gitlab_group_variable: api_url: "{{ gitlab_host }}" api_token: "{{ gitlab_login_token }}" diff --git a/tests/integration/targets/gitlab_label/README.md b/tests/integration/targets/gitlab_label/README.md index e27cb74c8c..06e662749f 100644 --- a/tests/integration/targets/gitlab_label/README.md +++ b/tests/integration/targets/gitlab_label/README.md @@ -1,4 +1,4 @@ -