1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 03:12:20 +01:00

Auto-Generate esphome.h (#538)

This commit is contained in:
Otto Winter
2019-05-10 22:13:26 +02:00
committed by GitHub
parent 953d7f6193
commit 7bab279c6a
3 changed files with 14 additions and 6 deletions

View File

@@ -53,6 +53,13 @@ for f in files:
if content and not content.endswith('\n'):
errors[f].append("File does not end with a newline, please add an empty line at the end of "
"the file.")
_, ext = os.path.splitext(f)
if ext in ('.h', '.c', '.cpp', '.tcc'):
for line, col in find_all(content, '"esphome.h"'):
errors[f].append("File contains reference to 'esphome.h' - This file is "
"auto-generated and should only be used for *custom* "
"components. Please replace with references to the direct "
"files.")
for f, errs in errors.items():
print("\033[0;32m************* File \033[1;32m{}\033[0m".format(f))