alint.5.scd 5.45 KB
Newer Older
Leo's avatar
Leo committed
1 2 3 4 5 6 7 8 9
alint(5)

# NAME

alint - linting tags

# DESCRIPTION

A tag is an attribute given to each test in alint, each tag has an explanation
Leo's avatar
Leo committed
10 11 12
of what it does and a brief on how to resolve it. each test can be skipped by 
setting an environment variable formed by SKIP_ + the tag in uppercase with the
dashes replaced by underscore.
Leo's avatar
Leo committed
13

Leo's avatar
Leo committed
14
# TAGS (aports-lint)
Leo's avatar
Leo committed
15

Leo's avatar
Leo committed
16
The following tags are used by the *aports-lint* program.
Leo's avatar
Leo committed
17

Leo's avatar
Leo committed
18 19
## Duplicate package

Leo's avatar
Leo committed
20 21
The Package being introduced is already present in another repo. Solve the
conflict by:
Leo's avatar
Leo committed
22

Leo's avatar
Leo committed
23 24
- If the package in the uppermost repo has more recent changes, merge them.
- Then delete the package in the upper repo.
Leo's avatar
Leo committed
25 26 27 28 29 30

Duplicate packages will shadow eachother in the repo and the one with the
higher version will win, it can also cause programs to compile against
the wrong version of a package. E.g: if *main/foo-1-r0* and *testing/foo-2-r0* exist
and *main/bar* is updated to version 2 which requires *foo>=2-r0* then it will
fail because it will only find *main/foo-1-r0* and not *testing/foo-2-r0*.
Leo's avatar
Leo committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55

## upper-repo-depends

The package depends on a package in a upper repo. The package must be moved to 
the upper repo or the dependency moved to the repo the package is.

Packages cannot depend on a package on an upper repo. Packages in main cannot
depend on packages in other repos. Packages in community can depend on main
and itself only. Packages in testing can depend on main, community and itself
only. Packages in unmaintained can depend on package on any repo but non-free.

## duplicate-depends

The APKBUILD has duplicate depends. One of them must be removed.

Declaring duplicate dependencies is superfluous.

## upper-repo-makedepends

The package makedepends on a package in a upper repo. The package must be moved
to the upper repo or the dependency moved to the repo the package is.

Packages cannot makedepend on a package on an upper repo. Packages in main cannot
makedepend on packages in other repos. Packages in community can depend on main
and itself only. Packages in testing can makedepend on main, community and itself
Leo's avatar
Leo committed
56
only. Packages in unmaintained can makedepend on packages of any repo but non-free.
Leo's avatar
Leo committed
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79

## duplicate-makedepends

The APKBUILD has duplicate makedepends. One of them must be removed.

Declaring duplicate dependencies is superfluous.

## upper-repo-checkdepends

The package checkdepends on a package in a upper repo. The package must be moved
to the upper repo or the dependency moved to the repo the package is.

Packages cannot checkdepend on a package on an upper repo. Packages in main cannot
checkdepend on packages in other repos. Packages in community can checkdepend on main
and itself only. Packages in testing can checkdepend on main, community and itself
only. Packages in unmaintained can checkdepend on package on any repo but non-free.

## duplicate-checkdepends

The APKBUILD has duplicate checkdepends. One of them must be removed.

Declaring duplicate dependencies is superfluous.

Leo's avatar
Leo committed
80
# TAGS (apkbuild-lint)
Leo's avatar
Leo committed
81 82 83 84 85 86 87 88 89 90

The following tags are used by the *apkbuild-lint* program

## default-builddir-value

The value of builddir matches the default which is *$srcdir/$pkgname-$pkgver*.
The *builddir* declaration can be removed.

Starting with v2.29.0 of *abuild* the value is set automatically.

Leo's avatar
Leo committed
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
## unnecessary-return-1

The APKBUILD has *|| return 1* statements. They can be safely removed.

Starting with version v2.15.0 of *abuild* the building process is executed
with *set -e* effectively adding a *|| return 1* to every command.

## pkgname-quoted

The APKBUILD's *pkgname* variable is quoted. It must not be quoted.

## pkgver-quoted

The APKBUILD's *pkgname* variable is quoted. It must not be quoted.

## empty-variable

The APKBUILD has variables that are empty values, they can safely be removed.

Empty variables can be removed to make the APKBUILD smaller and more
concise.

## custom-variable

The APKBUILD has custom variables that are not prefixed with an underscore.
prefix the variables with underscore.

Variables that do no affect behaviour of *abuild* should be prefixed with an
underscore so maintainers and contributors can easily distinguish their
importance.

## indent-tabs

The APKBUILD is using spaces instead of tabs for indenting. Replace the
spaces with tabs.

APKBUILDs use tab characters (\t) not spaces for indentation.

## trailing-whitespace

The APKBUILD has trailing whitespace characters. Remove them.

Trailing whitespace is superfluous.

## function-keyword

The APKBUILD uses the function keyword to declare a function. Use
*function()* instead.

the function keyword is a bashism. *abuild* uses Posix-compliant
shell with the *local* keyword.

## space-before-function-parenthesis

The APKBUILD has a space character between the name of a function
and the paranthesis that denote it is a function. Remove the superfluous
space.

## space after-function-parenthesis

The APKBUILD doesn't have a space after the function parenthesis or has more
than one space. Use only one space after the function parenthesis.

## newline-opening-brace

The APKBUILD has a newline before the opening brace of a function. Put the
opening brace in the same line as the declaration with one space after the
function parenthesis.

## superfluous-cd-builddir

The APKBUILD has *cd "$builddir"* statements that are superfluous. Remove them.

Staring with v3.3.0 of *abuild* the *prepare*, *build*, *check* and *package*
functions automatically have their working directory set to the value of
Leo's avatar
Leo committed
166 167
*builddir*. It is also possible that there are 2 *cd "$builddir"* statements
one after the other.