aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* checks: use stable sorting of fields + strip where neededArthur Zamarin2023-09-013-4/+4
| | | | | | In preparation of new tree-sitter-bash, some small issues where found. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* UnstableSrcUri: check for unstable SRC_URIArthur Zamarin2023-09-011-2/+31
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/510 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* EclassManualDepsCheck: add check for missing manual depsArthur Zamarin2023-09-011-0/+92
| | | | | | | | 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>
* GlobDistdir: check for glob usage with DISTDIRArthur Zamarin2023-08-301-0/+34
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/605 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* RedundantLongDescription: lower too short thresholdArthur Zamarin2023-08-291-1/+1
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/614 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* VariableScopeCheck: BROOT is allowed also in pkg_{pre,post}{inst,rm}Ulrich Müller2023-08-031-1/+1
| | | | | | | | | PMS commit: https://gitweb.gentoo.org/proj/pms.git/commit/?id=1a27729740e17ccd4b7a4527a46011fa62c9efb1 Signed-off-by: Ulrich Müller <ulm@gentoo.org> Closes: https://github.com/pkgcore/pkgcheck/pull/609 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* VariableScopeCheck: Disallow D and ED in pkg_postinst (again)Arthur Zamarin2023-08-021-2/+2
| | | | | | | https://projects.gentoo.org/qa/policy-guide/ebuild-format.html#pg0107 Fixes: 2cfc92ccab6ddfedd79ec16b8ebdde4eae8d2ad4 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* VariableScopeCheck: also check for wrong usage on global scopeArthur Zamarin2023-08-011-6/+38
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/606 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* start work on 0.10.26Arthur Zamarin2023-07-301-1/+1
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* GitPkgCommitsCheck: fix failure during compute of environmentArthur Zamarin2023-07-151-7/+9
| | | | | | | | In rare cases, ebd might fail for some ebuilds during the compute of `.environment` property. For now let's eat up all of those cases since other checks will catch the issues. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* PerlCheck: check versioned virtual perl dependenciesArthur Zamarin2023-07-151-12/+54
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/593 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* DeprecatedManifestHash: check for deprecated checksums in Manifest filesArthur Zamarin2023-07-141-3/+25
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/508 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* RepoManifestHashCheck: check for deprecated repo manifest-hashesArthur Zamarin2023-07-141-7/+42
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/508 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* scan: add `--git-remote` option to select remoteArthur Zamarin2023-07-091-25/+42
| | | | | | | | | | For repos with multiple remotes, it might be useful to select a specific remote to use (and not the default origin). This can be set using the `--git-remote` option for cmd call, or by adding `git-remote=value` to the config file. Resolves: https://github.com/pkgcore/pkgcheck/issues/600 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* OldPythonCompat: check for old PYTHON_COMPAT in modified ebuildsArthur Zamarin2023-07-011-2/+31
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/591 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* RubyCompatCheck: new check for new USE_RUBY compatible valuesArthur Zamarin2023-06-301-0/+109
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/304 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* scan: fix unknown exit checkset during initial config loadArthur Zamarin2023-06-291-1/+3
| | | | | | | | | Similar to previous fix, `--exit`` also can accept checksets which come from args, so we also need to "escape" failures of ExitArgs. Follows: a2358d60680611d7cbe07068440031c3c6e68f31 Resolves: https://github.com/pkgcore/pkgcheck/issues/594 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* SrcUriFilenameDotPrefix: new check for SRC_URI filenames with dot prefixArthur Zamarin2023-06-241-3/+23
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/585 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* ProfilesCheck: for unknown packages, mention last match removedArthur Zamarin2023-06-241-6/+42
| | | | | https://github.com/pkgcore/pkgcheck/issues/588 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* MissingInherits: exclude @USER_VARIABLEsArthur Zamarin2023-06-221-1/+13
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/575 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* RustCheck: check for suboptimal cargo_crate_uris callArthur Zamarin2023-06-211-0/+36
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/586 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* RustCheck: check for suboptimal - CRATES separatorArthur Zamarin2023-06-211-0/+50
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/586 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* start work on 0.10.25Arthur Zamarin2023-05-191-1/+1
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* StaleLiveCheck: new check for stale live eapiArthur Zamarin2023-05-141-0/+36
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/578 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* ProfilesCheck: fix handling of profiles with neg_action packageArthur Zamarin2023-05-121-1/+1
| | | | | | | | | | When a "packages" file under a profile declares "-*" (meaning to remove all defaults), pkgcore pushes a special token (`True`) into the packages set. This is taken by ProfileStack to clean up previous stack, but the check wasn't expecting this token. Fixes by adding skip for that token. Resolves: https://github.com/pkgcore/pkgcheck/issues/577 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* scan: fix unknown checkset during initial config loadArthur Zamarin2023-05-111-1/+3
| | | | | | | | | | | | | | | | | | | The config load is performed in multiple stages: 1. parse `--config` path 2. load bundled config 3. load user & system configs 4. parse cmd args (needed for repo and targets) 5. load repo's config 6. parse full cmd args The problem is that the checkset is parsed during stage 4, which means it hasn't loaded the repo's config yet. While a more correct solution would be to parse only needed args during stage 4, it wasn't simple since the targets collect everything, including cmd args. So instead this just patches temporarily to not fail upon unknown checksets. Resolves: https://github.com/pkgcore/pkgcheck/issues/576 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Fix config loading if XDG_CONFIG_HOME is definedAlberto Gireud2023-04-241-1/+1
| | | | | | Signed-off-by: Alberto Gireud <agireud@amazon.com> Closes: https://github.com/pkgcore/pkgcheck/pull/573 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* MissingEAPIBlankLine: make it optionalArthur Zamarin2023-04-241-8/+21
| | | | | | | Requested by multiple devs, maybe in future we would improve logic, and un-optional it. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* MissingEAPIBlankLine: new check for missing blank after EAPIArthur Zamarin2023-04-211-2/+15
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/570 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* python: Restore filename check in pypi.eclass default caseMichał Górny2023-04-031-1/+6
| | | | | | | | | | | Restore the check for renamed distfile that was accidentally removed while refactoring the code. This prevents suggesting removing SRC_URI when it would cause the distfile rename to be reverted. Fixes: 5704c77f5cabed06be363df78ca03b6e66566a97 Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/pkgcore/pkgcheck/pull/572 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* python: Include PYPI_PN opportunities in PythonInlinePyPIURIMichał Górny2023-03-241-4/+9
| | | | | | | | Fixes #568 Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/pkgcore/pkgcheck/pull/569 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* python: Rewrite "one PyPI URL" check to reuse PYPI_SDIST_URI_REMichał Górny2023-03-241-12/+11
| | | | | | | | Technically this is less optimal than the original code but it opens up the possibility of enabling PYPI_PN support next. Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* UnknownCategoryDirs: enable for overlays, ignore scripts dirArthur Zamarin2023-03-181-8/+9
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/564 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* SrcUriChecksumChange: fix false positive with new ebuildsArthur Zamarin2023-03-111-0/+2
| | | | | | | | | When ebuilds are added and being modified in the same commit range, they might result in thinking there is old checksum for the file, when in fact it is empty dict. Resolves: https://github.com/pkgcore/pkgcheck/issues/553 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* start work on 0.10.24Arthur Zamarin2023-03-111-1/+1
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* GitPkgCommitsCheck: fix modification check for added ebuild in pkgsetArthur Zamarin2023-03-111-1/+5
| | | | | | | | | | | | When commit range has modification for multiple versions, with one of them modifying a newly added version in the same range, it wouldn't find the correct base commit and fail. Fix it by grouping based on fullver. The test is special with time.sleep, since I need the commits be in different seconds, otherwise the sorting by time might be bad. Resolves: https://github.com/pkgcore/pkgcheck/issues/563 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* GitPkgCommitsCheck: add check for EAPI change without revbumpArthur Zamarin2023-03-051-0/+16
| | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/557 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>