rshipp/pkgbuild-tools

Features list for pkglint

rshipp opened this issue · 0 comments

Features list for pkglint, organized into Error, Warning, and Info.
When used in aur2ccr, Error should stop building, Warning should print a warning message, Info should print some other message. Also a possibility for the future CCR2: No packages with Errors are allowed to be uploaded, packages with too many warnings cannot be uploaded. Existing packages with Errors and/or multiple Warnings should have a notice on their CCR page, and "IsBadPackage":"1" in the JSON results.

Error:
Use python-magic to disallow all non-text files
No build() or package() function
Missing variables: pkgname, pkgver, pkgrel, url, pkgdesc, license
If source= line, must have ***sums
Sums & source must be same number of entries
pkgver/pkgrel includes hyphen (-) or other character not [0-9a-zA-Z], underscore (_), or period (.)

Warning:
Unquoted $srcdir, $pkgdir, and $startdir
Overwritten variables (ccr-tools/aur2ccr#2)
No package() function or no build() function
Unquoted values like arch=(i686 x86_64), source=(http://someurl/pkg.tar.gz)
***sums at the bottom of the PKGBUILD
git/mercurial/subversion in makedepends, but not named pkgname-git/etc
license is not one of the default choices
something supposed to be a var is an array (or the other way around)
Extra variable exists, but is not preceded by an underscore
improper sum length/value
specific sourceforge mirror used instead of downloads.sourceforge.net
Usage of $startdir/src or $startdir/pkg
pkgname included in pkgdesc: should be shortened if possible
CCR cmake packages should be built with -DCMAKE_BUILD_TYPE=RelWithDebInfo

Info:
No screenshot variable
Missing/Poorly formatted "# Maintainer: "/"# Contributor: "
No newline at end of file (pet peeve)
No blank newline between comments at top, variables, and functions (readability)
pkgdesc > 80 characters
line length > 100 characters
pkgdesc does not begin with a capital and end with a period (best practice)
incorrectly formatted optdepends: should be in format "pkgname: what it provides for this package"
variables/functions in incorrect order

Some of these ideas are taken from namcap, some from the Chakra packaging standards, and some just made up on the spot. pkglint will not support compiled packages, only PKGBUILDs.