From 3bd2039cdddb9a945d1acbf22410852b9605d5e4 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 2 Sep 2026 06:20:47 +0000 Subject: [PATCH 1/2] fix(#1336): report exact physical line of too-wide line in multi-line comments comment-is-too-wide.xsl now computes each offending line's real line number as the comment's start @line plus its offset within the tokenized text, instead of always reporting the comment block's start line. This also removes the duplicated multi-line/single-line branches in favor of one loop. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01BtgvknNrK4TEQvMPqP7E7p --- .../lints/comments/comment-is-too-wide.xsl | 90 ++++++++----------- .../catches-multiline-wide-comment.yaml | 2 +- 2 files changed, 37 insertions(+), 55 deletions(-) diff --git a/src/main/resources/org/eolang/lints/comments/comment-is-too-wide.xsl b/src/main/resources/org/eolang/lints/comments/comment-is-too-wide.xsl index 95d1498aa..0802be338 100644 --- a/src/main/resources/org/eolang/lints/comments/comment-is-too-wide.xsl +++ b/src/main/resources/org/eolang/lints/comments/comment-is-too-wide.xsl @@ -7,67 +7,49 @@ - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - warning - - The comment line width is - - , while - - is max allowed - - - - - - - - - - - - - - - - warning - - The comment width is - - , while - - is max allowed - - - - + + + warning + + + + The comment line width is + + + The comment width is + + + + , while + + is max allowed + + + diff --git a/src/test/resources/org/eolang/lints/packs/single/comment-is-too-wide/catches-multiline-wide-comment.yaml b/src/test/resources/org/eolang/lints/packs/single/comment-is-too-wide/catches-multiline-wide-comment.yaml index c4edddc7e..4a8f6c35a 100644 --- a/src/test/resources/org/eolang/lints/packs/single/comment-is-too-wide/catches-multiline-wide-comment.yaml +++ b/src/test/resources/org/eolang/lints/packs/single/comment-is-too-wide/catches-multiline-wide-comment.yaml @@ -6,7 +6,7 @@ sheets: - /org/eolang/lints/comments/comment-is-too-wide.xsl asserts: - /defects[count(defect[@severity='warning'])=1] - - /defects/defect[@line='1'] + - /defects/defect[@line='2'] input: | # This is good line. # This is a very long line that contains more than 100 characters and should be flagged by the lint as too wide. From f64784c8a683f59a876110e5c6ef9fe7ec82392a Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 2 Sep 2026 06:36:16 +0000 Subject: [PATCH 2/2] fix(#1336): use shared eo:lineno helper and preserve comment node for defect-context Address Copilot review feedback on PR #1339: use the shared eo:lineno(@line) helper (consistent with comment-too-short.xsl and others) instead of a manual '0'-fallback that doesn't guard against a non-numeric @line, and pass the original node to eo:defect-context instead of the tokenized line string so the serialized context stays consistent with other lints. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01BtgvknNrK4TEQvMPqP7E7p --- .../org/eolang/lints/comments/comment-is-too-wide.xsl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/resources/org/eolang/lints/comments/comment-is-too-wide.xsl b/src/main/resources/org/eolang/lints/comments/comment-is-too-wide.xsl index 0802be338..f3e7d0658 100644 --- a/src/main/resources/org/eolang/lints/comments/comment-is-too-wide.xsl +++ b/src/main/resources/org/eolang/lints/comments/comment-is-too-wide.xsl @@ -11,7 +11,8 @@ - + + @@ -29,7 +30,7 @@ - +