Skip to content

Report line number and source references for forbidden HTML tags - #18

Merged
otAAAh merged 1 commit into
mainfrom
error-log-improvement
May 5, 2026
Merged

Report line number and source references for forbidden HTML tags#18
otAAAh merged 1 commit into
mainfrom
error-log-improvement

Conversation

@otAAAh

@otAAAh otAAAh commented May 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Forbidden HTML tag errors now include the absolute file line number and the surrounding #: path:lineno source references, so translators can locate the offending string directly instead of grepping the file.
  • forbidden_tags() returns frozenset[ForbiddenTag(line, tag)]; remove_header() returns (body, header_line_count); new helpers source_references_at() and format_forbidden_tags_error() in portable_object.

Example new output:

Found forbidden HTML tags:
  line 2263: '</>' (cmk/gui/foo.py:123, cmk/gui/bar.py:456)

Test plan

  • pytest (14 tests, all pass; new coverage for source_references_at and format_forbidden_tags_error)
  • ruff check — clean
  • mypy --strict — clean

🤖 Generated with Claude Code

When the syncer encounters a forbidden HTML tag in a .po/.pot file, the
error message now includes the absolute file line number and the
surrounding `#: path:lineno` source references, so translators can locate
the offending string directly instead of grepping the file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@otAAAh
otAAAh requested a review from jherbel May 5, 2026 06:06
@otAAAh
otAAAh merged commit 096676e into main May 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants