mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Add check-json to CI and Pre-commit (#29912)
* Add check-json to CI and Pre-commit * Add ignore pre-commit hooks to gen_requirements_all
This commit is contained in:
committed by
Paulus Schoutsen
parent
d1e59b20c8
commit
87ca61ddd7
@@ -65,6 +65,8 @@ enum34==1000000000.0.0
|
||||
pycrypto==1000000000.0.0
|
||||
"""
|
||||
|
||||
IGNORE_PRE_COMMIT_HOOK_ID = ("check-json",)
|
||||
|
||||
|
||||
def has_tests(module: str):
|
||||
"""Test if a module has tests.
|
||||
@@ -256,8 +258,9 @@ def requirements_pre_commit_output():
|
||||
reqs = []
|
||||
for repo in (x for x in pre_commit_conf["repos"] if x.get("rev")):
|
||||
for hook in repo["hooks"]:
|
||||
reqs.append(f"{hook['id']}=={repo['rev']}")
|
||||
reqs.extend(x for x in hook.get("additional_dependencies", ()))
|
||||
if hook["id"] not in IGNORE_PRE_COMMIT_HOOK_ID:
|
||||
reqs.append(f"{hook['id']}=={repo['rev']}")
|
||||
reqs.extend(x for x in hook.get("additional_dependencies", ()))
|
||||
output = [
|
||||
f"# Automatically generated "
|
||||
f"from {source} by {Path(__file__).name}, do not edit",
|
||||
|
||||
Reference in New Issue
Block a user