From 79a12c3c43509d99310fad09b177ca64b8122e69 Mon Sep 17 00:00:00 2001 From: "Bradley A. Thornton" Date: Wed, 25 May 2022 15:53:41 -0700 Subject: [PATCH] Enable update docs via pre-commit (#186) * Enable update docs * Remove foo * Changelog * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 4 ---- changelogs/fragments/186.yaml | 3 +++ docs/ansible.utils.get_path_lookup.rst | 7 +++++-- docs/ansible.utils.index_of_lookup.rst | 17 +++++++++++++---- docs/ansible.utils.to_paths_lookup.rst | 4 +++- plugins/lookup/index_of.py | 2 +- 6 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 changelogs/fragments/186.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d206f30..8522b5a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,8 +1,4 @@ --- -ci: - skip: - # pre-commit.ci has trouble with this one - - update-docs repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.2.0 diff --git a/changelogs/fragments/186.yaml b/changelogs/fragments/186.yaml new file mode 100644 index 0000000..fe07750 --- /dev/null +++ b/changelogs/fragments/186.yaml @@ -0,0 +1,3 @@ +--- +trivial: + - Enable update-docs via pre-commit diff --git a/docs/ansible.utils.get_path_lookup.rst b/docs/ansible.utils.get_path_lookup.rst index ed6a3b7..356dafd 100644 --- a/docs/ansible.utils.get_path_lookup.rst +++ b/docs/ansible.utils.get_path_lookup.rst @@ -51,7 +51,8 @@ Parameters -
The path in the var to retrieve the value of. The path needs to a be a valid jinja path.
+
The path in the var to retrieve the value of.
+
The path needs to a be a valid jinja path.
@@ -90,7 +91,9 @@ Parameters -
If set to True, the return value will always be a list. This can also be accomplished using query or q instead of lookup. https://docs.ansible.com/ansible/latest/plugins/lookup.html.
+
If set to True, the return value will always be a list.
+
This can also be accomplished using query or q instead of lookup.
+
https://docs.ansible.com/ansible/latest/plugins/lookup.html.
diff --git a/docs/ansible.utils.index_of_lookup.rst b/docs/ansible.utils.index_of_lookup.rst index fd0ed39..27ce326 100644 --- a/docs/ansible.utils.index_of_lookup.rst +++ b/docs/ansible.utils.index_of_lookup.rst @@ -91,7 +91,9 @@ Parameters -
When the data provided is a list of dictionaries, run the test against this dictionary key. When using a key, the data must only contain dictionaries. See fail_on_missing below to determine the behaviour when the key is missing from a dictionary in the data.
+
When the data provided is a list of dictionaries, run the test against this dictionary key.
+
When using a key, the data must only contain dictionaries.
+
See fail_on_missing below to determine the behaviour when the key is missing from a dictionary in the data.
@@ -109,7 +111,9 @@ Parameters -
The name of the test to run against the list, a valid jinja2 test or ansible test plugin. Jinja2 includes the following tests http://jinja.palletsprojects.com/templates/#builtin-tests. An overview of tests included in ansible https://docs.ansible.com/ansible/latest/user_guide/playbooks_tests.html.
+
The name of the test to run against the list, a valid jinja2 test or ansible test plugin.
+
Jinja2 includes the following tests http://jinja.palletsprojects.com/templates/#builtin-tests.
+
An overview of tests included in ansible https://docs.ansible.com/ansible/latest/user_guide/playbooks_tests.html.
@@ -126,7 +130,9 @@ Parameters -
The value used to test each list item against. Not required for simple tests (eg: true, false, even, odd) May be a string, boolean, number, regular expression dict and so on, depending on the test used.
+
The value used to test each list item against.
+
Not required for simple tests (e.g. true, false, even, odd)
+
May be a string, boolean, number, regular expression dict and so on, depending on the test used.
@@ -147,7 +153,10 @@ Parameters -
When only a single entry in the data is matched, the index of that entry is returned as an integer. If set to True, the return value will always be a list, even if only a single entry is matched. This can also be accomplished using query or q instead of lookup. https://docs.ansible.com/ansible/latest/plugins/lookup.html
+
When only a single entry in the data is matched, the index of that entry is returned as an integer.
+
If set to True, the return value will always be a list, even if only a single entry is matched.
+
This can also be accomplished using query or q instead of lookup.
+
https://docs.ansible.com/ansible/latest/plugins/lookup.html
diff --git a/docs/ansible.utils.to_paths_lookup.rst b/docs/ansible.utils.to_paths_lookup.rst index 3d42e43..9e3f420 100644 --- a/docs/ansible.utils.to_paths_lookup.rst +++ b/docs/ansible.utils.to_paths_lookup.rst @@ -91,7 +91,9 @@ Parameters -
If set to True, the return value will always be a list. This can also be accomplished using query or q instead of lookup. https://docs.ansible.com/ansible/latest/plugins/lookup.html
+
If set to True, the return value will always be a list.
+
This can also be accomplished using query or q instead of lookup.
+
https://docs.ansible.com/ansible/latest/plugins/lookup.html
diff --git a/plugins/lookup/index_of.py b/plugins/lookup/index_of.py index 0023609..5be8929 100644 --- a/plugins/lookup/index_of.py +++ b/plugins/lookup/index_of.py @@ -17,7 +17,7 @@ DOCUMENTATION = """ author: Bradley Thornton (@cidrblock) version_added: "1.0.0" short_description: Find the indices of items in a list matching some criteria - description: foo + description: - This plugin returns the indices of items matching some criteria in a list. - When working with a list of dictionaries, the key to evaluate can be specified. - B(index_of) is also available as a B(filter plugin) for convenience.