Trim comments

This commit is contained in:
J. Nick Koston
2026-08-22 23:57:52 -05:00
parent 6818ce0dac
commit 9d6c77e8c2
2 changed files with 5 additions and 11 deletions
+1 -2
View File
@@ -341,8 +341,7 @@ def copy_src_tree():
existing.get("config_hash") != config_hash
or existing.get("esphome_version") != __version__
):
# Valid JSON that is not an object (truncated or
# hand-edited) is stale like every other damage case
# Non-object JSON is stale like every other damage case
sources_changed = True
except (json.JSONDecodeError, OSError):
sources_changed = True
+4 -9
View File
@@ -2072,8 +2072,7 @@ def test_copy_src_tree_detects_config_hash_change(
)
)
# Create both existing build_info sources so the staleness decision
# reaches the JSON comparison instead of the missing-file branch
# Both sources must exist to reach the JSON comparison branch
build_info_h_path = esphome_core_path / "build_info_data.h"
build_info_h_path.write_text("// old build_info_data.h")
(esphome_core_path / "build_info_data.cpp").write_text("// old")
@@ -2138,8 +2137,7 @@ def test_copy_src_tree_detects_version_change(
)
)
# Create both existing build_info sources so the staleness decision
# reaches the JSON comparison instead of the missing-file branch
# Both sources must exist to reach the JSON comparison branch
build_info_h_path = esphome_core_path / "build_info_data.h"
build_info_h_path.write_text("// old build_info_data.h")
(esphome_core_path / "build_info_data.cpp").write_text("// old")
@@ -2190,8 +2188,7 @@ def test_copy_src_tree_handles_invalid_build_info_json(
build_info_json_path = build_path / "build_info.json"
build_info_json_path.write_text("invalid json {{{")
# Create both existing build_info sources so the staleness decision
# reaches the JSON comparison instead of the missing-file branch
# Both sources must exist to reach the JSON comparison branch
build_info_h_path = esphome_core_path / "build_info_data.h"
build_info_h_path.write_text("// old build_info_data.h")
(esphome_core_path / "build_info_data.cpp").write_text("// old")
@@ -2238,12 +2235,10 @@ def test_copy_src_tree_handles_non_dict_build_info_json(
build_path = tmp_path / "build"
build_path.mkdir()
# Valid JSON that is not an object: no .get, must read as stale
build_info_json_path = build_path / "build_info.json"
build_info_json_path.write_text("[]")
# Create both existing build_info sources so the staleness decision
# reaches the JSON comparison instead of the missing-file branch
# Both sources must exist to reach the JSON comparison branch
build_info_h_path = esphome_core_path / "build_info_data.h"
build_info_h_path.write_text("// old build_info_data.h")
(esphome_core_path / "build_info_data.cpp").write_text("// old")