diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2023-09-19 21:09:54 +0300 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2023-09-23 18:36:03 +0300 |
commit | 8abeb154ed6047cd730ceb242a2fa08a486f739f (patch) | |
tree | 4a3524347d116c69acb67c0aaacce5e9572a6d8b /testdata | |
parent | VariableShadowed: new check to detect shadowed variables (diff) | |
download | pkgcheck-8abeb154ed6047cd730ceb242a2fa08a486f739f.tar.gz pkgcheck-8abeb154ed6047cd730ceb242a2fa08a486f739f.tar.bz2 pkgcheck-8abeb154ed6047cd730ceb242a2fa08a486f739f.zip |
DuplicateFunctionDefinition: new check for duplicate global functions
Closes: https://bugs.gentoo.org/365691
Resolves: https://github.com/pkgcore/pkgcheck/issues/624
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'testdata')
2 files changed, 23 insertions, 0 deletions
diff --git a/testdata/data/repos/standalone/DeclarationShadowedCheck/DuplicateFunctionDefinition/expected.json b/testdata/data/repos/standalone/DeclarationShadowedCheck/DuplicateFunctionDefinition/expected.json new file mode 100644 index 00000000..c560713b --- /dev/null +++ b/testdata/data/repos/standalone/DeclarationShadowedCheck/DuplicateFunctionDefinition/expected.json @@ -0,0 +1,2 @@ +{"__class__": "DuplicateFunctionDefinition", "category": "DeclarationShadowedCheck", "package": "DuplicateFunctionDefinition", "version": "0", "lines": [11, 15], "func_name": "any_function"} +{"__class__": "DuplicateFunctionDefinition", "category": "DeclarationShadowedCheck", "package": "DuplicateFunctionDefinition", "version": "0", "lines": [7, 19], "func_name": "pkg_preinst"} diff --git a/testdata/repos/standalone/DeclarationShadowedCheck/DuplicateFunctionDefinition/DuplicateFunctionDefinition-0.ebuild b/testdata/repos/standalone/DeclarationShadowedCheck/DuplicateFunctionDefinition/DuplicateFunctionDefinition-0.ebuild new file mode 100644 index 00000000..ad8ec8b7 --- /dev/null +++ b/testdata/repos/standalone/DeclarationShadowedCheck/DuplicateFunctionDefinition/DuplicateFunctionDefinition-0.ebuild @@ -0,0 +1,21 @@ + +HOMEPAGE="https://github.com/pkgcore/pkgcheck" +DESCRIPTION="ebuild with shadowed variables" +SLOT="0" +LICENSE="BSD" + +pkg_preinst() { + : +} + +any_function() { + : +} + +any_function() { + : +} + +pkg_preinst() { + any_function +} |