Skip to content
Merged
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
3 changes: 2 additions & 1 deletion src/main/resources/org/eolang/lints/names/compound-name.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
<!--
These prefixes/suffixes are idiomatic in EO standard library:
- 'as-' for type conversions (as-bytes, as-i64, as-number, etc.)
- 'cant-' for capabilities or restrictions (cant-read, cant-write, etc.)
- 'is-' for boolean predicates (is-empty, is-nan, is-finite, etc.)
- '-of' for extracting parts (slice-of, value-of, length-of, etc.)
-->
<xsl:function name="eo:idiomatic" as="xs:boolean">
<xsl:param name="name"/>
<xsl:sequence select="starts-with($name, 'as-') or starts-with($name, 'is-') or ends-with($name, '-of')"/>
<xsl:sequence select="starts-with($name, 'as-') or starts-with($name, 'cant-') or starts-with($name, 'is-') or ends-with($name, '-of')"/>
</xsl:function>
<xsl:template match="/">
<defects>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ Correct:

There are exceptions for idiomatic prefixes and suffixes.
The `as-` prefix is for type conversions: `as-bytes`, `as-i64`, `as-number`.
The `cant-` prefix is for capability or restriction names: `cant-read`, `cant-write`.
The `is-` prefix is for predicates: `is-empty`, `is-nan`, `is-finite`.
The `-of` suffix is for extracting parts: `slice-of`, `value-of`, `length-of`.
2 changes: 1 addition & 1 deletion src/test/java/org/eolang/lints/LtByXslTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ void checksDuplicateAsAttributeLintOnLargeXmirInReasonableTime()
}

@Test
@Timeout(10L)
@Timeout(30L)
void checksManyVoidAttributesLintOnLargeXmirInReasonableTime()
throws ImpossibleModificationException {
final int parents = 400;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ input: |
# No comments.
[] > main
x.as-bytes > as-bytes
x.cant-read > cant-read
x.cant-write > cant-write
y.as-i64 > as-i64
z.is-empty > is-empty
w.is-nan > is-nan
Expand Down
Loading