Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<xsl:text>critical</xsl:text>
</xsl:attribute>
<xsl:text>Object </xsl:text>
<xsl:value-of select="@name"/>
<xsl:value-of select="eo:escape(@name)"/>
<xsl:text> have the "@pos" attribute, but the "@line" attribute is absent</xsl:text>
</xsl:element>
</xsl:for-each>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:eo="https://www.eolang.org" version="2.0" id="duplicate-names-in-diff-context">
<xsl:import href="/org/eolang/funcs/lineno.xsl"/>
<xsl:import href="/org/eolang/funcs/escape.xsl"/>
<xsl:import href="/org/eolang/funcs/defect-context.xsl"/>
<xsl:import href="/org/eolang/funcs/special-name.xsl"/>
<xsl:output encoding="UTF-8" method="xml"/>
Expand All @@ -23,9 +24,9 @@
</xsl:attribute>
</xsl:if>
<xsl:attribute name="severity">warning</xsl:attribute>
<xsl:text>Object "</xsl:text>
<xsl:value-of select="@name"/>
<xsl:text>" has the same name as </xsl:text>
<xsl:text>Object </xsl:text>
<xsl:value-of select="eo:escape(@name)"/>
<xsl:text> has the same name as </xsl:text>
<xsl:variable name="lines" select="current-group()/@line[. and . != current()/@line]"/>
<xsl:variable name="empty" select="count($lines) != count(current-group()) - 1"/>
<xsl:if test="count($lines) &gt; 0">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com
# SPDX-License-Identifier: MIT
---
# yamllint disable rule:line-length
sheets:
- /org/eolang/lints/misc/duplicate-names-in-diff-context.xsl
asserts:
- /defects[count(defect[@severity='warning'])=1]
- /defects/defect[contains(normalize-space(), 'Object "foo\x22bar" has the same name as')]
document: |
<object author="tests">
<o>
<o>
<o name='foo&quot;bar' line="3"/>
</o>
<o>
<o name='foo&quot;bar' line="6"/>
</o>
</o>
</object>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com
# SPDX-License-Identifier: MIT
---
# yamllint disable rule:line-length
sheets:
- /org/eolang/lints/critical/pos-without-line.xsl
asserts:
- /defects[count(defect[@severity='critical'])=1]
- /defects/defect[normalize-space()='Object "foo\x22bar" have the "@pos" attribute, but the "@line" attribute is absent']
document: |
<object author="tests">
<o pos="3" name='foo&quot;bar'/>
</object>
Loading