aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* UnquotedVariable: fix false positives with unset_commandArthur Zamarin2022-11-091-0/+2
| | | | | | | Caught on sci-biology/hmmer, it was incorrectly reporting for TMPDIR declared with `unset`. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* NonPosixHeadTailUsage: new checkArthur Zamarin2022-11-084-0/+52
| | | | | | | New warning for non-POSIX compliant head or tail without -n. Closes: https://bugs.gentoo.org/558360 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* VirtualProvidersCheck: new check for providers issuesArthur Zamarin2022-11-0417-0/+110
| | | | | | | | - check for virtual package defining DEPEND or BDEPEND - check for virtual package with a single provider across versions Closes: https://bugs.gentoo.org/744784 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* UnquotedVariable: fix false positives with declaration_commandArthur Zamarin2022-11-022-9/+14
| | | | | | | | | | | Caught on app-admin/salt, it was incorrectly reporting for TMPDIR declared with `local` or `export`. This creates different parse tree with tree-sitter, so it was flagging this wrongly. Fix it, update tests. With this, the diff for gentoo repo is only for app-admin/salt. Reported-by: Patrick McLean <chutzpah@gentoo.org> Resolves: https://github.com/pkgcore/pkgcheck/issues/490 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* DoCompressedFilesCheck: new check for compressed do callsArthur Zamarin2022-10-314-0/+29
| | | | | | | | New check for catching passing compressed manpages to doman and newman, and passing compressed info to doinfo. Resolves: https://github.com/pkgcore/pkgcheck/issues/477 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* MissingRemoteIdCheck: fix bad suggestion for downloads.sourceforge.netArthur Zamarin2022-10-302-3/+3
| | | | | | | | | | | | | For sourceforge, the order of regexes was bad, resulting in it catching `downloads.sourceforge.net` as project under `sourceforge.net` instead, which is very wrong. Fix the order, and update the test to check for this case specially. On the same note, add support for `sourceforge.io` as a site - cause looks like it also appears in the wild. Resolves: https://github.com/pkgcore/pkgcheck/issues/488 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* MissingRemoteIdCheck: check for missing remote-idArthur Zamarin2022-10-2912-2/+92
| | | | | | | | | | Scans HOMEPAGE and SRC_URI for uris matching regexes using which it extracts remote-id. Skips already defined remote-id types. Skips URIS that end with ".diff" or ".patch". Prefers to take remote-id from newer package versions, in case URL updated. Resolves: https://github.com/pkgcore/pkgcheck/issues/475 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* tests: fix flaky network scan MetadataUrlCheck/RedirectedUrlArthur Zamarin2022-10-223-24/+7
| | | | | | | | Because of undefined order between requests call by the check (as they are performed in parallel), the test could fail if there was no match with the expected requests replies. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* network: fix results misattributed with same URLArthur Zamarin2022-10-173-7/+25
| | | | | | | | When a URL is collected from multiple different attributes, the results weren't updating the selected attribute, which resulted in wrong report. Resolves: https://github.com/pkgcore/pkgcheck/issues/403 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* PythonCheck: refactor and merge with PythonWrongUsageCheckArthur Zamarin2022-10-1323-116/+116
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* PythonCheck: warn about use of distutils-r1 non-PEP517 modeMichał Górny2022-10-133-0/+21
| | | | | Closes: https://github.com/pkgcore/pkgcheck/issues/467 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* RedundantVersionCheck: consider profile masks during checkArthur Zamarin2022-10-1220-0/+53
| | | | | | | | | When checking for redundant version, also check that on a profile doesn't exist where the package is visible, but all later versions aren't, which means that this package isn't redundant on that profile. Resolves: https://github.com/pkgcore/pkgcheck/issues/465 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* PythonWrongUsageCheck: fix for `python_gen_cond_dep`Arthur Zamarin2022-10-083-11/+11
| | | | | | | | Classes inheriting python-single-r1 should use python_gen_cond_dep instead of python_gen_any_dep. This commit fixes the issue. This also fixes for distutils-r1 with single mode on. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* EbuildReservedCheck: catch declaration of phase hooksArthur Zamarin2022-10-053-7/+28
| | | | | | | | Phase hooks (`{pre,post}_${phase}`) are used by portage to run user's hooks defined at `bashrc` file. Defining them in ebuilds might cause unexpected behavior, so we should warn about it. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* ProfilesCheck: new check for UnmatchedProfilePackageUnmaskArthur Zamarin2022-10-046-0/+13
| | | | | | | | | Add missing check from repoman, for unmatched unmask of atom in `package.mask` files. This checks for any unmask of package, which isn't masked in parent profiles. Resolves: https://github.com/pkgcore/pkgcheck/issues/369 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* StaticSrcUri: handle more casesArthur Zamarin2022-09-301-1/+1
| | | | | | | | | | - handle various new cases, and a little less permissive regex - add cases of usage of `ver_rs` and `ver_cut` - suggest the user with replacement Resolves: https://github.com/pkgcore/pkgcheck/issues/450 Resolves: https://github.com/pkgcore/pkgcheck/issues/451 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* network: add gnome-gitlab remote-idMatt Turner2022-09-164-0/+22
| | | | | | Signed-off-by: Matt Turner <mattst88@gentoo.org> Closes: https://github.com/pkgcore/pkgcheck/pull/445 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* network: add freedesktop-gitlab remote-idMatt Turner2022-09-164-0/+22
| | | | | Signed-off-by: Matt Turner <mattst88@gentoo.org> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* network: Add `savannah` and `savannah-nongnu` remote-idsSam James2022-09-168-0/+44
| | | | | | Signed-off-by: Sam James <sam@gentoo.org> Closes: https://github.com/pkgcore/pkgcheck/pull/446 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* UnquotedVariablesCheck: add `:` to message_commandsArthur Zamarin2022-09-032-2/+10
| | | | | | | | | The `:` command is used for various setting of variables, while not using the value. As a result, `: ${VAR:=${D}}` is fine, as it won't use spaced variable, but `foo ${VAR:=${D}}` will use the unquoted result of D. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* ReservedNameCheck: update rules for usage of reservedArthur Zamarin2022-08-272-1/+6
| | | | | | | Using reserved variable names, and not only defining, is prohibited. Also add new exceptions to the list of reserved names. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* DescriptionCheck: change long length threshold to 80Arthur Zamarin2022-08-191-1/+1
| | | | | | | Taken from https://devmanual.gentoo.org/ebuild-writing/variables/index.html#ebuild-defined-variables Reported-by: Sam James <sam@gentoo.org> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* MissingInherits: fix false positives with unsetArthur Zamarin2022-08-171-0/+1
| | | | | | | | | tree-sitter-bash uses type variable_name for the variable names when unset is used. Add a special case when a variable_name is detected whose parent is unset_command. Resolves: https://github.com/pkgcore/pkgcheck/issues/353 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* new check: MisplacedWeakBlockerArthur Zamarin2022-08-155-0/+83
| | | | | | | Detect pure-DEPEND weak blockers. Resolves: https://github.com/pkgcore/pkgcheck/issues/399 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* new check: UseFlagWithoutDepsArthur Zamarin2022-08-1312-2/+113
| | | | | | | | Detect USE flags, which don't affect dependencies, and should be (most likely) be removed because they provide little utility. Resolves: https://github.com/pkgcore/pkgcheck/issues/414 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* new check: matching has_version and python_gen_any_depArthur Zamarin2022-08-0813-3/+251
| | | | | | | check for matching deps in each call, and for matching use flags, and for matching dependency type. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* new check: missing PYTHON_USEDEP for python_has_versionArthur Zamarin2022-08-084-0/+56
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* new check: Usage of has_version for python checksArthur Zamarin2022-08-086-0/+86
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* UncheckableDep: add testcaseSam James2022-08-073-0/+37
| | | | | | | | | | | | | | Adapted from dev-lang/rust. We didn't have coverage over this result at all, so throw it in. More coverage is always good, but in particular, we want to know if we stop immediately aborting on complicated deps. It could be a regression (we parse for ages and give up -> hang). Signed-off-by: Sam James <sam@gentoo.org> Closes: https://github.com/pkgcore/pkgcheck/pull/423 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* python: add PEP517 missing DISTUTILS_DEPS checkSam James2022-08-076-1/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | Check for whether BDEPEND="${DISTUTILS_DEPS}" is missing in PEP517 ebuilds with DISTUTILS_OPTIONAL set. Implementation notes: * Ended up not merging this w/ existing PythonCheck because of how awkward it made testing and the edge cases that ended up being added. * Wanted to fold this into PythonCheck's check_depend(), but this doesn't fit super well, given we need to: 1. check for DISTUTILS_USE_PEP517 != no; 2. check for DISTUTILS_OPTIONAL; 3. check for ${DISTUTILS_DEPS} rather than a specific interpreter (don't want to get into copying eclass logic for specific packages needed per backend). For the last point (3), we could actually just look for dev-python/gpep517, which might be good enough. Fixes: https://github.com/pkgcore/pkgcheck#388 Signed-off-by: Sam James <sam@gentoo.org> Closes: https://github.com/pkgcore/pkgcheck/pull/389 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* tests: fix expected for sourcehut remote-idArthur Zamarin2022-07-291-1/+1
| | | | | Fixes: fde30b40ee2d54221257dc80e7669cf770ee2d28 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* network: add hackage remote-idSam James2022-07-294-0/+22
| | | | | | Signed-off-by: Sam James <sam@gentoo.org> Closes: https://github.com/pkgcore/pkgcheck/pull/416 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* network: add sourcehut remote-idSam James2022-07-294-0/+22
| | | | | | Signed-off-by: Sam James <sam@gentoo.org> Closes: https://github.com/pkgcore/pkgcheck/pull/415 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* python: Exempt files using commit hash from .gh.tar.gz suffix checkMichał Górny2022-05-292-0/+17
| | | | | | | | | Since distfiles using commit hashes are snapshots by definition, do not require explicit ".gh.tar.gz" suffix for them. Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/pkgcore/pkgcheck/pull/398 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* new check: variables that should be quotedThomas Bracht Laumann Jespersen2022-05-275-0/+112
| | | | | | | | | | | This is based on the repoman check EbuildQuote that reports instances of some variables that should be quoted in certain contexts. See: https://gitweb.gentoo.org/proj/portage.git/tree/repoman/lib/repoman/modules/linechecks/quotes/quotes.py?h=portage-3.0.30 Closes: https://github.com/pkgcore/pkgcheck/issues/363 Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz> Closes: https://github.com/pkgcore/pkgcheck/pull/379 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* checks: Sync remote-id types with wiki and test all of themMichał Górny2022-05-2548-0/+264
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* add a check for remote-id validityMichał Górny2022-05-256-4/+283
| | | | | | | | | | | | | | | | | | Add an auxiliary check for invalid remote-id values. At the moment, it primarily checks for the correct number of path components and some obvious mistakes. In the future, the regular expressions can be improved to catch invalid user/project names as well. This includes tests for common valid and invalid values for the current set of remote-ids. In addition to that, PkgMetadataXmlEmptyElement check is extended to cover "empty <remote-id/>" path in the code. Unfortunately, covering "unknown type" path is non-trivial as it requires a remote-id type that is allowed by the XML Schema but not covered by validation (which normally happens only when Schema is updated). This also requires bumping the minimal pkgcore version in order to grab XML Schema updates (adding "osdn" remote type).
* new check: GH archives missing .gh suffix when pypi is availableMichał Górny2022-05-2410-0/+85
| | | | | | | | | | Add a new check that verifies that Python packages using GitHub archives use the `.gh.tar.gz` suffix to make them distinct from the sdist tarballs on PyPI. Resolves: https://github.com/pkgcore/pkgcheck/issues/382 Closes: https://github.com/pkgcore/pkgcheck/pull/383 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* network: Do not attempt to verify URL with unknown protocolMichał Górny2022-05-242-2/+8
| | | | | | | Limit network checks to ftp, http and https URLs, in order to avoid DeadUrl reports that are duplicate to e.g. BadHomepage. Closes: https://github.com/pkgcore/pkgcheck/issues/372
* new check: using reserved namesArthur Zamarin2022-05-205-0/+61
| | | | | | | | | | | Based on updated PMS rules [1] around reserved for package manager function and variable names. Add the check for eclasses and ebuilds. [1] https://gitweb.gentoo.org/proj/pms.git/commit/?id=260e21bf65f Bug: https://bugs.gentoo.org/843779 Bug: https://bugs.gentoo.org/843680 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* new check: usage of deprecated variables or functionsArthur Zamarin2022-05-145-0/+68
| | | | | | Resolves: https://github.com/pkgcore/pkgcheck/issues/373 Resolves: https://github.com/pkgcore/pkgcheck/issues/374 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* new check: calls to eend without an argumentThomas Bracht Laumann Jespersen2022-05-143-0/+21
| | | | | | | | | Calls to eend should always have an argument, there's already a QA notice in portage for this. Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz> Closes: https://github.com/pkgcore/pkgcheck/pull/365 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* new check: LICENSE should not contain variablesThomas Bracht Laumann Jespersen2022-05-125-0/+56
| | | | | | | | | | | Extend MetadataVarCheck with a new method checking the LICENSE variable for other variables. The only exception is LICENSE itself. The check accepts occurrences of $LICENSE and ${LICENSE}. Closes: https://github.com/pkgcore/pkgcheck/issues/366 Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz> Closes: https://github.com/pkgcore/pkgcheck/pull/368 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* testdata: Rename @ECLASS-VARIABLE to @ECLASS_VARIABLEUlrich Müller2022-03-185-11/+11
| | | | | | | Bug: https://bugs.gentoo.org/835396 Signed-off-by: Ulrich Müller <ulm@gentoo.org> Closes: https://github.com/pkgcore/pkgcheck/pull/360 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* remove test for deprecated profile with no replacementMichał Górny2021-09-265-8/+0
| | | | | Remove the test testing deprecated profile with no replacement. This was not a valid error, and pkgcore 0.12.8 no longer emits it.
* InheritsCheck: process @PROVIDES recursivelyMichał Górny2021-09-023-0/+35
|
* add a check for eclasses calling EXPORT_FUNCTIONS before inheritMichał Górny2021-09-015-0/+55
| | | | | | The behavior for handling EXPORT_FUNCTIONS before inherit is not consistent across package managers. Enforce calling it after inherit to guarantee consistent behavior.
* add initial test for IndirectInherits checkMichał Górny2021-08-314-0/+38
| | | | | | Add an initial test verifying that IndirectInherits is reported for the most basic test case. Further tests will follow once @PROVIDES support lands in pkgcore.
* RepoProfilesCheck: check for banned&deprecated profile EAPIsMichał Górny2021-08-1418-2/+30
|
* EapiCheck: detect using stable keywords on EAPI listed as testingMichał Górny2021-08-0511-0/+45
|