mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
Remove legacy 'hooks.yaml' file support
This commit is contained in:
parent
7aeb4fe0f7
commit
86d9ca053b
8 changed files with 3 additions and 76 deletions
|
|
@ -3,10 +3,7 @@ from __future__ import unicode_literals
|
|||
import pkg_resources
|
||||
|
||||
CONFIG_FILE = '.pre-commit-config.yaml'
|
||||
|
||||
# In 0.12.0, the default file was changed to be namespaced
|
||||
MANIFEST_FILE = '.pre-commit-hooks.yaml'
|
||||
MANIFEST_FILE_LEGACY = 'hooks.yaml'
|
||||
|
||||
YAML_DUMP_KWARGS = {
|
||||
'default_flow_style': False,
|
||||
|
|
|
|||
|
|
@ -20,22 +20,7 @@ class Manifest(object):
|
|||
|
||||
@cached_property
|
||||
def manifest_contents(self):
|
||||
default_path = os.path.join(self.repo_path, C.MANIFEST_FILE)
|
||||
legacy_path = os.path.join(self.repo_path, C.MANIFEST_FILE_LEGACY)
|
||||
if os.path.exists(legacy_path) and not os.path.exists(default_path):
|
||||
logger.warning(
|
||||
'{} uses legacy {} to provide hooks.\n'
|
||||
'In newer versions, this file is called {}\n'
|
||||
'This will work in this version of pre-commit but will be '
|
||||
'removed at a later time.\n'
|
||||
'If `pre-commit autoupdate` does not silence this warning '
|
||||
'consider making an issue / pull request.'.format(
|
||||
self.repo_url, C.MANIFEST_FILE_LEGACY, C.MANIFEST_FILE,
|
||||
),
|
||||
)
|
||||
return load_manifest(legacy_path)
|
||||
else:
|
||||
return load_manifest(default_path)
|
||||
return load_manifest(os.path.join(self.repo_path, C.MANIFEST_FILE))
|
||||
|
||||
@cached_property
|
||||
def hooks(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue