objectionary / objectionary/lints

Discrepancy between rule descriptions and implementations in `comment-without-dot`, `incorrect-version`, and `not-empty-atom` lints

Open
#1,384 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good-title
Dominant language
Java
Stars
14
Forks
39
Avg merge
22h 54m
Merged PRs (30d)
90

Description

Problem

In three lints the defect text promises a rule that the XPath condition does not implement (or vice versa).

1. comment-without-dot — text allows :, condition does not

src/main/resources/org/eolang/lints/comments/comment-without-dot.xsl:27:

"The comment for the object doesn't end with a dot (or '?', '!', ':')"

but the condition (:13) only checks ., ?, !:

<xsl:for-each select="/object/comments/comment[not(ends-with(., '.')) and not(ends-with(., '?')) and not(ends-with(., '!'))]">

A comment ending with : is flagged although the message explicitly permits it.

2. incorrect-version — text promises strict SemVer, regex allows -SNAPSHOT

src/main/resources/org/eolang/lints/metas/incorrect-version.xsl:16 (regex) vs :32 (message "SemVer expected"). The regex additionally accepts 1.0-SNAPSHOT, which is not a SemVer version — a user is told SemVer is required, but a non-SemVer value passes.

3. not-empty-atom — message lists void attributes the rule excludes

src/main/resources/org/eolang/lints/atoms/not-empty-atom.xsl:31 builds the message from o[@base and not(@name='λ')] (which includes void attributes @base='∅'), while the selector (:14) excludes them (@base!='∅'). For an atom with both a void and a non-void attribute, the message names the void attribute as the violation.

Expected behavior

Each lint's message and its condition must describe the same rule (align the condition with the text, or vice versa), and add packs for the boundary cases.

Related

  • funcs/escape.xsl — used by these lints to quote names in messages.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the three mentioned XSL files: src/main/resources/org/eolang/lints/comments/comment-without-dot.xsl, metas/incorrect-version.xsl, and atoms/not-empty-atom.xsl. Compare each selector or regex with its defect message, and review funcs/escape.xsl where message names are quoted. Add packs covering the colon, SNAPSHOT, and void-attribute boundaries; done means each condition and message describe the same rule.

Written by the indexing model from the issue text.

Assessment

Tech stack
xml
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.