[PR #9394/912065ad backport][stable-9] h*.py: normalize docs (#9416)

h*.py: normalize docs (#9394)

* h*.py: normalize docs

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 912065ad0e)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2024-12-26 22:44:12 +01:00 committed by GitHub
parent e1d229f2c5
commit 87d63c5bed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 2272 additions and 2513 deletions

View file

@ -14,81 +14,80 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: homebrew
author:
- "Indrajit Raychaudhuri (@indrajitr)"
- "Daniel Jaouen (@danieljaouen)"
- "Andrew Dunham (@andrew-d)"
- "Indrajit Raychaudhuri (@indrajitr)"
- "Daniel Jaouen (@danieljaouen)"
- "Andrew Dunham (@andrew-d)"
requirements:
- homebrew must already be installed on the target system
- homebrew must already be installed on the target system
short_description: Package manager for Homebrew
description:
- Manages Homebrew packages
- Manages Homebrew packages.
extends_documentation_fragment:
- community.general.attributes
- community.general.attributes
attributes:
check_mode:
support: full
diff_mode:
support: none
check_mode:
support: full
diff_mode:
support: none
options:
name:
description:
- A list of names of packages to install/remove.
aliases: [ 'formula', 'package', 'pkg' ]
type: list
elements: str
path:
description:
- "A V(:) separated list of paths to search for C(brew) executable.
Since a package (I(formula) in homebrew parlance) location is prefixed relative to the actual path of C(brew) command,
providing an alternative C(brew) path enables managing different set of packages in an alternative location in the system."
default: '/usr/local/bin:/opt/homebrew/bin:/home/linuxbrew/.linuxbrew/bin'
type: path
state:
description:
- state of the package.
choices: [ 'absent', 'head', 'installed', 'latest', 'linked', 'present', 'removed', 'uninstalled', 'unlinked', 'upgraded' ]
default: present
type: str
update_homebrew:
description:
- update homebrew itself first.
type: bool
default: false
upgrade_all:
description:
- upgrade all homebrew packages.
type: bool
default: false
aliases: ['upgrade']
install_options:
description:
- options flags to install a package.
aliases: ['options']
type: list
elements: str
upgrade_options:
description:
- Option flags to upgrade.
type: list
elements: str
version_added: '0.2.0'
force_formula:
description:
- Force the package(s) to be treated as a formula (equivalent to C(brew --formula)).
- To install a cask, use the M(community.general.homebrew_cask) module.
type: bool
default: false
version_added: 9.0.0
name:
description:
- A list of names of packages to install/remove.
aliases: ['formula', 'package', 'pkg']
type: list
elements: str
path:
description:
- A V(:) separated list of paths to search for C(brew) executable. Since a package (I(formula) in homebrew parlance)
location is prefixed relative to the actual path of C(brew) command, providing an alternative C(brew) path enables
managing different set of packages in an alternative location in the system.
default: '/usr/local/bin:/opt/homebrew/bin:/home/linuxbrew/.linuxbrew/bin'
type: path
state:
description:
- State of the package.
choices: ['absent', 'head', 'installed', 'latest', 'linked', 'present', 'removed', 'uninstalled', 'unlinked', 'upgraded']
default: present
type: str
update_homebrew:
description:
- Update homebrew itself first.
type: bool
default: false
upgrade_all:
description:
- Upgrade all homebrew packages.
type: bool
default: false
aliases: ['upgrade']
install_options:
description:
- Options flags to install a package.
aliases: ['options']
type: list
elements: str
upgrade_options:
description:
- Option flags to upgrade.
type: list
elements: str
version_added: '0.2.0'
force_formula:
description:
- Force the package(s) to be treated as a formula (equivalent to C(brew --formula)).
- To install a cask, use the M(community.general.homebrew_cask) module.
type: bool
default: false
version_added: 9.0.0
notes:
- When used with a C(loop:) each package will be processed individually,
it is much more efficient to pass the list directly to the O(name) option.
'''
- When used with a C(loop:) each package will be processed individually, it is much more efficient to pass the list directly
to the O(name) option.
"""
EXAMPLES = '''
EXAMPLES = r"""
# Install formula foo with 'brew' in default path
- community.general.homebrew:
name: foo
@ -154,29 +153,29 @@ EXAMPLES = '''
name: ambiguous_formula
state: present
force_formula: true
'''
"""
RETURN = '''
RETURN = r"""
msg:
description: if the cache was updated or not
returned: always
type: str
sample: "Changed: 0, Unchanged: 2"
description: If the cache was updated or not.
returned: always
type: str
sample: "Changed: 0, Unchanged: 2"
unchanged_pkgs:
description:
- List of package names which are unchanged after module run
returned: success
type: list
sample: ["awscli", "ag"]
version_added: '0.2.0'
description:
- List of package names which are unchanged after module run.
returned: success
type: list
sample: ["awscli", "ag"]
version_added: '0.2.0'
changed_pkgs:
description:
- List of package names which are changed after module run
returned: success
type: list
sample: ['git', 'git-cola']
version_added: '0.2.0'
'''
description:
- List of package names which are changed after module run.
returned: success
type: list
sample: ['git', 'git-cola']
version_added: '0.2.0'
"""
import json
import re