diff --git a/src/main/resources/org/eolang/lints/metas/unknown-metas.xsl b/src/main/resources/org/eolang/lints/metas/unknown-metas.xsl new file mode 100644 index 0000000..8d87968 --- /dev/null +++ b/src/main/resources/org/eolang/lints/metas/unknown-metas.xsl @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + warning + + Unknown meta used " + + " + + + + + + diff --git a/src/main/resources/org/eolang/motives/metas/unknown-metas.md b/src/main/resources/org/eolang/motives/metas/unknown-metas.md new file mode 100644 index 0000000..917c6a1 --- /dev/null +++ b/src/main/resources/org/eolang/motives/metas/unknown-metas.md @@ -0,0 +1,36 @@ +# Unknown Metas + +The following metas are supported: + +* `+package` +* `+alias` +* `+version` +* `+tests` +* `+rt` +* `+architect` +* `+home` +* `+unlint` +* `+probe` + +Incorrect: + +```eo ++foo ++bar + +[] > foo +``` + +Correct: + +```eo ++package com.test ++alias foo ++version 0.0.0 ++architect yegor256@gmail.com ++rt jvm ++home https://earth.com ++unlint unsorted-metas + +[] > foo +``` diff --git a/src/test/resources/org/eolang/lints/eo-packs/catches-unknown-metas.yaml b/src/test/resources/org/eolang/lints/eo-packs/catches-unknown-metas.yaml new file mode 100644 index 0000000..f8c9458 --- /dev/null +++ b/src/test/resources/org/eolang/lints/eo-packs/catches-unknown-metas.yaml @@ -0,0 +1,43 @@ +# 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. +--- +xsls: + - /org/eolang/lints/metas/unknown-metas.xsl +tests: + - /defects[count(defect[@severity='warning'])=3] + - /defects/defect[@line='1'] + - /defects/defect[@line='2'] + - /defects/defect[@line='3'] +eo: | + +foo + +bar + +bad + +package test + +alias foo + +version 0.0.0 + +architect yegor256@gmail.com + +rt node + +home https://earth.com + +unlint test + +probe + + [] > foo