objectionary / objectionary/lints

unique-metas emits a meaningless context (the meta head string) for duplicated metas

Open Beginner friendly
#1,378 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Problem

For duplicated metas, unique-metas emits a defect whose @context is the meta head string (e.g. "version") instead of the actual duplicate meta element — the context is useless for locating the second occurrence.

Root cause

src/main/resources/org/eolang/lints/metas/unique-metas.xsl:23-26 calls eo:defect-context(.) inside <xsl:for-each select="$unique">, where the context node is the string produced by the grouping ($unique is a string sequence), not an element. Verified: the resulting context attribute is [version].

Minimal example

+package x
+architect yegor@256.com
+version 0.0.1
+version 0.0.2
+home https://github.com/objectionary
+spdx SPDX-FileCopyrightText: Copyright (c) 2026 Objectionary.com
+spdx SPDX-License-Identifier: MIT

[] > main

The defect for the duplicate +version meta carries context="[version]" rather than the serialized second meta element.

Expected behavior

eo:defect-context should be computed from the actual duplicated meta element, e.g. $metas[head=$head][2], so the context shows the offending line's content.

Related

  • funcs/defect-context.xsl — the context serializer; used correctly by other lints (e.g. empty-alias).

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 src/main/resources/org/eolang/lints/metas/unique-metas.xsl:23-26 and inspect how the $unique sequence is used inside xsl:for-each. Compare the context handling with funcs/defect-context.xsl and the empty-alias lint. Use the minimal EO example to verify that the duplicate version defect context identifies the second meta element rather than showing [version].

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.