Skip to content

Commit 597e0ca

Browse files
committed
Merge branch '__rultor'
2 parents 4ea0abf + 4063a1f commit 597e0ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+483
-149
lines changed

pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,18 @@ SOFTWARE.
212212
<version>0.7.1</version>
213213
<scope>test</scope>
214214
</dependency>
215+
<dependency>
216+
<groupId>org.languagetool</groupId>
217+
<artifactId>language-en</artifactId>
218+
<version>6.5</version>
219+
<scope>test</scope>
220+
</dependency>
221+
<dependency>
222+
<groupId>com.jcabi</groupId>
223+
<artifactId>jcabi-matchers</artifactId>
224+
<version>1.8.0</version>
225+
<scope>test</scope>
226+
</dependency>
215227
</dependencies>
216228
<profiles>
217229
<profile>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
The MIT License (MIT)
4+
5+
Copyright (c) 2016-2024 Objectionary.com
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included
15+
in all copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.
24+
-->
25+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:eo="https://www.eolang.org" xmlns:xs="http://www.w3.org/2001/XMLSchema" id="escape" version="2.0">
26+
<xsl:function name="eo:escape" as="xs:string">
27+
<xsl:param name="text"/>
28+
<xsl:value-of select="concat('&quot;', replace(replace($text, ' ', '⌴'), '&quot;', '\\x22'), '&quot;')"/>
29+
</xsl:function>
30+
</xsl:stylesheet>

src/main/resources/org/eolang/lints/aliases/alias-too-long.xsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ SOFTWARE.
2424
-->
2525
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:eo="https://www.eolang.org" id="alias-too-long" version="2.0">
2626
<xsl:import href="/org/eolang/funcs/lineno.xsl"/>
27+
<xsl:import href="/org/eolang/funcs/escape.xsl"/>
2728
<xsl:output encoding="UTF-8" method="xml"/>
2829
<xsl:template match="/">
2930
<defects>
@@ -36,9 +37,8 @@ SOFTWARE.
3637
<xsl:attribute name="severity">
3738
<xsl:text>error</xsl:text>
3839
</xsl:attribute>
39-
<xsl:text>The alias has too many parts: "</xsl:text>
40-
<xsl:value-of select="tail"/>
41-
<xsl:text>"</xsl:text>
40+
<xsl:text>The alias has too many parts: </xsl:text>
41+
<xsl:value-of select="eo:escape(tail)"/>
4242
</xsl:element>
4343
</xsl:if>
4444
</xsl:for-each>

src/main/resources/org/eolang/lints/aliases/broken-alias-first.xsl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ SOFTWARE.
2424
-->
2525
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:eo="https://www.eolang.org" id="broken-alias-first" version="2.0">
2626
<xsl:import href="/org/eolang/funcs/lineno.xsl"/>
27+
<xsl:import href="/org/eolang/funcs/escape.xsl"/>
2728
<xsl:output encoding="UTF-8" method="xml"/>
2829
<xsl:template match="/">
2930
<defects>
@@ -36,9 +37,9 @@ SOFTWARE.
3637
<xsl:attribute name="severity">
3738
<xsl:text>error</xsl:text>
3839
</xsl:attribute>
39-
<xsl:text>The first part of the alias is invalid: "</xsl:text>
40-
<xsl:value-of select="part[1]"/>
41-
<xsl:text>" (it may only contain a relative name of the object, not its FQN)</xsl:text>
40+
<xsl:text>The first part of the alias is invalid: </xsl:text>
41+
<xsl:value-of select="eo:escape(part[1])"/>
42+
<xsl:text> (it may only contain a relative name of the object, not its FQN)</xsl:text>
4243
</xsl:element>
4344
</xsl:if>
4445
</xsl:for-each>

src/main/resources/org/eolang/lints/aliases/broken-alias-second.xsl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ SOFTWARE.
2424
-->
2525
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:eo="https://www.eolang.org" id="broken-alias-second" version="2.0">
2626
<xsl:import href="/org/eolang/funcs/lineno.xsl"/>
27+
<xsl:import href="/org/eolang/funcs/escape.xsl"/>
2728
<xsl:output encoding="UTF-8" method="xml"/>
2829
<xsl:template match="/">
2930
<defects>
@@ -36,9 +37,9 @@ SOFTWARE.
3637
<xsl:attribute name="severity">
3738
<xsl:text>error</xsl:text>
3839
</xsl:attribute>
39-
<xsl:text>The second part of the alias is invalid: "</xsl:text>
40-
<xsl:value-of select="part[2]"/>
41-
<xsl:text>" (it may only contain FQN)</xsl:text>
40+
<xsl:text>The second part of the alias is invalid: </xsl:text>
41+
<xsl:value-of select="eo:escape(part[2])"/>
42+
<xsl:text> (it may only contain FQN)</xsl:text>
4243
</xsl:element>
4344
</xsl:if>
4445
</xsl:for-each>

src/main/resources/org/eolang/lints/aliases/duplicate-aliases.xsl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ SOFTWARE.
2424
-->
2525
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:eo="https://www.eolang.org" id="duplicate-aliases" version="2.0">
2626
<xsl:import href="/org/eolang/funcs/lineno.xsl"/>
27+
<xsl:import href="/org/eolang/funcs/escape.xsl"/>
2728
<xsl:output encoding="UTF-8" method="xml"/>
2829
<xsl:template match="/">
2930
<defects>
@@ -37,9 +38,9 @@ SOFTWARE.
3738
<xsl:attribute name="severity">
3839
<xsl:text>error</xsl:text>
3940
</xsl:attribute>
40-
<xsl:text>The alias "</xsl:text>
41-
<xsl:value-of select="$name"/>
42-
<xsl:text>" is duplicated</xsl:text>
41+
<xsl:text>The alias </xsl:text>
42+
<xsl:value-of select="eo:escape($name)"/>
43+
<xsl:text> is duplicated</xsl:text>
4344
</xsl:element>
4445
</xsl:if>
4546
</xsl:for-each>
@@ -56,9 +57,9 @@ SOFTWARE.
5657
<xsl:attribute name="severity">
5758
<xsl:text>error</xsl:text>
5859
</xsl:attribute>
59-
<xsl:text>The name "</xsl:text>
60-
<xsl:value-of select="@name"/>
61-
<xsl:text>" is already in use</xsl:text>
60+
<xsl:text>The name </xsl:text>
61+
<xsl:value-of select="eo:escape(@name)"/>
62+
<xsl:text> is already in use</xsl:text>
6263
</error>
6364
</xsl:if>
6465
</xsl:for-each>

src/main/resources/org/eolang/lints/aliases/unused-alias.xsl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ SOFTWARE.
2424
-->
2525
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:eo="https://www.eolang.org" id="unused-alias" version="2.0">
2626
<xsl:import href="/org/eolang/funcs/lineno.xsl"/>
27+
<xsl:import href="/org/eolang/funcs/escape.xsl"/>
2728
<xsl:output encoding="UTF-8" method="xml"/>
2829
<xsl:template match="/">
2930
<defects>
@@ -37,11 +38,10 @@ SOFTWARE.
3738
<xsl:attribute name="severity">
3839
<xsl:text>error</xsl:text>
3940
</xsl:attribute>
40-
<xsl:text>The alias "</xsl:text>
41-
<xsl:value-of select="$name"/>
42-
<xsl:text>" is not used, but defined as "+alias </xsl:text>
43-
<xsl:value-of select="tail"/>
44-
<xsl:text>"</xsl:text>
41+
<xsl:text>The alias </xsl:text>
42+
<xsl:value-of select="eo:escape($name)"/>
43+
<xsl:text> is not used, but defined as </xsl:text>
44+
<xsl:value-of select="eo:escape(tail)"/>
4545
</xsl:element>
4646
</xsl:if>
4747
</xsl:for-each>

src/main/resources/org/eolang/lints/atoms/atom-and-base.xsl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ SOFTWARE.
2424
-->
2525
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:eo="https://www.eolang.org" id="atom-and-base" version="2.0">
2626
<xsl:import href="/org/eolang/funcs/lineno.xsl"/>
27+
<xsl:import href="/org/eolang/funcs/escape.xsl"/>
2728
<xsl:output encoding="UTF-8" method="xml"/>
2829
<xsl:template match="/">
2930
<defects>
@@ -35,11 +36,10 @@ SOFTWARE.
3536
<xsl:attribute name="severity">
3637
<xsl:text>critical</xsl:text>
3738
</xsl:attribute>
38-
<xsl:text>The atom "</xsl:text>
39-
<xsl:value-of select="@name"/>
40-
<xsl:text>" may not have the "@base" attribute, which however exists with "</xsl:text>
41-
<xsl:value-of select="@base"/>
42-
<xsl:text>"</xsl:text>
39+
<xsl:text>The atom </xsl:text>
40+
<xsl:value-of select="eo:escape(@name)"/>
41+
<xsl:text> may not have the "@base" attribute, which however exists with </xsl:text>
42+
<xsl:value-of select="eo:escape(@base)"/>
4343
</xsl:element>
4444
</xsl:for-each>
4545
</defects>

src/main/resources/org/eolang/lints/atoms/atom-in-atom.xsl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ SOFTWARE.
2424
-->
2525
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:eo="https://www.eolang.org" id="atom-in-atom" version="2.0">
2626
<xsl:import href="/org/eolang/funcs/lineno.xsl"/>
27+
<xsl:import href="/org/eolang/funcs/escape.xsl"/>
2728
<xsl:output encoding="UTF-8" method="xml"/>
2829
<xsl:template match="/">
2930
<defects>
@@ -35,16 +36,14 @@ SOFTWARE.
3536
<xsl:attribute name="severity">
3637
<xsl:text>error</xsl:text>
3738
</xsl:attribute>
38-
<xsl:text>Atom "</xsl:text>
39-
<xsl:value-of select="@name"/>
40-
<xsl:text>" may not have any attributes, even if they are atoms, which however exist: </xsl:text>
39+
<xsl:text>Atom </xsl:text>
40+
<xsl:value-of select="eo:escape(@name)"/>
41+
<xsl:text> may not have any attributes, even if they are atoms, which however exist: </xsl:text>
4142
<xsl:for-each select="o[@atom]">
4243
<xsl:if test="position() &gt; 1">
4344
<xsl:text>, </xsl:text>
4445
</xsl:if>
45-
<xsl:text>"</xsl:text>
46-
<xsl:value-of select="@name"/>
47-
<xsl:text>"</xsl:text>
46+
<xsl:value-of select="eo:escape(@name)"/>
4847
</xsl:for-each>
4948
</xsl:element>
5049
</xsl:for-each>

src/main/resources/org/eolang/lints/atoms/atom-without-rt.xsl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ SOFTWARE.
2424
-->
2525
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:eo="https://www.eolang.org" id="atom-without-rt" version="2.0">
2626
<xsl:import href="/org/eolang/funcs/lineno.xsl"/>
27+
<xsl:import href="/org/eolang/funcs/escape.xsl"/>
2728
<xsl:output encoding="UTF-8" method="xml"/>
2829
<xsl:template match="/">
2930
<defects>
@@ -36,9 +37,9 @@ SOFTWARE.
3637
<xsl:attribute name="severity">
3738
<xsl:text>error</xsl:text>
3839
</xsl:attribute>
39-
<xsl:text>The "</xsl:text>
40-
<xsl:value-of select="@name"/>
41-
<xsl:text>" atom is defined without the +rt meta, which doesn't make any sense</xsl:text>
40+
<xsl:text>The </xsl:text>
41+
<xsl:value-of select="eo:escape(@name)"/>
42+
<xsl:text> atom is defined without the +rt meta, which doesn't make any sense</xsl:text>
4243
</xsl:element>
4344
</xsl:for-each>
4445
</xsl:if>

0 commit comments

Comments
 (0)