Incorrect alphabetical ordering of `+alias` metas due to short name sorting by parser
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- java, xml
- Domain
- testing-qa, tooling
Research direction
Start with src/main/resources/org/eolang/lints/metas/unsorted-metas.xsl lines 14–17 and compare its ordering key with the source spelling of +alias metas; the parser expands alias tails before the lint sees them. Add the two packs described in the issue beside the existing packs under src/test/resources/org/eolang/lints/packs/single/unsorted-metas/, then run LtByXslTest#checksAllLints. Done means the sorted example has no defect and the swapped example warns on line 2.
Written by the indexing model from the issue text.
Description
Bug
src/main/resources/org/eolang/lints/metas/unsorted-metas.xsl (lines 14-17) compares concat(head, ' ', tail) of each meta with the previous one. For +alias the parser has already expanded the tail: +alias org.eolang.txt.sprintf arrives as tail sprintf Φ.org.eolang.txt.sprintf. So the lint orders aliases by their last segment (sprintf, stdout), not by what is written in the source. The motive (motives/metas/unsorted-metas.md) says "Metas must be alphabetically ordered" and its example orders aliases by the name as written.
Steps to reproduce
+alias org.eolang.io.stdout
+alias org.eolang.txt.sprintf
[] > foo
42 > @
and the same program with the two aliases swapped.
Actual result
The sorted program gets:
<defect line="2" severity="warning">The "alias⌴sprintf⌴Φ.org.eolang.txt.sprintf" meta is out of order</defect>
The swapped program (org.eolang.txt.sprintf before org.eolang.io.stdout), which is really out of order, gets no defects.
Expected result
No defect for the first program, and a warning on line 2 for the second one, as for +alias org.eolang.io.stdout before +alias org.eolang.io.stdin in the motive.
Test
Two packs next to the existing ones in src/test/resources/org/eolang/lints/packs/single/unsorted-metas/ fail on master 46a7315 in LtByXslTest#checksAllLints:
# SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com
# SPDX-License-Identifier: MIT
---
sheets:
- /org/eolang/lints/metas/unsorted-metas.xsl
defects: 0
input: |
+alias org.eolang.io.stdout
+alias org.eolang.txt.sprintf
[] > foo
42 > @
# SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com
# SPDX-License-Identifier: MIT
---
sheets:
- /org/eolang/lints/metas/unsorted-metas.xsl
defects:
- severity: warning
line: 2
input: |
+alias org.eolang.txt.sprintf
+alias org.eolang.io.stdout
[] > foo
42 > @
FAIL: /defects[count(defect)=0]
FAIL: /defects[count(defect)=1]
FAIL: /defects/defect[@severity='warning' and @line='2']
This is not #1391 (an out-of-order meta compared with the first meta instead of its neighbour): here neighbours are compared, but by the expanded text.
- Dominant language
- Java
- Stars
- 14
- Forks
- 40
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 68
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
-
LtByXsl throws NoSuchElementException when defect element has no text contentPossibly taken @opusstudiohq-max claimed this 4 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
objectionary/lints#1640 · 1 comment ·
Maintainers usually reply within 1 day
-
No public way to list the names of the lints, so a caller cannot tell a typo from a real namePossibly taken @yegor256 claimed this 1 day ago. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
objectionary/lints#1614 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
`unit-test-is-not-verb` incorrectly rejects valid verb test names in `Vocabulary.isVerb`Possibly taken @Thayorns claimed this 26 days ago. Openbug good-title
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/lints#1533 · 1 comment ·
Maintainers usually reply within 1 day
-
OpenAI key exposed to third-party action during the titles workflow of issue openingMay be free again @yegor256 claimed this 40 days ago, and no pull request is open. Openenhancement good-title
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
objectionary/lints#1495 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
CI workflows not pinned to immutable release tags or commit SHAs causing irreproducible CI failuresPossibly taken @gemshrine claimed this 39 days ago. Openenhancement good-title
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
objectionary/lints#1480 · 1 comment ·
Maintainers usually reply within 1 day
All issues in objectionary/lints
Similar issues
-
Document and enforce pull request review guidelinesPossibly taken @dashorst claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
`Time.at(t, in: nil)` returns UTC instead of the local time (or the time zone of `t`), unlike CRubyOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
hermes-queue
Difficulty 1/5 Under an hour Newbie friendliness 72/100
chrisalunlloyd2-sudo/mindpalace#349 ·
Maintainers usually reply within 1 day
-
Retry-After parser accepts invalid delay-seconds valuesPossibly taken @Dhruvraj-Rana claimed this today. OpenBug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
open-telemetry/opentelemetry-java#9018 ·
Maintainers usually reply within 2 days
-
bug priority: medium Review effort [1-5]: 2 status: needs-triage type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
carlos-emr/carlos#5818 ·
Maintainers usually reply within 1 day