aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* fix with tree-sitter 0.23Arthur Zamarin10 days6-54/+51
| | | | | | | Once again they broke the API, this time around the .captures() call. They changed it by a lot, returning a dict of capture names to captures. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* EmptyGlobalAssignment: ignore empty KEYWORDSArthur Zamarin2024-08-011-2/+7
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/695 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* BadDependency: catch := slot operator in PDEPENDArthur Zamarin2024-07-191-4/+9
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/693 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* OldPackageNameDep: check for dependency using pkgmoved nameArthur Zamarin2024-07-191-0/+25
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/659 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* PythonCompatCheck: add whitelist for backportsArthur Zamarin2024-07-061-1/+13
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* start work on 0.10.31Arthur Zamarin2024-07-041-1/+1
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* DistutilsNonPEP517Build: handle false positive with eclass definedArthur Zamarin2024-07-041-1/+2
| | | | | | | | Now that most ebuilds use PEP-517 mode, we can relax the check a little to handle cases where the variable is set in the eclass (for example tree-sitter based ebuilds). Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* fix with latest tree-sitterArthur Zamarin2024-05-172-4/+3
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* work on 0.10.30Arthur Zamarin2024-05-171-1/+1
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* NewerEAPIAvailable: fix codeArthur Zamarin2024-05-091-1/+1
| | | | | | Fixes: 4a7a02f60c9f87ad85670e0e798c5aadb8096c92 Resolves: https://github.com/pkgcore/pkgcheck/issues/679 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* NewerEAPIAvailable: handle better when no eclasses EAPIArthur Zamarin2024-05-081-1/+1
| | | | | | | | | It might sometimes not find any intersection of eclasses EAPIs, in which it is better to not report anything then to report a false positive or worse, to explode with exception. Resolves: https://github.com/pkgcore/pkgcheck/issues/679 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* fix crash when performing --timeout 0 call to ftp:// siteLucio Sauer2024-05-083-8/+13
| | | | | | | | | | | | | | e.g. pkgcheck scan --net -c HomepageUrlCheck --timeout 0 app-admin/chrootuid at checkout 127160ac611d39cc6bb2ca21fcf99a086fe2b176 Python's ftplib raises a ValueError with timeout=0. Use timeout=None to put the underlying socket in blocking mode. See https://docs.python.org/3/library/socket.html#socket.socket.settimeout for legal timeout values. Signed-off-by: Lucio Sauer <watermanpaint@posteo.net> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* drop bundling of tree-sitter-bashArthur Zamarin2024-03-231-97/+13
| | | | | | | We can use the new tree-sitter-bash python package, which has the library, so we can simplify the build a lot. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* git addon: support user global gitignoreArthur Zamarin2024-03-231-2/+7
| | | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/671 Resolves: https://github.com/pkgcore/pkgcheck/issues/672 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* NewerEAPIAvailable: committing new ebuilds with old EAPIArthur Zamarin2024-03-021-2/+43
| | | | | | | | Catch cases where new ebuilds are committed with old EAPIs. This is checked during `--commits` stage. Resolves: https://github.com/pkgcore/pkgcheck/issues/666 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* PkgBadlyFormedXml: convert to errorArthur Zamarin2024-03-011-1/+1
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/668 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* start work on 0.10.29Arthur Zamarin2024-03-011-1/+1
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* git: fix no-copies optionSam James2024-03-011-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 9103513e26f9f2aeade5b563a49697c0e2665e3e. I originally added --no-find-copies in e688357bdc5773009bb2e106075d9852f2513f89 to suppress git being too clever which ends up confusing our git integration, as we're not really interested in copies. I was going to use --no-find-copies-harder but I figured --no-find-copies sounded better as it was less specific and for our purposes here, we don't want copies at all, so why not? But --no-find-copies isn't a boolean option, it's just that until git commit 5825268db1058516d05be03d6a8d8d55eea5a943 ('parse-options: fully disable option abbreviation with PARSE_OPT_KEEP_UNKNOWN'), it tolerated it and expanded it to --no-find-copies-harder. Oops! Let's use --no-find-copies-harder as we originally should have, as the only available option to control the behavior, modulo setting a similarity % threshold with --find-copies=n. We're fine to do this as, quoting the git-log docs: "[...] and options applicable to the git-diff[1] command to control how the changes each commit introduces are shown." Bug: https://bugs.gentoo.org/924718 Bug: https://github.com/pkgcore/pkgcheck/issues/663 Signed-off-by: Sam James <sam@gentoo.org> Closes: https://github.com/pkgcore/pkgcheck/pull/664 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* git: revert log no copies optionArthur Zamarin2024-02-161-1/+2
| | | | | | | | | It broke with git-2.43.2, until further upstream work by Sam James, I'll just revert it. Bug: https://bugs.gentoo.org/924718 Reverts: e688357bdc5773009bb2e106075d9852f2513f89 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* addons.net: suppress urllib3 import warningsAnna “CyberTailor”2024-02-091-3/+5
| | | | | | | | | Most notably, this includes NotOpenSSLWarning: https://github.com/urllib3/urllib3/issues/3020#issuecomment-1785873825 Signed-off-by: Anna “CyberTailor” <cyber@sysrq.in> Closes: https://github.com/pkgcore/pkgcheck/pull/661 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* VariableOrderWrong: Enforce skel.ebuild variable orderAnthony Ryan2024-01-281-0/+50
| | | | | | | | | | | | | | | Gentoo developers are rejecting routine version bumps for ebuild variables being defined in a different order than skel.ebuild. This new lint ensures pkgcheck identifies these problems before we waste developer time. Regarding tests, in spite of the massive diff, all that's been done is re-ordering the variables to avoid introducing new style warnings into existing tests. Signed-off-by: Anthony Ryan <anthonyryan1@gmail.com> Closes: https://github.com/pkgcore/pkgcheck/pull/645 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* reformat with black 24Arthur Zamarin2024-01-262-5/+5
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* start work on 0.10.28Arthur Zamarin2024-01-261-1/+1
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* compatibilty: remove reliance on repo.category_dirsBrian Harring2024-01-231-2/+4
| | | | | | | | | | | | | | pkgcore's `category_dirs` is a fossil that shouldn't be relied upon. My recollection is this property was from before `profiles/categories` existed, but it's just a listdir() intersection against known directories. PMS mandates categories be in `profiles/categories`, thus that functionality breaks compatibility. It will be removed from pkgcore in future semver breaks for that reason. Signed-off-by: Brian Harring <ferringb@gmail.com>
* feat: add check for a category is a fileBrian Harring2024-01-231-0/+26
| | | | | | | | | | | This is beyond corner case, but if someone has a non directory in place of where a category is supposed to be, pkgcore and portage will silently suppress this. Pkgcore will be modified to emit a warning for this, but in the meantime, it's a cheap check, thus add it. Signed-off-by: Brian Harring <ferringb@gmail.com>
* OldPackageName: new check for package named after old package nameArthur Zamarin2024-01-171-0/+21
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/650 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* DependencyMoved: show better error for dependency on pkgmoveArthur Zamarin2024-01-141-6/+40
| | | | | | | | | Catch cases where we depend on pkgmoved package, and instead of showing NonexistentDeps and NonsolvableDepsIn* errors, show DependencyMoved result, with nice and simple suggestion on action to take. Resolves: https://github.com/pkgcore/pkgcheck/issues/649 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* SandboxCallCheck: new check for invalid sandbox callsArthur Zamarin2024-01-141-0/+33
| | | | | | | Catches multiple arguments passed to function, and colon separated path. Resolves: https://github.com/pkgcore/pkgcheck/issues/644 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* UnstatedIuse: check for unstated IUSE in "?" dependenciesArthur Zamarin2024-01-131-12/+21
| | | | | | | | | | | | Check for cases where a dependency uses conditional use dependency with unknown USE flag. PMS states: It is an error for an ebuild to use a conditional use dependency when that ebuild does not have the flag in IUSE_EFFECTIVE. Bug: https://bugs.gentoo.org/921841 Requested-by: Sam James <sam@gentoo.org> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* DeprecatedDep: fix mishandling of slotted deprecatesArthur Zamarin2023-12-101-1/+1
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/642 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* OutdatedProfilePackage: don't warn when version was removed not long agoArthur Zamarin2023-12-101-4/+9
| | | | | Requested-by: Sam James <sam@gentoo.org> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* MissingRemoteId: expand gitlab matching rulesAlfred Wingate2023-12-081-1/+3
| | | | | | | | | * Notably handles the particular case with gitlab package hosting. Bug: https://github.com/pkgcore/pkgcheck/issues/636 Signed-off-by: Alfred Wingate <parona@protonmail.com> Closes: https://github.com/pkgcore/pkgcheck/pull/637 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* checks.git: Set tarfile filterAlfred Wingate2023-12-081-0/+4
| | | | | | | | | | * Not setting it triggers a DeprecationWarning in python3.12. * Despite tarballs by git-archive being trusted, there isn't benefit in trusting it as the tarballs don't use metadata that would require it. Signed-off-by: Alfred Wingate <parona@protonmail.com> Closes: https://github.com/pkgcore/pkgcheck/pull/638 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* UnusedInherits: add whitelist for weak usage by another eclassArthur Zamarin2023-11-161-1/+7
| | | | | | | | | | Came up as example from elisp eclass, which has automagic calling of functions from readme.gentoo-r1 eclass if they are found in env. While weird, this is legal so let's add a simple whitelist support for this, so it would be simple to extend in future. Reported-by: Ulrich Müller <ulm@gentoo.org> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* whitespace: fix double "on" in result textArthur Zamarin2023-11-051-3/+3
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/633 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* MissingInherits: add some specials to exclude listArthur Zamarin2023-11-011-2/+3
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* start work on 0.10.27Arthur Zamarin2023-11-011-1/+1
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* BannedEapiCommand: add some extra user/group commandsArthur Zamarin2023-10-051-0/+17
| | | | | | | Add some commands which should never be called in ebuild to the banned list. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* addons.git: add helping message on failure on git remote setupArthur Zamarin2023-10-031-0/+22
| | | | | | | | | | | | Upon initial failure to get the git diff-tree output (so not the hot flow, but sad failure flow), try to catch output of incorrectly configured git remote (the remote should have a correct HEAD configured). Recommend the user to run `git remote set-head origin -a` to solve it. Resolves: https://github.com/pkgcore/pkgcheck/issues/608 Resolves: https://github.com/pkgcore/pkgdev/issues/107 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* SelfAssignment: fix with new tree-sitter-bashArthur Zamarin2023-10-021-2/+5
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* bash: use new tree-sitter-bashArthur Zamarin2023-10-021-14/+3
| | | | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/613 Resolves: https://github.com/pkgcore/pkgcheck/issues/612 Resolves: https://github.com/pkgcore/pkgcheck/issues/545 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* BannedEapiCommand: check for has_version --host-rootArthur Zamarin2023-10-011-0/+9
| | | | | | | | Catch ``has_version --host-root`` and ``best_version --host-root`` calls, which are not allowed in EAPI>=7. Resolves: https://github.com/pkgcore/pkgcheck/issues/630 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* DuplicateFunctionDefinition: new check for duplicate global functionsArthur Zamarin2023-09-231-4/+24
| | | | | | Closes: https://bugs.gentoo.org/365691 Resolves: https://github.com/pkgcore/pkgcheck/issues/624 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* VariableShadowed: new check to detect shadowed variablesArthur Zamarin2023-09-231-0/+40
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/622 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* BannedPhaseCall: detect calls of phase functions directlyArthur Zamarin2023-09-231-1/+11
| | | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/625 Closes: https://bugs.gentoo.org/596616 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* SelfAssignment: check for global scope self assignmentsArthur Zamarin2023-09-231-6/+23
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/626 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* EmptyGlobalAssignment: check for empty global assignmentsArthur Zamarin2023-09-231-1/+20
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* checks.network: add codeberg remote-idThomas Bracht Laumann Jespersen2023-09-141-0/+1
| | | | | | Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz> Closes: https://github.com/pkgcore/pkgcheck/pull/620 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* checks.metadata_xml: add codeberg as supported remote-idThomas Bracht Laumann Jespersen2023-09-141-0/+2
| | | | | Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* addons: git: pass --no-find-copies --no-find-copies-harder --find-renames to ↵Sam James2023-09-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | git log I currently have a local git hack to allow configuring git to default to --find-copies-harder because it's *extremely* useful when working on ebuild repositories (prompted by a discussion with Eli Schwartz). Unfortunately, this can confuse pkgcheck's git intergration because it'll call `git log` like: ``` git log --name-status --diff-filter=ARMD -z --pretty=tformat:%n%h%n%ct cc5b3b9f134a070c548faa4e3de17d615497d0b3..origin/HEAD ``` and get nothing back because (I think) git is interpreting some changes as copies rather than renames or new files. Explicitly pass options to disable finding copies, even though normally this isn't necessary, to keep things working. Signed-off-by: Sam James <sam@gentoo.org> Closes: https://github.com/pkgcore/pkgcheck/pull/618 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>