Skip to content

Commit

Permalink
fix for #29 which does not trigger flake8 for removed files
Browse files Browse the repository at this point in the history
that is accomplished by using --diff-filter parameter in git diff (taken from http://stackoverflow.com/questions/6879501/filter-git-diff-by-type-of-change)

also this commit changes the log level from error to info when particular VCS is not found
  • Loading branch information
Miroslav Shubernetskiy committed Jul 26, 2015
1 parent 3e22f37 commit 25df445
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion flake8diff/flake8.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def get_vcs(self):
try:
vcs = vcs(self.commits, self.options)
except VCSNotInstalledError:
logger.error('Seems like {0} is not installed'.format(vcs.name))
logger.info('Seems like {0} is not installed'.format(vcs.name))
else:
if vcs.is_used() and vcs.check():
return vcs
Expand Down
3 changes: 2 additions & 1 deletion flake8diff/vcs/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_vcs(self):
"""
Get git binary executable path
"""
return _execute('which git', strict=True).strip()
return _execute('which git', strict=True, log_errors=False).strip()

def is_used(self):
"""
Expand Down Expand Up @@ -64,6 +64,7 @@ def changed_files(self):
self.vcs,
"diff",
"--name-only",
"--diff-filter=ACMRTUXB"
] + self.commits)

return filter(self.filter_file,
Expand Down
2 changes: 1 addition & 1 deletion flake8diff/vcs/hg.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_vcs(self):
"""
Get git binary executable path
"""
vcs = _execute('which hg', strict=True).strip()
vcs = _execute('which hg', strict=True, log_errors=False).strip()
return vcs

def is_used(self):
Expand Down

0 comments on commit 25df445

Please sign in to comment.