npm: Validate all option types (#58965)
* Add type validation for name, version and registry * Add changelog fragment * Remove ignore of E337 and E338
This commit is contained in:
parent
fbb4eaaba9
commit
6f94995b52
3 changed files with 11 additions and 5 deletions
2
changelogs/fragments/58965-npm-validate-option-types.yml
Normal file
2
changelogs/fragments/58965-npm-validate-option-types.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- "npm - Validate that all passed options have proper types."
|
|
@ -26,14 +26,17 @@ options:
|
|||
name:
|
||||
description:
|
||||
- The name of a node.js library to install
|
||||
type: str
|
||||
required: false
|
||||
path:
|
||||
description:
|
||||
- The base path where to install the node.js libraries
|
||||
type: path
|
||||
required: false
|
||||
version:
|
||||
description:
|
||||
- The version to be installed
|
||||
type: str
|
||||
required: false
|
||||
global:
|
||||
description:
|
||||
|
@ -45,6 +48,7 @@ options:
|
|||
description:
|
||||
- The executable location for npm.
|
||||
- This is useful if you are using a version manager, such as nvm
|
||||
type: path
|
||||
required: false
|
||||
ignore_scripts:
|
||||
description:
|
||||
|
@ -75,11 +79,13 @@ options:
|
|||
description:
|
||||
- The registry to install modules from.
|
||||
required: false
|
||||
type: str
|
||||
version_added: "1.6"
|
||||
state:
|
||||
description:
|
||||
- The state of the node.js library
|
||||
required: false
|
||||
type: str
|
||||
default: present
|
||||
choices: [ "present", "absent", "latest" ]
|
||||
requirements:
|
||||
|
@ -241,12 +247,12 @@ class Npm(object):
|
|||
|
||||
def main():
|
||||
arg_spec = dict(
|
||||
name=dict(default=None),
|
||||
name=dict(default=None, type='str'),
|
||||
path=dict(default=None, type='path'),
|
||||
version=dict(default=None),
|
||||
version=dict(default=None, type='str'),
|
||||
production=dict(default='no', type='bool'),
|
||||
executable=dict(default=None, type='path'),
|
||||
registry=dict(default=None),
|
||||
registry=dict(default=None, type='str'),
|
||||
state=dict(default='present', choices=['present', 'absent', 'latest']),
|
||||
ignore_scripts=dict(default=False, type='bool'),
|
||||
unsafe_perm=dict(default=False, type='bool'),
|
||||
|
|
|
@ -3025,8 +3025,6 @@ lib/ansible/modules/packaging/language/gem.py E337
|
|||
lib/ansible/modules/packaging/language/maven_artifact.py E324
|
||||
lib/ansible/modules/packaging/language/maven_artifact.py E337
|
||||
lib/ansible/modules/packaging/language/maven_artifact.py E338
|
||||
lib/ansible/modules/packaging/language/npm.py E337
|
||||
lib/ansible/modules/packaging/language/npm.py E338
|
||||
lib/ansible/modules/packaging/language/pear.py E322
|
||||
lib/ansible/modules/packaging/language/pear.py E326
|
||||
lib/ansible/modules/packaging/language/pear.py E337
|
||||
|
|
Loading…
Reference in a new issue