alint.5.scd 8.9 KB
Newer Older
Leo's avatar
Leo committed
1 2 3 4
alint(5)

# NAME

Leo's avatar
Leo committed
5
alint - linting labels and tags
Leo's avatar
Leo committed
6 7 8

# DESCRIPTION

Leo's avatar
Leo committed
9 10 11 12
A label and a tag are 2 attributes given to each test in alint, a label is composed
by a collection of words separated by dashes and it is meant to convey the general
idea of what the test does. A tag is a string with AL followed by an integer, those
being assigned in increasing order as new tests are made but never re-using old ones.
Leo's avatar
Leo committed
13

Leo's avatar
Leo committed
14 15 16
tests can be skipped by setting an environment variable composed of SKIP_ + the label
in uppercase with the dashes replaced by underscore or by setting an environment variable
composed of SKIP_ + the tag.
Leo's avatar
Leo committed
17

Leo's avatar
Leo committed
18
# Severity
Leo's avatar
Leo committed
19

Leo's avatar
Leo committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
Severity is assigned to each tag and indicates how serious the violation found is:

## Serious (S)

Will cause problems during build or when package is delivered to users. Should be fixed
immediately.

## Important (I)

Might cause problems during build or when the package is delivered to users in certain
situations. Should be fixed soon.

## Minor (M)

Won't directly cause issues during build or when the package is delivered to users.
Should be fixed when convenient

Leo's avatar
Leo committed
37 38 39 40 41 42 43 44 45 46
## STYLE (T)

Won't cause any issues, are specific style issues pertinent to a concerned developer
or contributor. the _APKBUILD\_STYLE_ variable can be set to a specific value to enable
a subset of checks that the specific developer or user uses.

Current valid values are:

- leo (style linting for leo)

Leo's avatar
Leo committed
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
# Certainty

Certainty is assigned to each tag and indicates how certain a test is that the violation
found is not a false positive

## Certain (C)

The test is certain that this is not a false positive

## Possible (P)

The test is not certain that this is a false positive, but there is a high chance it isn't

# LABELS TAGS (aports-lint)

The following labels and tags are used by the *aports-lint* program.

## duplicate-package [AL22]
Leo's avatar
Leo committed
65

Leo's avatar
Leo committed
66 67
The Package being introduced is already present in another repo. Solve the
conflict by:
Leo's avatar
Leo committed
68

Leo's avatar
Leo committed
69 70
- 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
71 72 73 74 75 76

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
77

Leo's avatar
Leo committed
78 79 80
Severity: Serious, Certainty: Certain

## upper-repo-depends [AL16]
Leo's avatar
Leo committed
81 82 83 84 85 86 87 88 89

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.

Leo's avatar
Leo committed
90 91 92
Severity: Serious, Certainty: Certain

## duplicate-depends [AL17]
Leo's avatar
Leo committed
93 94 95 96 97

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

Declaring duplicate dependencies is superfluous.

Leo's avatar
Leo committed
98 99 100
Severity: Minor, Certainty: Certain

## upper-repo-makedepends [AL18]
Leo's avatar
Leo committed
101 102 103 104 105 106 107

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
108
only. Packages in unmaintained can makedepend on packages of any repo but non-free.
Leo's avatar
Leo committed
109

Leo's avatar
Leo committed
110 111 112
Severity: Serious, Certainty: Certain

## duplicate-makedepends [AL19]
Leo's avatar
Leo committed
113 114 115 116 117

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

Declaring duplicate dependencies is superfluous.

Leo's avatar
Leo committed
118 119 120
Severity: Minor, Certainty: Certain

## upper-repo-checkdepends [AL20]
Leo's avatar
Leo committed
121 122 123 124 125 126 127 128 129

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.

Leo's avatar
Leo committed
130 131 132
Severity: Serious, Certainty: Certain

## duplicate-checkdepends [AL21]
Leo's avatar
Leo committed
133 134 135 136 137

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

Declaring duplicate dependencies is superfluous.

Leo's avatar
Leo committed
138 139 140
Severity: Minor, Certainty: Certain

## pkgname-dirname-mismatch [AL23]
Leo's avatar
Leo committed
141 142 143 144

The pkgname variable of the APKBUILD has value *foo* but the directory in which the
APKBUILD is found is not named *foo*

Leo's avatar
Leo committed
145 146 147
Severity: Important, Certainty: Certain

## depends-makedepends-checkdepends-overlap [AL24]
Leo's avatar
Leo committed
148

149 150 151 152
A package is present in 2 to 3 of the 3 types of following dependencies: depends,
makedepends and checkdepends. All of them are installed during creation of the package,
please specify only once in the lowest common denominator location.

Leo's avatar
Leo committed
153 154 155
Severity: Important, Certainty: Certain

# LABELS TAGS (apkbuild-lint)
Leo's avatar
Leo committed
156

Leo's avatar
Leo committed
157
The following labels and tags are used by the *apkbuild-lint* program
Leo's avatar
Leo committed
158

Leo's avatar
Leo committed
159
## default-builddir-value [AL1]
Leo's avatar
Leo committed
160 161 162 163 164 165

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.

166
Severity: Minor, Certainty: Certain
Leo's avatar
Leo committed
167 168

## unnecessary-return-1 [AL2]
Leo's avatar
Leo committed
169 170 171 172 173 174

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.

Leo's avatar
Leo committed
175 176 177
Severity: Minor, Certainity: Certain

## pkgname-quoted [AL3]
Leo's avatar
Leo committed
178 179 180

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

Leo's avatar
Leo committed
181
Severity: Style, Certainty: Possible
Leo's avatar
Leo committed
182

Leo's avatar
Leo committed
183 184 185
## pkgver-quoted [AL4]

The APKBUILD's *pkgver* variable is quoted. It must not be quoted.
Leo's avatar
Leo committed
186

Leo's avatar
Leo committed
187
Severity: Style, Certainty: Possible
Leo's avatar
Leo committed
188 189

## empty-variable [AL5]
Leo's avatar
Leo committed
190 191 192 193 194 195

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.

Leo's avatar
Leo committed
196 197 198
Severity: Minor, Certainty: Certain

## custom-variable [AL6]
Leo's avatar
Leo committed
199 200 201 202 203 204 205 206

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.

Leo's avatar
Leo committed
207 208 209
Severity: Important, Certainty: Certain

## indent-tabs [AL7]
Leo's avatar
Leo committed
210 211 212 213 214 215

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

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

Leo's avatar
Leo committed
216 217 218
Severity: Important, Certainty: Certain

## trailing-whitespace [AL8]
Leo's avatar
Leo committed
219 220 221 222 223

The APKBUILD has trailing whitespace characters. Remove them.

Trailing whitespace is superfluous.

Leo's avatar
Leo committed
224 225 226 227 228 229 230 231 232
Severity: Important, Certainty: Certain

# backticks-usage [AL25]

The APKBUILD uses backticks for running a shell command, use `$()` instead.

Severity: Serious, Certainty: Possible

## function-keyword [AL9]
Leo's avatar
Leo committed
233 234 235 236 237 238 239

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.

Leo's avatar
Leo committed
240 241 242
Severity: Serious, Certainty: Certain

## space-before-function-parenthesis [AL10]
Leo's avatar
Leo committed
243 244 245 246 247

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.

Leo's avatar
Leo committed
248
Severity: Style, Certainty: Certain
Leo's avatar
Leo committed
249

Leo's avatar
Leo committed
250
## space-after-function-parenthesis [AL11]
Leo's avatar
Leo committed
251 252 253 254

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.

Leo's avatar
Leo committed
255
Severity: Style, Certainty: Certain
Leo's avatar
Leo committed
256 257

## newline-opening-brace [AL12]
Leo's avatar
Leo committed
258 259 260 261 262

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.

Leo's avatar
Leo committed
263
Severity: Style, Certainty: Certain
Leo's avatar
Leo committed
264 265

## superfluous-cd-builddir [AL13]
Leo's avatar
Leo committed
266 267 268 269 270

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
271 272
*builddir*. It is also possible that there are 2 *cd "$builddir"* statements
one after the other.
273

274
Severity: Minor, Certainty: Possible
Leo's avatar
Leo committed
275 276

## pkgname-has-uppercase [AL14]
277 278

pkgname has uppercase characters, pkgname must have only lowercase characters.
Leo's avatar
Leo committed
279

Leo's avatar
Leo committed
280 281 282
Severity: Serious, Certainty: Certain

## pkgver-has-pkgrel [AL15]
Leo's avatar
Leo committed
283 284 285

pkgver has *-r* followed by a number, that is reserved for the relaease of a package
as defined by the *pkgrel* variable.
Leo's avatar
Leo committed
286 287

Severity: Serious, Certainty: Certain
Leo's avatar
Leo committed
288 289 290

## _builddir-is-set [AL26]

Kevin Daudt's avatar
Kevin Daudt committed
291
\_builddir is set instead of builddir, which is an old variable from before builddir
292
existed as a concept understood by abuild
Leo's avatar
Leo committed
293 294

Severity: Serious, Certainty: Certain