Collect skip comments only for entities we calculate line numbers for
@@ -112,7 +112,8 @@ class BaseContextParser(ABC):
if not found:
continue
for (skip_check_line_num, skip_check) in comments:
- if entity_context["start_line"] < skip_check_line_num < entity_context["end_line"]:
+ if "start_line" in entity_context and "end_line" in entity_context \
+ and entity_context["start_line"] < skip_check_line_num < entity_context["end_line"]:
# No matter which ID was used to skip, save the pair of IDs in the appropriate fields
if bc_id_mapping and skip_check["id"] in bc_id_mapping:
skip_check["bc_id"] = skip_check["id"]
