mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Fixing bug with local hooks that disappeared during autoupdate
This commit is contained in:
parent
2a642b0619
commit
3c02a24655
3 changed files with 27 additions and 3 deletions
|
|
@ -68,9 +68,11 @@ def make_config_from_repo(repo_path, sha=None, hooks=None, check=True):
|
|||
|
||||
|
||||
def write_config(directory, config):
|
||||
assert type(config) is OrderedDict
|
||||
if type(config) is not list:
|
||||
assert type(config) is OrderedDict
|
||||
config = [config]
|
||||
with io.open(os.path.join(directory, C.CONFIG_FILE), 'w') as config_file:
|
||||
config_file.write(ordered_dump([config], **C.YAML_DUMP_KWARGS))
|
||||
config_file.write(ordered_dump(config, **C.YAML_DUMP_KWARGS))
|
||||
|
||||
|
||||
def add_config_to_repo(git_path, config):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue