mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 10:29:27 +00:00
Add 'do not edit' comment to generated files (#103923)
This commit is contained in:
committed by
GitHub
parent
7ab4d9793a
commit
1610dd94f9
@@ -182,6 +182,10 @@ get-mac==1000000000.0.0
|
||||
charset-normalizer==3.2.0
|
||||
"""
|
||||
|
||||
GENERATED_MESSAGE = (
|
||||
f"# Automatically generated by {Path(__file__).name}, do not edit\n\n"
|
||||
)
|
||||
|
||||
IGNORE_PRE_COMMIT_HOOK_ID = (
|
||||
"check-executables-have-shebangs",
|
||||
"check-json",
|
||||
@@ -354,6 +358,7 @@ def generate_requirements_list(reqs: dict[str, list[str]]) -> str:
|
||||
def requirements_output() -> str:
|
||||
"""Generate output for requirements."""
|
||||
output = [
|
||||
GENERATED_MESSAGE,
|
||||
"-c homeassistant/package_constraints.txt\n",
|
||||
"\n",
|
||||
"# Home Assistant Core\n",
|
||||
@@ -368,6 +373,7 @@ def requirements_all_output(reqs: dict[str, list[str]]) -> str:
|
||||
"""Generate output for requirements_all."""
|
||||
output = [
|
||||
"# Home Assistant Core, full dependency set\n",
|
||||
GENERATED_MESSAGE,
|
||||
"-r requirements.txt\n",
|
||||
]
|
||||
output.append(generate_requirements_list(reqs))
|
||||
@@ -379,8 +385,7 @@ def requirements_test_all_output(reqs: dict[str, list[str]]) -> str:
|
||||
"""Generate output for test_requirements."""
|
||||
output = [
|
||||
"# Home Assistant tests, full dependency set\n",
|
||||
f"# Automatically generated by {Path(__file__).name}, do not edit\n",
|
||||
"\n",
|
||||
GENERATED_MESSAGE,
|
||||
"-r requirements_test.txt\n",
|
||||
]
|
||||
|
||||
@@ -425,7 +430,8 @@ def requirements_pre_commit_output() -> str:
|
||||
def gather_constraints() -> str:
|
||||
"""Construct output for constraint file."""
|
||||
return (
|
||||
"\n".join(
|
||||
GENERATED_MESSAGE
|
||||
+ "\n".join(
|
||||
sorted(
|
||||
{
|
||||
*core_requirements(),
|
||||
|
||||
Reference in New Issue
Block a user