Skip to content

Commit

Permalink
bug(#237): allows maven conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
h1alexbel committed Jan 14, 2025
1 parent 4a842ef commit bf500c9
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SOFTWARE.
<xsl:for-each select="/program/metas/meta">
<xsl:variable name="meta-head" select="head"/>
<xsl:variable name="meta-tail" select="tail"/>
<xsl:if test="$meta-head='version' and not(matches($meta-tail, '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*)?(\+[a-zA-Z0-9]+)?$'))">
<xsl:if test="$meta-head='version' and not(matches($meta-tail, '^\d+\.\d+\.\d+(-[a-zA-Z0-9-]+)?$|^\d+\.\d+(-[a-zA-Z0-9-]+)$'))">
<xsl:element name="defect">
<xsl:attribute name="line">
<xsl:value-of select="eo:lineno(@line)"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# The MIT License (MIT)
#
# Copyright (c) 2016-2024 Objectionary.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
---
sheets:
- /org/eolang/lints/metas/incorrect-version.xsl
asserts:
- /defects[count(defect[@severity='warning'])=0]
input: |
+version 0.0.0
+version 0.2.1
+version 42.0.555555
+version 0.0.1-alpha
+version 0.0.1-beta-1
# No comments.
[x] > foo
x.div in.nextInt > @
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# The MIT License (MIT)
#
# Copyright (c) 2016-2024 Objectionary.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
---
sheets:
- /org/eolang/lints/metas/incorrect-version.xsl
asserts:
- /defects[count(defect[@severity='warning'])=0]
input: |
+version 1.0-SNAPSHOT
# No comments.
[x] > foo
41 > @
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# The MIT License (MIT)
#
# Copyright (c) 2016-2024 Objectionary.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
---
sheets:
- /org/eolang/lints/metas/incorrect-version.xsl
asserts:
- /defects[count(defect[@severity='warning'])=1]
- /defects/defect[@line='1']
input: |
+version x.z-SNAPSHOT
# No comments.
[x] > foo
41 > @
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,18 @@ sheets:
- /org/eolang/lints/metas/incorrect-version.xsl
asserts:
- /defects[count(defect[@severity='warning'])=11]
- /defects/defect[@line='1']
- /defects/defect[@line='2']
- /defects/defect[@line='3']
- /defects/defect[@line='4']
- /defects/defect[@line='5']
- /defects/defect[@line='6']
- /defects/defect[@line='7']
- /defects/defect[@line='8']
- /defects/defect[@line='9']
- /defects/defect[@line='10']
- /defects/defect[@line='11']
- /defects/defect[@line='12']
- /defects/defect[@line='13']
- /defects/defect[@line='14']
- /defects/defect[@line='15']
- /defects/defect[@line='16']
- /defects/defect[@line='17']
input: |
+version 0.0.0
+version 0.2.1
+version 42.0.555555
+version 0.0.1-alpha
+version 0.0.1-beta-1
+alias org.eolang.io.stdout
+version alpha
+version 1.0.0-alpha.beta
+version привет, друг!
Expand Down

0 comments on commit bf500c9

Please sign in to comment.