Use pre-commit with black + yamllint

* Added pre-commit config
  * Added yamllint config
  * Updated example YAML files to match the yamllint config
  * black'd existing Python code
This commit is contained in:
Emmanuel BENOîT 2022-09-18 17:32:23 +02:00
parent 7ea55e277e
commit 4a56566c58
No known key found for this signature in database
GPG key ID: 2356DC6956CF54EF
6 changed files with 100 additions and 34 deletions
inventory_plugins

View file

@ -893,11 +893,7 @@ class RciBlock(RcInstruction):
output.extend(" " + s for s in instr.dump())
def parse_action(self, record):
assert (
self._block is None
and self._rescue is None
and self._always is None
)
assert self._block is None and self._rescue is None and self._always is None
if "block" not in record:
raise AnsibleParserError("%s: missing 'block' field" % (self._action,))
self._block = self.parse_block(record, "block")
@ -938,11 +934,7 @@ class RciBlock(RcInstruction):
return instructions
def execute_action(self, host_name, variables):
assert not (
self._block is None
or self._rescue is None
or self._always is None
)
assert not (self._block is None or self._rescue is None or self._always is None)
try:
try:
self._display.vvv("- running 'block' instructions")