Skip to content

#861: exclude λ marker from not-empty-atom lint#862

Merged
yegor256 merged 1 commit intoobjectionary:masterfrom
morphqdd:861
May 7, 2026
Merged

#861: exclude λ marker from not-empty-atom lint#862
yegor256 merged 1 commit intoobjectionary:masterfrom
morphqdd:861

Conversation

@morphqdd
Copy link
Copy Markdown
Contributor

@morphqdd morphqdd commented May 6, 2026

Closes #861.

The not-empty-atom lint (src/main/resources/org/eolang/lints/atoms/not-empty-atom.xsl) used to flag every atom whose λ marker carried a non-empty @base. After the restoration of the /name return-type syntax in objectionary/eo (objectionary/eo#4707), atoms like [] > times /number produce XMIR with <o base="number" name="λ"/>, which the previous XPath treated as a regular inner object. The fix adds not(@name='λ') to the predicate (mirroring the existing @name='xi🌵' exclusion) so that the λ marker is recognized as part of the atom syntax in both the outer match and the inner listing.

Tests:

  • New allows-atom-with-typed-lambda.yaml — atom with <o base="Φ.number" name="λ"/> → 0 defects (regression for the bug).
  • Updated catches-empty-atom.yaml and prints-context-when-lines-empty.yaml — they continue to assert that the lint fires when the atom has a real non-λ inner object alongside the (now valid) λ marker.

After this lint is released, objectionary/eo can bump the dependency in eo-maven-plugin/pom.xml and drop the +unlint not-empty-atom lines from the 22 affected .eo files in eo-runtime (puzzle 4707-ff431d75 / objectionary/eo#5091).

@morphqdd
Copy link
Copy Markdown
Contributor Author

morphqdd commented May 6, 2026

@yegor256, please take a look when you have a moment.

The CI failures on this PR (mvn on ubuntu/windows/macos and deep) are pre-existing on master — they are timeouts in PkByXslTest.doesNotDuplicateDefectsWhenMultipleDefectsOnTheSameLine and MonoLintsTest.lintsProgramCorrectly, both timing out after 45s. The same two tests fail with the same timeouts on the latest master mvn workflow run (https://github.com/objectionary/lints/actions/runs/25203927504) and on every master mvn run going back to at least April 26. They are unrelated to the changes in this PR. The targeted test for this fix (LtByXslTest) passes (358/358), and qulice is green.

@morphqdd
Copy link
Copy Markdown
Contributor Author

morphqdd commented May 6, 2026

@yegor256, a heads-up about how this fix reaches objectionary/eo:

objectionary/eo currently depends on lints 0.0.60 in eo-maven-plugin/pom.xml. The master branch here is at 1.0-SNAPSHOT with breaking API changes (e.g. org.eolang.lints.Program is gone, Tojos/Tojo and com.jcabi.log.Logger signatures changed), so simply releasing this PR onto master is not enough — bumping eo to 1.0 would require a separate, non-trivial migration of eo-maven-plugin.

To unblock objectionary/eo#5091 (removing +unlint not-empty-atom from 22 .eo files in eo-runtime), it would help to backport just the XSL change in this PR onto the 0.0.x line and release a 0.0.61 patch. Then eo can bump 0.0.600.0.61 without any source changes.

For reference, between the 0.0.60 tag and current master the four files touched here (not-empty-atom.xsl, catches-empty-atom.yaml, prints-context-when-lines-empty.yaml, atom-with-void-attr.yaml) only differ by the SPDX copyright year (20252026). No functional changes elsewhere in the lint, so a cherry-pick of this commit onto a 0.0.x branch should apply cleanly with at most a trivial copyright-year conflict.

@yegor256 yegor256 merged commit 9b4e3b4 into objectionary:master May 7, 2026
16 of 21 checks passed
@0crat
Copy link
Copy Markdown

0crat commented May 7, 2026

@morphqdd Thank you for your contribution! You've earned +12 points for this submission: +16 as the base reward, +1.15 for your 23 hits-of-code, but -4 points deducted for contributing fewer than 40 hits-of-code. Please keep them coming! Your running score is +236 - don't forget to check your Zerocracy account as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

not-empty-atom lint incorrectly flags atoms with λ marker having a non-empty @base attribute

3 participants