aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2023-09-23 14:31:36 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2023-09-23 14:31:36 +0300
commitc46c56e0a28742e6a530503ea839c7a4546e3e16 (patch)
treeda2158b77d4a776d444441dca75f7fc88023741e /testdata
parentEmptyGlobalAssignment: check for empty global assignments (diff)
downloadpkgcheck-c46c56e0a28742e6a530503ea839c7a4546e3e16.tar.gz
pkgcheck-c46c56e0a28742e6a530503ea839c7a4546e3e16.tar.bz2
pkgcheck-c46c56e0a28742e6a530503ea839c7a4546e3e16.zip
SelfAssignment: check for global scope self assignments
Resolves: https://github.com/pkgcore/pkgcheck/issues/626 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'testdata')
-rw-r--r--testdata/data/repos/standalone/MetadataVarCheck/SelfAssignment/expected.json5
-rw-r--r--testdata/repos/standalone/MetadataVarCheck/SelfAssignment/SelfAssignment-0.ebuild21
2 files changed, 26 insertions, 0 deletions
diff --git a/testdata/data/repos/standalone/MetadataVarCheck/SelfAssignment/expected.json b/testdata/data/repos/standalone/MetadataVarCheck/SelfAssignment/expected.json
new file mode 100644
index 00000000..314daa7f
--- /dev/null
+++ b/testdata/data/repos/standalone/MetadataVarCheck/SelfAssignment/expected.json
@@ -0,0 +1,5 @@
+{"__class__": "SelfAssignment", "category": "MetadataVarCheck", "package": "SelfAssignment", "version": "0", "line": "RDEPEND=\"${RDEPEND}\"", "lineno": 6}
+{"__class__": "SelfAssignment", "category": "MetadataVarCheck", "package": "SelfAssignment", "version": "0", "line": "RDEPEND=\"$RDEPEND\"", "lineno": 7}
+{"__class__": "SelfAssignment", "category": "MetadataVarCheck", "package": "SelfAssignment", "version": "0", "line": "RDEPEND=${RDEPEND}", "lineno": 8}
+{"__class__": "SelfAssignment", "category": "MetadataVarCheck", "package": "SelfAssignment", "version": "0", "line": "RDEPEND=$RDEPEND", "lineno": 9}
+{"__class__": "SelfAssignment", "category": "MetadataVarCheck", "package": "SelfAssignment", "version": "0", "line": "RDEPEND=\" ${RDEPEND}\"", "lineno": 12}
diff --git a/testdata/repos/standalone/MetadataVarCheck/SelfAssignment/SelfAssignment-0.ebuild b/testdata/repos/standalone/MetadataVarCheck/SelfAssignment/SelfAssignment-0.ebuild
new file mode 100644
index 00000000..1abcf8b0
--- /dev/null
+++ b/testdata/repos/standalone/MetadataVarCheck/SelfAssignment/SelfAssignment-0.ebuild
@@ -0,0 +1,21 @@
+DESCRIPTION="Ebuild with various self assignments"
+HOMEPAGE="https://github.com/pkgcore/pkgcheck"
+SLOT="0"
+LICENSE="BSD"
+
+RDEPEND="${RDEPEND}" # FAIL
+RDEPEND="$RDEPEND" # FAIL
+RDEPEND=${RDEPEND} # FAIL
+RDEPEND=$RDEPEND # FAIL
+RDEPEND="${RDEPEND}
+" # FAIL
+RDEPEND="
+ ${RDEPEND}" # FAIL
+RDEPEND="
+ ${RDEPEND}
+" # FAIL
+
+RDEPEND+=" ${RDEPEND}" # OK (+=)
+RDEPEND="${RDEPEND} stub/stub1" # OK (something else)
+RDEPEND="stub/stub1 ${RDEPEND}" # OK (something else)
+RDEPEND="${RDEPEND:=stub/stub1}" # OK (:=)