diff --git a/src/main/resources/org/eolang/lints/misc/unused-void-attr.xsl b/src/main/resources/org/eolang/lints/misc/unused-void-attr.xsl index 4c2ee3ac4..21ee7b0a1 100644 --- a/src/main/resources/org/eolang/lints/misc/unused-void-attr.xsl +++ b/src/main/resources/org/eolang/lints/misc/unused-void-attr.xsl @@ -3,7 +3,7 @@ * SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com * SPDX-License-Identifier: MIT --> - + @@ -14,7 +14,18 @@ - + + + + + + + + + + + + diff --git a/src/test/resources/org/eolang/lints/packs/single/unused-void-attr/catches-usage-as-nested-rho-ref.yaml b/src/test/resources/org/eolang/lints/packs/single/unused-void-attr/allows-usage-as-nested-rho-ref.yaml similarity index 74% rename from src/test/resources/org/eolang/lints/packs/single/unused-void-attr/catches-usage-as-nested-rho-ref.yaml rename to src/test/resources/org/eolang/lints/packs/single/unused-void-attr/allows-usage-as-nested-rho-ref.yaml index 6d0368750..20c3f77fc 100644 --- a/src/test/resources/org/eolang/lints/packs/single/unused-void-attr/catches-usage-as-nested-rho-ref.yaml +++ b/src/test/resources/org/eolang/lints/packs/single/unused-void-attr/allows-usage-as-nested-rho-ref.yaml @@ -4,8 +4,7 @@ sheets: - /org/eolang/lints/misc/unused-void-attr.xsl asserts: - - /defects[count(defect[@severity='warning'])=1] - - /defects/defect[@line='2'] + - /defects[count(defect[@severity='warning'])=0] input: | # Foo [x] > foo diff --git a/src/test/resources/org/eolang/lints/packs/single/unused-void-attr/allows-void-attr-used-in-nested-formation.yaml b/src/test/resources/org/eolang/lints/packs/single/unused-void-attr/allows-void-attr-used-in-nested-formation.yaml new file mode 100644 index 000000000..61c58ede5 --- /dev/null +++ b/src/test/resources/org/eolang/lints/packs/single/unused-void-attr/allows-void-attr-used-in-nested-formation.yaml @@ -0,0 +1,17 @@ +# SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com +# SPDX-License-Identifier: MIT +--- +# Regression test for objectionary/lints#637. +# The void attribute "widths" of "tabular" is referenced from inside the +# nested "[i] > inner" formation as "widths.at i", which the parser turns +# into "ξ.ρ.widths.at". The lint must recognise this rho-walking reference +# as a real usage and not flag "widths" as unused. +sheets: + - /org/eolang/lints/misc/unused-void-attr.xsl +asserts: + - /defects[count(defect[contains(., '"widths"')])=0] +input: | + # Foo. + [widths] > tabular + [i] > inner + widths.at i > @