Conversation
Add the experimental design/misplaced-dataization warning. It fires on a Φ.dataized (both `x!` and `dataized x`) when the formation holding it is nested inside another formation of the same file and the target is a plain chain of attribute reads through ξ.ρ, with no application. Globals, literals, applications such as syscalls, top-level formations and tests are left alone. On eo-runtime it fires on exactly the six places named in the issue. Teach LanguageTool and vale the words "dataization" and "syscall".
…1522-512520 # Conflicts: # .github/styles/config/vocabularies/Custom/accept.txt # src/test/java/matchers/GrammarMatcher.java
|
@volodya-lombrozo could you review this one when you have a moment? The lint fires on the six eo-runtime spots from the issue and nowhere else. |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
Adds a new experimental design lint to detect repeated dataization (! / dataized) performed inside nested formations when it targets an outer formation’s plain ^-based attribute chain, suggesting the dataization be moved to the nearest enclosing formation.
Changes:
- Introduces
design/misplaced-dataizationXSL lint emitting an experimental warning with a “move it up into …” hint. - Adds a focused test pack covering positives/negatives and a special “missing @line” XML case.
- Updates spelling/vocabulary tooling to accept new terminology used by the lint and its motive.
| File | Description |
|---|---|
| src/main/resources/org/eolang/lints/design/misplaced-dataization.xsl | Implements the new misplaced-dataization lint logic and emitted defect message. |
| src/main/resources/org/eolang/motives/design/misplaced-dataization.md | Documents the rationale and examples for the new lint. |
| src/test/java/matchers/GrammarMatcher.java | Extends LanguageTool ignore tokens to accommodate new terminology. |
| .github/styles/config/vocabularies/Custom/accept.txt | Adds Vale vocabulary patterns for “dataize*” and “syscall*”. |
| src/test/resources/org/eolang/lints/packs/single/misplaced-dataization/prints-context-when-lines-empty.yaml | Tests context emission when parser line info is absent (line=0). |
| src/test/resources/org/eolang/lints/packs/single/misplaced-dataization/names-the-nearest-enclosing-formation.yaml | Verifies message points to the nearest enclosing formation by name. |
| src/test/resources/org/eolang/lints/packs/single/misplaced-dataization/catches-plain-name-of-an-outer-attribute.yaml | Positive case: plain outer attribute dataization should warn. |
| src/test/resources/org/eolang/lints/packs/single/misplaced-dataization/catches-parent-dataized-in-a-recursive-formation.yaml | Positive case: recursive nested formation repeats outer dataization. |
| src/test/resources/org/eolang/lints/packs/single/misplaced-dataization/catches-dataized-keyword-on-an-outer-attribute.yaml | Positive case: dataized keyword on outer attribute should warn. |
| src/test/resources/org/eolang/lints/packs/single/misplaced-dataization/catches-dataization-in-an-anonymous-formation.yaml | Positive case: anonymous formations referenced by line labels. |
| src/test/resources/org/eolang/lints/packs/single/misplaced-dataization/allows-dataization-of-its-own-void.yaml | Negative case: dataization of own attributes should not warn. |
| src/test/resources/org/eolang/lints/packs/single/misplaced-dataization/allows-dataization-of-a-global.yaml | Negative case: global dataization should not warn. |
| src/test/resources/org/eolang/lints/packs/single/misplaced-dataization/allows-dataization-moved-up-into-the-outer-formation.yaml | Negative case: corrected pattern should be clean. |
| src/test/resources/org/eolang/lints/packs/single/misplaced-dataization/allows-dataization-in-a-top-level-formation.yaml | Negative case: top-level formation should be clean. |
| src/test/resources/org/eolang/lints/packs/single/misplaced-dataization/allows-dataization-in-a-test.yaml | Negative case: tests should be excluded. |
| src/test/resources/org/eolang/lints/packs/single/misplaced-dataization/allows-an-application-with-literal-arguments.yaml | Negative case: applications with literals remain out of scope. |
| src/test/resources/org/eolang/lints/packs/single/misplaced-dataization/allows-a-syscall-on-outer-objects.yaml | Negative case: syscalls/applications should be excluded. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "dataization", "decoratee", "eolang", "spdx", "SPDX-compliant", | ||
| "Unlinting", "cyclomatic" |
| --> | ||
| <xsl:template match="/"> | ||
| <defects> | ||
| <xsl:for-each select="//o[@base = 'Φ.dataized' and count(o) = 1 and o[empty(o) and (@base = 'ξ.ρ' or starts-with(@base, 'ξ.ρ.'))] and not(ancestor::o[eo:test-name(@name)])]"> |


This adds
design/misplaced-dataization, an experimental warning for a!ordataizedinside a nested formation whose target is a plain chain through^. That object belongs to the enclosing formation, yet every copy of the nested one dataizes it again. The message names the enclosing formation as the place to move it to.The heart of it is one selector:
It follows the three conditions from the issue, with one narrowing worth a look: the chain has to start with
ξ.ρ, so a bare global likeeol!stays silent. Letting globals in added two hits on eo-runtime, and one of them,win32.wsa-cleanup >>!insocket.eo, is a syscall that must run on every call. The parser rolls dispatches on a reference into its name, so a plain chain is always one childless object. Tests are skipped, because their copies don't repeat.I parsed eo-runtime from current objectionary/eo master with eo-parser 0.63.0 and ran the sheet over every file. It fires on exactly the six places the issue lists:
string/joined.eo:22,bytes/array.eo:15,bytes/hash.eo:18,bytes/as-input.eo:60,path.eo:108andpath.eo:199. The rewrittenjoinedfrom the issue passes clean."dataization" joins the LanguageTool ignore list, and both it and "syscall" join the vale vocabulary. Applications with literal arguments, like
i64/div.eo:49, stay out of scope, since the issue leaves that call to the architect. Closes #1522.