`comment-is-too-wide` splits a comment at a literal `\n`, so it reports a wrong line or misses a wide one
Maintainers usually reply within 2 days
@StanislavKozachenko is already working on this.
Since Oct 28, 2026.
- #1605 by @StanislavKozachenko — open
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start at comment-is-too-wide.xsl:15 and compare the current tokenize(replace(...)) expression with the expected tokenize(., ' ') behavior described in the issue. Reproduce with the provided EO examples and new Source(new EoSyntax(new InputOf(path)).parsed()).defects(). Done when both examples report the expected line and width.
Written by the indexing model from the issue text.
Description
comment-is-too-wide.xsl:15 splits a comment into lines like this:
<xsl:variable name="lines" select="tokenize(replace(., '\\n', ' '), ' ')"/>
The regex \\n matches a backslash followed by n, that is the two characters \n written in the text of the comment. The parser already puts real line breaks into <comment>, so this replace() only adds a line break where a comment mentions \n, which is common in comments about strings (e.g. eol.eo in the EO runtime: On UNIX systems, it returns "\n"). As a result, the lint reports a wrong line or misses a wide line.
Steps to reproduce
On master 8c3474dc6eb341cb4968c8dd299ca2b0dba151c0, run the lints on this program:
# Joins the parts with the "\n" separator.
# This is a very long line that contains more than 100 characters and should be flagged by the lint as too wide.
+architect [email protected]
+home https://github.com/objectionary/eo
+package com.example
+spdx SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com
+spdx SPDX-License-Identifier: MIT
+version 0.0.0
[x] > foo
x > @
[] +> can-return-its-argument
eq. > @
foo 42
42
new Source(new EoSyntax(new InputOf(path)).parsed()).defects();
and on the same program with the two comment lines replaced by a single one:
# Prints the "Hello,\nWorld!" text to the standard output, and this comment line is wider than one hundred chars.
Actual result
For the first program:
[comment-is-too-wide/S WARNING]:3 The comment line width is 110, while 100 is max allowed
Line 3 is empty; the wide line is line 2. With "|" instead of "\n" in the first comment line, the same defect is reported at :2.
For the second program there is no comment-is-too-wide defect at all, although the comment line is 111 characters wide.
Expected result
[comment-is-too-wide/S WARNING]:2 The comment line width is 110, while 100 is max allowed
for the first program, and
[comment-is-too-wide/S WARNING]:1 The comment width is 111, while 100 is max allowed
for the second one. This is what the lint reports when the comment is split only at real line breaks, i.e. with tokenize(., ' ').
- Dominant language
- Java
- Stars
- 14
- Forks
- 41
- Avg merge
- 3d 12m
- Merged PRs (30d)
- 32
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from objectionary/lints
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
objectionary/lints#1611 ·
Maintainers usually reply within 2 days
-
`invalid-name-notation` does not check a name bound with `>>`Possibly taken @StanislavKozachenko claimed this 1 day ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
objectionary/lints#1608 ·
Maintainers usually reply within 2 days
-
`unused-alias` reports an alias that is used only in the type of an atom or a voidPossibly taken @StanislavKozachenko claimed this 1 day ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
objectionary/lints#1607 ·
Maintainers usually reply within 2 days
-
`download-model` in `pom.xml` fetches `en-pos-perceptron.bin` from a dead URL, so a build without a warm `~/.m2` cache fails with 404Possibly taken @StanislavKozachenko claimed this 1 day ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
objectionary/lints#1599 ·
Maintainers usually reply within 2 days
-
README's "Running Locally" example prints `[mandatory-spdx/S WARNING]:1 ...`, but that defect is printed without a source linePossibly taken @gemshrine claimed this 2 days ago. Openbug
Difficulty 1/5 Under an hour Newbie friendliness 78/100
objectionary/lints#1598 ·
Maintainers usually reply within 2 days
All issues in objectionary/lints
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
snowflakedb/snowflake-kafka-connector#1610 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
swagger-api/swagger-petstore#245 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
liquid-java/liquidjava#443 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
quarkiverse/quarkus-google-cloud-services#1188 ·
Maintainers usually reply within 1 day