mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-13 20:40:08 -06:00
Merge pull request #678 from revolter/hotfix/replace-with-constants
Replace string literals with constants
This commit is contained in:
@@ -223,8 +223,8 @@ def run(runner, args, environ=os.environ):
|
||||
return 1
|
||||
if _has_unstaged_config(runner) and not no_stash:
|
||||
logger.error(
|
||||
'Your .pre-commit-config.yaml is unstaged.\n'
|
||||
'`git add .pre-commit-config.yaml` to fix this.',
|
||||
'Your pre-commit configuration is unstaged.\n'
|
||||
'`git add {}` to fix this.'.format(runner.config_file),
|
||||
)
|
||||
return 1
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ def _add_color_option(parser):
|
||||
|
||||
def _add_config_option(parser):
|
||||
parser.add_argument(
|
||||
'-c', '--config', default='.pre-commit-config.yaml',
|
||||
'-c', '--config', default=C.CONFIG_FILE,
|
||||
help='Path to alternate config file',
|
||||
)
|
||||
|
||||
|
||||
@@ -269,14 +269,14 @@ class MetaRepository(LocalRepository):
|
||||
{
|
||||
'id': 'check-hooks-apply',
|
||||
'name': 'Check hooks apply to the repository',
|
||||
'files': '.pre-commit-config.yaml',
|
||||
'files': C.CONFIG_FILE,
|
||||
'language': 'system',
|
||||
'entry': _make_entry(check_hooks_apply),
|
||||
},
|
||||
{
|
||||
'id': 'check-useless-excludes',
|
||||
'name': 'Check for useless excludes',
|
||||
'files': '.pre-commit-config.yaml',
|
||||
'files': C.CONFIG_FILE,
|
||||
'language': 'system',
|
||||
'entry': _make_entry(check_useless_excludes),
|
||||
},
|
||||
|
||||
@@ -47,7 +47,7 @@ def modify_manifest(path):
|
||||
with io.open(manifest_path, 'w') as manifest_file:
|
||||
manifest_file.write(ordered_dump(manifest, **C.YAML_DUMP_KWARGS))
|
||||
cmd_output(
|
||||
'git', 'commit', '-am', 'update .pre-commit-hooks.yaml', cwd=path,
|
||||
'git', 'commit', '-am', 'update {}'.format(C.MANIFEST_FILE), cwd=path,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -683,7 +683,7 @@ def test_error_with_unstaged_config(
|
||||
):
|
||||
args = run_opts()
|
||||
ret, printed = _do_run(cap_out, modified_config_repo, args)
|
||||
assert b'Your .pre-commit-config.yaml is unstaged.' in printed
|
||||
assert b'Your pre-commit configuration is unstaged.' in printed
|
||||
assert ret == 1
|
||||
|
||||
|
||||
@@ -695,7 +695,7 @@ def test_no_unstaged_error_with_all_files_or_files(
|
||||
):
|
||||
args = run_opts(**opts)
|
||||
ret, printed = _do_run(cap_out, modified_config_repo, args)
|
||||
assert b'Your .pre-commit-config.yaml is unstaged.' not in printed
|
||||
assert b'Your pre-commit configuration is unstaged.' not in printed
|
||||
|
||||
|
||||
def test_files_running_subdir(
|
||||
|
||||
Reference in New Issue
Block a user