Skip to content

Commit

Permalink
other codacy items fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
lovato committed Jul 11, 2018
1 parent 79d6ad8 commit 87ac8f4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion hooks4git/.codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ engines:
exclude_paths:
- config/engines.yml
exclude_paths:
- tests/**
- '**/tests/**'
9 changes: 4 additions & 5 deletions hooks4git/hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
# *****************************************************************************
# https://github.com/tartley/colorama/blob/83364bf1dc2bd5a53ca9bd0154fe21d769d6f90f/colorama/ansi.py
#
# THIS FILE WAS MODIFIED FROM ORIGINAL for Flake8 and Codacy passing only
# THIS FILE WAS MODIFIED FROM ORIGINAL for Flake8 and Codacy passing
#
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
'''
This module generates ANSI character codes to printing colors to terminals.
See: http://en.wikipedia.org/wiki/ANSI_escape_code
'''
#
# This module generates ANSI character codes to printing colors to terminals.
# See: http://en.wikipedia.org/wiki/ANSI_escape_code

CSI = '\033['
OSC = '\033]'
Expand Down
7 changes: 4 additions & 3 deletions hooks4git/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import shutil
import subprocess
from hooks4git import __version__
import ast

standalone_run = False

Expand Down Expand Up @@ -33,9 +34,9 @@ def query_yes_no(question, default="yes"):

if sys.version_info[:2] <= (2, 7):
# If this is Python 2, use raw_input()
get_input = eval('raw_input')
get_input = ast.literal_eval('raw_input')
else:
get_input = eval('input')
get_input = ast.literal_eval('input')

while True:
print('>>>> ' + question + prompt)
Expand Down Expand Up @@ -95,7 +96,7 @@ def add_hooks(path=os.environ["PWD"]):
git_path = system('git', '-C', path, 'rev-parse', '--git-dir')[1].replace('\n', '')
if git_path == '.git':
git_path = os.path.join(path, git_path)
except Exception as e: # noqa
except: # noqa
git_path = None

if git_path:
Expand Down

0 comments on commit 87ac8f4

Please sign in to comment.