mirror of
https://github.com/thegeeklab/ansible-later.git
synced 2024-11-24 13:50:41 +00:00
fix: fix exclude_files while ignore_dotfiles is disabled (#678)
This commit is contained in:
parent
024af07c65
commit
e588c9469f
@ -210,9 +210,10 @@ class Settings:
|
|||||||
excludes = self.config["rules"]["exclude_files"]
|
excludes = self.config["rules"]["exclude_files"]
|
||||||
ignore_dotfiles = self.config["rules"]["ignore_dotfiles"]
|
ignore_dotfiles = self.config["rules"]["ignore_dotfiles"]
|
||||||
|
|
||||||
if ignore_dotfiles and not self.args_files:
|
if ignore_dotfiles:
|
||||||
excludes.append(".*")
|
excludes.append(".*")
|
||||||
else:
|
|
||||||
|
if self.args_files:
|
||||||
del excludes[:]
|
del excludes[:]
|
||||||
|
|
||||||
filelist = []
|
filelist = []
|
||||||
|
@ -537,7 +537,11 @@ def parse_yaml_linenumbers(data, filename):
|
|||||||
loader.compose_node = compose_node
|
loader.compose_node = compose_node
|
||||||
loader.construct_mapping = construct_mapping
|
loader.construct_mapping = construct_mapping
|
||||||
data = loader.get_single_data() or []
|
data = loader.get_single_data() or []
|
||||||
except (yaml.parser.ParserError, yaml.scanner.ScannerError) as e:
|
except (
|
||||||
|
yaml.parser.ParserError,
|
||||||
|
yaml.scanner.ScannerError,
|
||||||
|
yaml.constructor.ConstructorError,
|
||||||
|
) as e:
|
||||||
raise LaterError("syntax error", e) from e
|
raise LaterError("syntax error", e) from e
|
||||||
except (yaml.composer.ComposerError) as e:
|
except (yaml.composer.ComposerError) as e:
|
||||||
e.problem = f"{e.context} {e.problem}"
|
e.problem = f"{e.context} {e.problem}"
|
||||||
|
@ -13,4 +13,4 @@ Changes can be made in a YAML configuration file or via CLI options, which are p
|
|||||||
|
|
||||||
Please note that YAML attributes are overwritten while YAML lists are merged in any configuration files.
|
Please note that YAML attributes are overwritten while YAML lists are merged in any configuration files.
|
||||||
|
|
||||||
To simplify single file linting, e.g. for debugging purposes, ansible-later ignores the `exclude_files` and `ignore_dotfiles` options when only one file is passed to the CLI.
|
To simplify the linting of individual files, e.g. for debugging purposes, ansible-later ignores the `exclude_files` and `ignore_dotfiles` options when files are passed to the CLI.
|
||||||
|
Loading…
Reference in New Issue
Block a user