From dca8a44639e5a41d254cadbea2a10736fbfe2bdf Mon Sep 17 00:00:00 2001 From: volodya-lombrozo Date: Sun, 16 Aug 2026 15:44:34 +0300 Subject: [PATCH 1/2] feat(#1279): Extract home-object function to shared stylesheet --- .../org/eolang/funcs/home-object.xsl | 32 +++++++++++++++++++ .../eolang/lints/metas/mandatory-package.xsl | 3 +- .../eolang/lints/metas/prohibited-package.xsl | 28 ++-------------- .../catches-home-name-without-home-meta.yaml | 9 ++++++ .../mandatory-package/skips-home-objects.yaml | 11 +++++++ .../catches-home-name-without-home-meta.yaml | 11 +++++++ .../catches-stale-whitelist-name.yaml | 12 +++++++ .../skips-new-home-object.yaml | 12 +++++++ 8 files changed, 91 insertions(+), 27 deletions(-) create mode 100644 src/main/resources/org/eolang/funcs/home-object.xsl create mode 100644 src/test/resources/org/eolang/lints/packs/single/mandatory-package/catches-home-name-without-home-meta.yaml create mode 100644 src/test/resources/org/eolang/lints/packs/single/mandatory-package/skips-home-objects.yaml create mode 100644 src/test/resources/org/eolang/lints/packs/single/prohibited-package/catches-home-name-without-home-meta.yaml create mode 100644 src/test/resources/org/eolang/lints/packs/single/prohibited-package/catches-stale-whitelist-name.yaml create mode 100644 src/test/resources/org/eolang/lints/packs/single/prohibited-package/skips-new-home-object.yaml diff --git a/src/main/resources/org/eolang/funcs/home-object.xsl b/src/main/resources/org/eolang/funcs/home-object.xsl new file mode 100644 index 000000000..3b3ff72be --- /dev/null +++ b/src/main/resources/org/eolang/funcs/home-object.xsl @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + diff --git a/src/main/resources/org/eolang/lints/metas/mandatory-package.xsl b/src/main/resources/org/eolang/lints/metas/mandatory-package.xsl index bba4fb7dd..a39812f3a 100644 --- a/src/main/resources/org/eolang/lints/metas/mandatory-package.xsl +++ b/src/main/resources/org/eolang/lints/metas/mandatory-package.xsl @@ -5,10 +5,11 @@ --> + - + diff --git a/src/main/resources/org/eolang/lints/metas/prohibited-package.xsl b/src/main/resources/org/eolang/lints/metas/prohibited-package.xsl index e8d75e6d4..34b965506 100644 --- a/src/main/resources/org/eolang/lints/metas/prohibited-package.xsl +++ b/src/main/resources/org/eolang/lints/metas/prohibited-package.xsl @@ -6,39 +6,15 @@ + - - as-phi - bytes - cti - dataized - error - false - go - i16 - i32 - i64 - malloc - nan - negative-infinity - number - positive-infinity - rust - seq - string - switch - true - try - tuple - while - - + diff --git a/src/test/resources/org/eolang/lints/packs/single/mandatory-package/catches-home-name-without-home-meta.yaml b/src/test/resources/org/eolang/lints/packs/single/mandatory-package/catches-home-name-without-home-meta.yaml new file mode 100644 index 000000000..75c98753c --- /dev/null +++ b/src/test/resources/org/eolang/lints/packs/single/mandatory-package/catches-home-name-without-home-meta.yaml @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com +# SPDX-License-Identifier: MIT +--- +sheets: + - /org/eolang/lints/metas/mandatory-package.xsl +asserts: + - /defects[count(defect[@severity='warning'])=1] +input: | + [] > win32 diff --git a/src/test/resources/org/eolang/lints/packs/single/mandatory-package/skips-home-objects.yaml b/src/test/resources/org/eolang/lints/packs/single/mandatory-package/skips-home-objects.yaml new file mode 100644 index 000000000..4b2147170 --- /dev/null +++ b/src/test/resources/org/eolang/lints/packs/single/mandatory-package/skips-home-objects.yaml @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com +# SPDX-License-Identifier: MIT +--- +sheets: + - /org/eolang/lints/metas/mandatory-package.xsl +asserts: + - /defects[count(defect)=0] +input: | + +home https://github.com/objectionary/eo + + [] > win32 diff --git a/src/test/resources/org/eolang/lints/packs/single/prohibited-package/catches-home-name-without-home-meta.yaml b/src/test/resources/org/eolang/lints/packs/single/prohibited-package/catches-home-name-without-home-meta.yaml new file mode 100644 index 000000000..7e3385b18 --- /dev/null +++ b/src/test/resources/org/eolang/lints/packs/single/prohibited-package/catches-home-name-without-home-meta.yaml @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com +# SPDX-License-Identifier: MIT +--- +sheets: + - /org/eolang/lints/metas/prohibited-package.xsl +asserts: + - /defects[count(defect[@severity='warning'])=1] +input: | + +package org.eolang + + [] > win32 diff --git a/src/test/resources/org/eolang/lints/packs/single/prohibited-package/catches-stale-whitelist-name.yaml b/src/test/resources/org/eolang/lints/packs/single/prohibited-package/catches-stale-whitelist-name.yaml new file mode 100644 index 000000000..aa3823400 --- /dev/null +++ b/src/test/resources/org/eolang/lints/packs/single/prohibited-package/catches-stale-whitelist-name.yaml @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com +# SPDX-License-Identifier: MIT +--- +sheets: + - /org/eolang/lints/metas/prohibited-package.xsl +asserts: + - /defects[count(defect[@severity='warning'])=1] +input: | + +home https://github.com/objectionary/eo + +package org.eolang + + [] > cti diff --git a/src/test/resources/org/eolang/lints/packs/single/prohibited-package/skips-new-home-object.yaml b/src/test/resources/org/eolang/lints/packs/single/prohibited-package/skips-new-home-object.yaml new file mode 100644 index 000000000..b9c26113a --- /dev/null +++ b/src/test/resources/org/eolang/lints/packs/single/prohibited-package/skips-new-home-object.yaml @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com +# SPDX-License-Identifier: MIT +--- +sheets: + - /org/eolang/lints/metas/prohibited-package.xsl +asserts: + - /defects[count(defect)=0] +input: | + +home https://github.com/objectionary/eo + +package org.eolang + + [] > win32 From e154c434937c70a11e8f1dd527d1426924e60ae8 Mon Sep 17 00:00:00 2001 From: volodya-lombrozo Date: Sun, 16 Aug 2026 15:49:36 +0300 Subject: [PATCH 2/2] style(#1279): Simplify home-objects variable declaration to single line --- src/main/resources/org/eolang/funcs/home-object.xsl | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/main/resources/org/eolang/funcs/home-object.xsl b/src/main/resources/org/eolang/funcs/home-object.xsl index 3b3ff72be..7f5f64f15 100644 --- a/src/main/resources/org/eolang/funcs/home-object.xsl +++ b/src/main/resources/org/eolang/funcs/home-object.xsl @@ -13,16 +13,7 @@ with the home repository; both lints share it from here so it never goes stale in two places at once. --> - - - +