diff --git a/src/main/resources/org/eolang/lints/critical/application-duality.xsl b/src/main/resources/org/eolang/lints/critical/application-duality.xsl index 40ff08cd..7f7149b8 100644 --- a/src/main/resources/org/eolang/lints/critical/application-duality.xsl +++ b/src/main/resources/org/eolang/lints/critical/application-duality.xsl @@ -22,14 +22,24 @@ 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. --> - + - + + + + + + + + + + + diff --git a/src/test/resources/org/eolang/lints/packs/application-duality/allows-compact-vertical-bound-method.yaml b/src/test/resources/org/eolang/lints/packs/application-duality/allows-compact-vertical-bound-method.yaml new file mode 100644 index 00000000..b605cdab --- /dev/null +++ b/src/test/resources/org/eolang/lints/packs/application-duality/allows-compact-vertical-bound-method.yaml @@ -0,0 +1,34 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016-2025 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/critical/application-duality.xsl +asserts: + - /defects[count(defect[@severity='critical'])=0] +input: | + # Compact vertical bound method. + [] > vertical-bound-method + eq. > @ + true.if + "second":1 + "first".as-bytes:0 + "first" diff --git a/src/test/resources/org/eolang/lints/packs/application-duality/allows-vertical-bound-method.yaml b/src/test/resources/org/eolang/lints/packs/application-duality/allows-vertical-bound-method.yaml new file mode 100644 index 00000000..2bc0fb9c --- /dev/null +++ b/src/test/resources/org/eolang/lints/packs/application-duality/allows-vertical-bound-method.yaml @@ -0,0 +1,36 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016-2025 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/critical/application-duality.xsl +asserts: + - /defects[count(defect[@severity='critical'])=0] +input: | + # Vertical bound method with an application. + [] > vertical-bound-method + eq. > @ + if. + true + "second":1 + "first" + .as-bytes:0 + "first"