Skip to content

Commit 0c70fa4

Browse files
committed
Use asottile/add-trailing-comma
1 parent 1a07a24 commit 0c70fa4

32 files changed

+74
-70
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@
2121
hooks:
2222
- id: reorder-python-imports
2323
language_version: python2.7
24+
- repo: https://github.com/asottile/add-trailing-comma
25+
sha: v0.3.0
26+
hooks:
27+
- id: add-trailing-comma

pre_commit/color_windows.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ def bool_errcheck(result, func, args):
2020

2121
GetStdHandle = WINFUNCTYPE(HANDLE, DWORD)(
2222
("GetStdHandle", windll.kernel32),
23-
((1, "nStdHandle"), )
23+
((1, "nStdHandle"), ),
2424
)
2525

2626
GetConsoleMode = WINFUNCTYPE(BOOL, HANDLE, POINTER(DWORD))(
2727
("GetConsoleMode", windll.kernel32),
28-
((1, "hConsoleHandle"), (2, "lpMode"))
28+
((1, "hConsoleHandle"), (2, "lpMode")),
2929
)
3030
GetConsoleMode.errcheck = bool_errcheck
3131

3232
SetConsoleMode = WINFUNCTYPE(BOOL, HANDLE, DWORD)(
3333
("SetConsoleMode", windll.kernel32),
34-
((1, "hConsoleHandle"), (1, "dwMode"))
34+
((1, "hConsoleHandle"), (1, "dwMode")),
3535
)
3636
SetConsoleMode.errcheck = bool_errcheck
3737

pre_commit/commands/autoupdate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _update_repo(repo_config, runner, tags_only):
5959
if hooks_missing:
6060
raise RepositoryCannotBeUpdatedError(
6161
'Cannot update because the tip of master is missing these hooks:\n'
62-
'{}'.format(', '.join(sorted(hooks_missing)))
62+
'{}'.format(', '.join(sorted(hooks_missing))),
6363
)
6464

6565
return new_config

pre_commit/commands/install_uninstall.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def install(
5151
'Running in migration mode with existing hooks at {}\n'
5252
'Use -f to use only pre-commit.'.format(
5353
legacy_path,
54-
)
54+
),
5555
)
5656

5757
with io.open(hook_path, 'w') as pre_commit_file_obj:

pre_commit/commands/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def run(runner, args, environ=os.environ):
235235
logger.error(
236236
'Your .pre-commit-config.yaml is unstaged.\n'
237237
'`git add .pre-commit-config.yaml` to fix this.\n'
238-
'Run pre-commit with --allow-unstaged-config to silence this.'
238+
'Run pre-commit with --allow-unstaged-config to silence this.',
239239
)
240240
return 1
241241

pre_commit/git.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def get_root():
2121
except CalledProcessError:
2222
raise FatalError(
2323
'git failed. Is it installed, and are you in a Git repository '
24-
'directory?'
24+
'directory?',
2525
)
2626

2727

@@ -79,7 +79,7 @@ def get_staged_files():
7979
return cmd_output(
8080
'git', 'diff', '--staged', '--name-only', '--no-ext-diff',
8181
# Everything except for D
82-
'--diff-filter=ACMRTUXB'
82+
'--diff-filter=ACMRTUXB',
8383
)[1].splitlines()
8484

8585

@@ -130,5 +130,5 @@ def check_for_cygwin_mismatch():
130130
' - git {}\n'.format(
131131
exe_type[is_cygwin_python],
132132
exe_type[is_cygwin_git],
133-
)
133+
),
134134
)

pre_commit/languages/docker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def md5(s): # pragma: windows no cover
2323

2424
def docker_tag(repo_cmd_runner): # pragma: windows no cover
2525
return 'pre-commit-{}'.format(
26-
md5(os.path.basename(repo_cmd_runner.path()))
26+
md5(os.path.basename(repo_cmd_runner.path())),
2727
).lower()
2828

2929

@@ -92,7 +92,7 @@ def run_hook(repo_cmd_runner, hook, file_args): # pragma: windows no cover
9292
'-v', '{}:/src:rw'.format(os.getcwd()),
9393
'--workdir', '/src',
9494
'--entrypoint', entry_executable,
95-
docker_tag(repo_cmd_runner)
95+
docker_tag(repo_cmd_runner),
9696
) + cmd_rest
9797

9898
return xargs(cmd, file_args)

pre_commit/languages/python.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def install_environment(repo_cmd_runner, version, additional_dependencies):
107107
with clean_path_on_failure(repo_cmd_runner.path(directory)):
108108
venv_cmd = [
109109
sys.executable, '-m', 'virtualenv',
110-
'{{prefix}}{}'.format(directory)
110+
'{{prefix}}{}'.format(directory),
111111
]
112112
if version != 'default':
113113
venv_cmd.extend(['-p', norm_version(version)])

pre_commit/languages/ruby.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def _install_rbenv(
8181
# directory
8282
"export GEM_HOME='{directory}/gems'\n"
8383
'export PATH="$GEM_HOME/bin:$PATH"\n'
84-
'\n'.format(directory=repo_cmd_runner.path(directory))
84+
'\n'.format(directory=repo_cmd_runner.path(directory)),
8585
)
8686

8787
# If we aren't using the system ruby, add a version here

pre_commit/logging_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def emit(self, record):
3030
self.use_color,
3131
) + ' ',
3232
record.getMessage(),
33-
)
33+
),
3434
)
3535

3636

0 commit comments

Comments
 (0)