Skip to content

Commit

Permalink
#11 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Nov 19, 2024
1 parent 70d69bf commit 69a19cd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
12 changes: 7 additions & 5 deletions src/main/resources/org/eolang/lints/errors/atom-without-rt.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,20 @@ SOFTWARE.
<xsl:output encoding="UTF-8" method="xml"/>
<xsl:template match="/">
<defects>
<xsl:if test="//o[@atom]">
<xsl:if test="not(/program/metas/meta[head='rt'])">
<xsl:if test="not(/program/metas/meta[head='rt'])">
<xsl:for-each select="//o[@atom]">
<xsl:element name="defect">
<xsl:attribute name="line">
<xsl:value-of select="//o[@atom]/@line"/>
<xsl:value-of select="@line"/>
</xsl:attribute>
<xsl:attribute name="severity">
<xsl:text>error</xsl:text>
</xsl:attribute>
<xsl:text>Defining an atom without an +rt meta doesn't make sense</xsl:text>
<xsl:text>Defining "</xsl:text>
<xsl:value-of select="@name"/>
<xsl:text>" atom without an +rt meta doesn't make sense</xsl:text>
</xsl:element>
</xsl:if>
</xsl:for-each>
</xsl:if>
</defects>
</xsl:template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SOFTWARE.
<xsl:if test="/program/metas/meta[head='rt']">
<xsl:element name="defect">
<xsl:attribute name="line">
<xsl:value-of select="/program/metas/meta[head='rt']/@line"/>
<xsl:value-of select="/program/metas/meta[head='rt'][1]/@line"/>
</xsl:attribute>
<xsl:attribute name="severity">
<xsl:text>error</xsl:text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
xsls:
- /org/eolang/lints/errors/atom-without-rt.xsl
tests:
- /defects[count(defect[@severity='error'])=1]
- /defects[count(defect[@severity='error'])=2]
- /defects/defect[@line='9']
- /defects/defect[@line='11']
eo: |
+architect [email protected]
+home https://github.com/objectionary/eo
Expand All @@ -35,3 +36,5 @@ eo: |
[] > bytes
# Equals to another object.
[x] > eq /bool
[y] > not /bool
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ eo: |
+home https://github.com/objectionary/eo
+package org.eolang
+rt jvm org.eolang:eo-runtime:0.0.0
+rt ruby something
+version 0.0.0
# Boolean.
Expand Down

0 comments on commit 69a19cd

Please sign in to comment.