Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 8, 2021
1 parent ed41903 commit bf43448
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/ansiblelint/file_utils.py
Expand Up @@ -206,15 +206,24 @@ def __repr__(self) -> str:
def discover_lintables(options: Namespace) -> Dict[str, Any]:
"""Find all files that we know how to lint."""
# git is preferred as it also considers .gitignore
git_command_present = ['git', 'ls-files', '--cached', '--others', '--exclude-standard', '-z']
git_command_present = [
'git',
'ls-files',
'--cached',
'--others',
'--exclude-standard',
'-z',
]
git_command_absent = ['git', 'ls-files', '--deleted', '-z']
out = None

try:
out_present = subprocess.check_output(
git_command_present, stderr=subprocess.STDOUT, universal_newlines=True
).split("\x00")[:-1]
_logger.info("Discovered files to lint using: %s", ' '.join(git_command_present))
_logger.info(
"Discovered files to lint using: %s", ' '.join(git_command_present)
)

out_absent = subprocess.check_output(
git_command_absent, stderr=subprocess.STDOUT, universal_newlines=True
Expand Down

0 comments on commit bf43448

Please sign in to comment.