aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2023-08-30 20:23:06 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2023-09-01 11:18:36 +0300
commite9a8c4094584ae23fd5921098105a94a1a81d60e (patch)
tree75b95ea1aa631c0c5069601013ff4035aeaec5a7 /testdata
parentGlobDistdir: check for glob usage with DISTDIR (diff)
downloadpkgcheck-e9a8c4094584ae23fd5921098105a94a1a81d60e.tar.gz
pkgcheck-e9a8c4094584ae23fd5921098105a94a1a81d60e.tar.bz2
pkgcheck-e9a8c4094584ae23fd5921098105a94a1a81d60e.zip
EclassManualDepsCheck: add check for missing manual deps
When in special modes of eclasses (for example CARGO_OPTIONAL=1), verify specific dependencies are listed somehow in one of the dependencies var. Resolves: https://github.com/pkgcore/pkgcheck/issues/615 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'testdata')
-rw-r--r--testdata/data/repos/standalone/EclassManualDepsCheck/GoMissingDeps/expected.json1
-rw-r--r--testdata/data/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/expected.json1
-rw-r--r--testdata/data/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/fix.patch9
-rw-r--r--testdata/data/repos/standalone/EclassManualDepsCheck/RustMissingDeps/expected.json1
-rw-r--r--testdata/data/repos/standalone/EclassManualDepsCheck/RustMissingDeps/fix.patch9
-rw-r--r--testdata/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/RubyMissingDeps-0.ebuild12
-rw-r--r--testdata/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/RubyMissingDeps-1.ebuild8
-rw-r--r--testdata/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/RubyMissingDeps-2.ebuild14
-rw-r--r--testdata/repos/standalone/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-0.ebuild6
-rw-r--r--testdata/repos/standalone/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-1.ebuild10
-rw-r--r--testdata/repos/standalone/dev-lang/ruby/ruby-0.ebuild4
-rw-r--r--testdata/repos/standalone/dev-ruby/stub/stub-0.ebuild4
-rw-r--r--testdata/repos/standalone/eclass/ruby-ng.eclass1
-rw-r--r--testdata/repos/standalone/virtual/rubygems/rubygems-0.ebuild2
-rw-r--r--testdata/repos/standalone/virtual/rust/rust-0.ebuild2
15 files changed, 84 insertions, 0 deletions
diff --git a/testdata/data/repos/standalone/EclassManualDepsCheck/GoMissingDeps/expected.json b/testdata/data/repos/standalone/EclassManualDepsCheck/GoMissingDeps/expected.json
new file mode 100644
index 00000000..a2e61bca
--- /dev/null
+++ b/testdata/data/repos/standalone/EclassManualDepsCheck/GoMissingDeps/expected.json
@@ -0,0 +1 @@
+{"__class__": "GoMissingDeps", "category": "EclassUsageCheck", "package": "DeprecatedEclassVariable", "version": "0"}
diff --git a/testdata/data/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/expected.json b/testdata/data/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/expected.json
new file mode 100644
index 00000000..94c44a0e
--- /dev/null
+++ b/testdata/data/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/expected.json
@@ -0,0 +1 @@
+{"__class__": "RubyMissingDeps", "category": "EclassManualDepsCheck", "package": "RubyMissingDeps", "version": "1"}
diff --git a/testdata/data/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/fix.patch b/testdata/data/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/fix.patch
new file mode 100644
index 00000000..40c816d3
--- /dev/null
+++ b/testdata/data/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/fix.patch
@@ -0,0 +1,9 @@
+diff -Naur standalone/EclassManualDepsCheck/RubyMissingDeps/RubyMissingDeps-1.ebuild fixed/EclassManualDepsCheck/RubyMissingDeps/RubyMissingDeps-1.ebuild
+--- standalone/EclassManualDepsCheck/RubyMissingDeps/RubyMissingDeps-1.ebuild
++++ fixed/EclassManualDepsCheck/RubyMissingDeps/RubyMissingDeps-1.ebuild
+@@ -6,3 +6,5 @@ DESCRIPTION="Optional inherit without dep"
+ HOMEPAGE="https://github.com/pkgcore/pkgcheck"
+ SLOT="0"
+ LICENSE="BSD"
++
++DEPEND="virtual/rubygems"
diff --git a/testdata/data/repos/standalone/EclassManualDepsCheck/RustMissingDeps/expected.json b/testdata/data/repos/standalone/EclassManualDepsCheck/RustMissingDeps/expected.json
new file mode 100644
index 00000000..43be8d93
--- /dev/null
+++ b/testdata/data/repos/standalone/EclassManualDepsCheck/RustMissingDeps/expected.json
@@ -0,0 +1 @@
+{"__class__": "RustMissingDeps", "category": "EclassManualDepsCheck", "package": "RustMissingDeps", "version": "1"}
diff --git a/testdata/data/repos/standalone/EclassManualDepsCheck/RustMissingDeps/fix.patch b/testdata/data/repos/standalone/EclassManualDepsCheck/RustMissingDeps/fix.patch
new file mode 100644
index 00000000..a62eb390
--- /dev/null
+++ b/testdata/data/repos/standalone/EclassManualDepsCheck/RustMissingDeps/fix.patch
@@ -0,0 +1,9 @@
+diff -Naur standalone/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-1.ebuild fixed/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-1.ebuild
+--- standalone/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-1.ebuild
++++ fixed/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-1.ebuild
+@@ -8,3 +8,5 @@ DESCRIPTION="Optional inherit without deps"
+ HOMEPAGE="https://github.com/pkgcore/pkgcheck"
+ SLOT="0"
+ LICENSE="BSD"
++
++BDEPEND="virtual/rust"
diff --git a/testdata/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/RubyMissingDeps-0.ebuild b/testdata/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/RubyMissingDeps-0.ebuild
new file mode 100644
index 00000000..aaf1acd0
--- /dev/null
+++ b/testdata/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/RubyMissingDeps-0.ebuild
@@ -0,0 +1,12 @@
+EAPI=8
+
+RUBY_OPTIONAL=1
+
+inherit ruby-ng
+
+DESCRIPTION="Optional inherit with one dep"
+HOMEPAGE="https://github.com/pkgcore/pkgcheck"
+SLOT="0"
+LICENSE="BSD"
+
+IDEPEND="dev-lang/ruby"
diff --git a/testdata/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/RubyMissingDeps-1.ebuild b/testdata/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/RubyMissingDeps-1.ebuild
new file mode 100644
index 00000000..aba69b0b
--- /dev/null
+++ b/testdata/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/RubyMissingDeps-1.ebuild
@@ -0,0 +1,8 @@
+RUBY_OPTIONAL=1
+
+inherit ruby-ng
+
+DESCRIPTION="Optional inherit without dep"
+HOMEPAGE="https://github.com/pkgcore/pkgcheck"
+SLOT="0"
+LICENSE="BSD"
diff --git a/testdata/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/RubyMissingDeps-2.ebuild b/testdata/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/RubyMissingDeps-2.ebuild
new file mode 100644
index 00000000..04bab5d8
--- /dev/null
+++ b/testdata/repos/standalone/EclassManualDepsCheck/RubyMissingDeps/RubyMissingDeps-2.ebuild
@@ -0,0 +1,14 @@
+EAPI=8
+
+RUBY_OPTIONAL=1
+
+inherit ruby-ng
+
+DESCRIPTION="Optional inherit with category whitelist"
+HOMEPAGE="https://github.com/pkgcore/pkgcheck"
+SLOT="0"
+LICENSE="BSD"
+
+IUSE="test"
+RESTRICT="!test? ( test )"
+BDEPEND="test? ( dev-ruby/stub )"
diff --git a/testdata/repos/standalone/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-0.ebuild b/testdata/repos/standalone/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-0.ebuild
new file mode 100644
index 00000000..2b453030
--- /dev/null
+++ b/testdata/repos/standalone/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-0.ebuild
@@ -0,0 +1,6 @@
+inherit cargo
+
+DESCRIPTION="Normal non-optional inherit"
+HOMEPAGE="https://github.com/pkgcore/pkgcheck"
+SLOT="0"
+LICENSE="BSD"
diff --git a/testdata/repos/standalone/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-1.ebuild b/testdata/repos/standalone/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-1.ebuild
new file mode 100644
index 00000000..b43ff1b4
--- /dev/null
+++ b/testdata/repos/standalone/EclassManualDepsCheck/RustMissingDeps/RustMissingDeps-1.ebuild
@@ -0,0 +1,10 @@
+EAPI=7
+
+CARGO_OPTIONAL=1
+
+inherit cargo
+
+DESCRIPTION="Optional inherit without deps"
+HOMEPAGE="https://github.com/pkgcore/pkgcheck"
+SLOT="0"
+LICENSE="BSD"
diff --git a/testdata/repos/standalone/dev-lang/ruby/ruby-0.ebuild b/testdata/repos/standalone/dev-lang/ruby/ruby-0.ebuild
new file mode 100644
index 00000000..ba6aebb4
--- /dev/null
+++ b/testdata/repos/standalone/dev-lang/ruby/ruby-0.ebuild
@@ -0,0 +1,4 @@
+DESCRIPTION="Stub ebuild"
+HOMEPAGE="https://github.com/pkgcore/pkgcheck"
+SLOT="0"
+LICENSE="BSD"
diff --git a/testdata/repos/standalone/dev-ruby/stub/stub-0.ebuild b/testdata/repos/standalone/dev-ruby/stub/stub-0.ebuild
new file mode 100644
index 00000000..ba6aebb4
--- /dev/null
+++ b/testdata/repos/standalone/dev-ruby/stub/stub-0.ebuild
@@ -0,0 +1,4 @@
+DESCRIPTION="Stub ebuild"
+HOMEPAGE="https://github.com/pkgcore/pkgcheck"
+SLOT="0"
+LICENSE="BSD"
diff --git a/testdata/repos/standalone/eclass/ruby-ng.eclass b/testdata/repos/standalone/eclass/ruby-ng.eclass
new file mode 100644
index 00000000..5b2b9973
--- /dev/null
+++ b/testdata/repos/standalone/eclass/ruby-ng.eclass
@@ -0,0 +1 @@
+# ruby-ng eclass
diff --git a/testdata/repos/standalone/virtual/rubygems/rubygems-0.ebuild b/testdata/repos/standalone/virtual/rubygems/rubygems-0.ebuild
new file mode 100644
index 00000000..9c2ce2e9
--- /dev/null
+++ b/testdata/repos/standalone/virtual/rubygems/rubygems-0.ebuild
@@ -0,0 +1,2 @@
+DESCRIPTION="Stub ebuild"
+SLOT="0"
diff --git a/testdata/repos/standalone/virtual/rust/rust-0.ebuild b/testdata/repos/standalone/virtual/rust/rust-0.ebuild
new file mode 100644
index 00000000..9c2ce2e9
--- /dev/null
+++ b/testdata/repos/standalone/virtual/rust/rust-0.ebuild
@@ -0,0 +1,2 @@
+DESCRIPTION="Stub ebuild"
+SLOT="0"