1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-01 10:52:19 +01:00

Add pre-commit hooks to fix common formatting issues causing CI failures (#9494)

This commit is contained in:
J. Nick Koston
2025-07-14 14:25:18 -10:00
committed by GitHub
parent 619e2d69c0
commit b2a8b0a22f
38 changed files with 12 additions and 39 deletions

View File

@@ -126,7 +126,8 @@ def write_file_content(path: Path, content: str) -> None:
def write_hash(hash_value: str) -> None:
"""Write hash to file"""
hash_file = Path(__file__).parent.parent / ".clang-tidy.hash"
write_file_content(hash_file, hash_value)
# Strip any trailing newlines to ensure consistent formatting
write_file_content(hash_file, hash_value.strip() + "\n")
def main() -> None: