Skip to content

ascii-only lint false positive on newlines in multi-line XMIR comments #927

Description

@volodya-lombrozo

I cannot enable the ascii-only lint when my XMIR contains multi-line <comment> elements, because the lint incorrectly flags embedded newlines as non-ASCII violations.

The filter in LtAsciiOnly is:

.filter(chr -> chr < 32 || chr > 127)

The chr < 32 branch catches all ASCII control characters, including newlines (\n = 10), carriage returns (\r = 13), and tabs (\t = 9). But the parser legitimately embeds newlines inside <comment> elements when an EO comment spans multiple lines — those are perfectly valid ASCII characters and should not be reported.

The fix is to drop the chr < 32 half entirely and only flag true non-ASCII characters:

.filter(chr -> chr > 127)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions