Rename status entries have "source -> target" as the filename. Parse
that and run pylint on the target.
---
scripts/githooks/pre-commit | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/scripts/githooks/pre-commit b/scripts/githooks/pre-commit
index ec143f3..501a9c3 100755
--- a/scripts/githooks/pre-commit
+++ b/scripts/githooks/pre-commit
@@ -42,6 +42,11 @@ for gf in git_files.splitlines():
# If the file is being removed or is not in git, ignore it
if gf[0] in ('D', '?'):
continue
+ # If the file is being renamed, grab the target filename
+ if gf[0] == 'R':
+ target = gf[3:].split(' -> ')[1]
+ if is_python(target):
+ pylint_files.append(target)
elif is_python(gf[3:]):
# If the file is unmerged or changed locally, raise an error
if gf[0] == 'U' or gf[1] in ('U', 'M'):
--
1.8.4.2
Show replies by date
Rename status entries have "source -> target" as the
filename. Parse
that and run pylint on the target.
---
scripts/githooks/pre-commit | 5 +++++
1 file changed, 5 insertions(+)
Good idea.
- Chris