Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/readme links #534

Merged
merged 5 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,10 @@ Rules marked with **[S]** can have multiple sub-IDs
* [oelint.var.inherit](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.inherit.md) - Check the correct usage of inherit and inherit_defer (scarthgap+)
* [oelint.var.inheritdevtool](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.inheritdevtool.md) - inherit_defer is recommended for native and nativesdk class **[S]** (scarthgap+)
* [oelint.var.licenseremotefile](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.licenseremotefile.md) - License shall be a file in remote source not a local file
* [oelint.var.licensesdpx](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.licensesdpx.md) - Check for correct SPDX syntax in licenses
* [oelint.var.mandatoryvar](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.mandatoryvar.md) - Check for mandatory variables **[S]**
* [oelint.var.multiinclude](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.multiinclude.md) - Warn on including the same file more than once
* [oelint.var.multiinherit](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.multiinherit.md) - Warn on inherit the same file more than once
* [oelint.var.nativefilename - Native only recipes should be named](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.nativefilename - Native only recipes should be named.md) -native
* [oelint.var.nativefilename](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.nativefilename.md) - Native only recipes should be named.md -native
* [oelint.var.nativesdkfilename](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.nativesdkfilename.md) - NativeSDK only recipes should be named nativesdk-
* [oelint.var.order](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.order.md) - Variable order **[S]**
* [oelint.var.override](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.override.md) - Check if include/append is overriding a variable
Expand All @@ -173,7 +172,7 @@ Rules marked with **[S]** can have multiple sub-IDs
* [oelint.vars.dependsappend](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.dependsappend.md) - DEPENDS should only be appended, not overwritten
* [oelint.vars.dependsclass](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.dependsclass.md) - DEPENDS should use the correct class variants
* [oelint.vars.dependsordered](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.dependsordered.md) - RDEPENDS entries should be ordered alphabetically
* [oelint.vars.descriptionsame - 'DESCRIPTION' is the same a 'SUMMARY'](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.descriptionsame - 'DESCRIPTION' is the same a 'SUMMARY'.md) - it can be removed then
* [oelint.vars.descriptionsame](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.descriptionsame.md) - 'DESCRIPTION' is the same a 'SUMMARY'.md) - it can be removed then
* [oelint.vars.descriptiontoobrief](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.descriptiontoobrief.md) - 'DESCRIPTION' is the shorter than 'SUMMARY'
* [oelint.vars.doublemodify](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.doublemodify.md) - Multiple modifiers of append/prepend/remove/+= found in one operation
* [oelint.vars.downloadfilename](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.downloadfilename.md) - Fetcher does create a download artifact without 'PV' in the filename
Expand All @@ -186,10 +185,11 @@ Rules marked with **[S]** can have multiple sub-IDs
* [oelint.vars.homepageprefix](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.homepageprefix.md) - HOMEPAGE should begin with https:// or http://
* [oelint.vars.inconspaces](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.inconspaces.md) - Inconsistent use of spaces on append operation
* [oelint.vars.insaneskip](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.insaneskip.md) - INSANE_SKIP should be avoided at any cost
* [oelint.vars.licensesdpx](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.licensesdpx.md) - Check for correct SPDX syntax in licenses
* [oelint.vars.licfileprefix](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.licfileprefix.md) - Unnecessary prefix to LIC_FILES_CHKSUM detected **[F]**
* [oelint.vars.listappend](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.listappend.md) - Proper append/prepend to lists **[F]**
* [oelint.vars.mispell](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.mispell.md) - Possible typo detected
* [oelint.vars.mispell.unknown](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.mispell.unknown.md) - Variable is not known from CONSTANTS, typo is unlikely
* [oelint.vars.mispell](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.mispell.md) - Possible typo detected
* [oelint.vars.multilineident](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.multilineident.md) - On a multiline assignment, line indent is desirable
* [oelint.vars.notneededspace](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.notneededspace.md) - Space at the beginning of the var is not needed **[F]**
* [oelint.vars.notrailingslash](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.notrailingslash.md) - Variable shall not end on a slash
Expand Down
File renamed without changes.
32 changes: 32 additions & 0 deletions docs/wiki/oelint.var.inherit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# oelint.var.inherit

severity: warning

## Example

```
inherit ${A}
```

or

```
inherit_defer A
```

## Why is this bad?

``inherit_defer`` should be used if the class is determined by a variable.
``inherit`` should be used if the content is static.

## Ways to fix it

```
inherit_defer ${A}
```

or

```
inherit A
```
34 changes: 34 additions & 0 deletions docs/wiki/oelint.var.inheritdevtool.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# oelint.var.inheritdevtool

severity: warning

## Example

```
inherit nativesdk
```

or

```
inherit native
```

## Why is this bad?

Bitbake complains if ``native`` or ``nativesdk`` are not inherited last.
When using ``devtool``, a few extra classes are inherited, hence it's better to use
``inherit_defer native`` or ``inherit_defer nativesdk``, even if there are not based on
variables.

## Ways to fix it

```
inherit_defer nativesdk
```

or

```
inherit_defer native
```
17 changes: 17 additions & 0 deletions docs/wiki/oelint.vars.mispell.unknown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# oelint.vars.mispell.unknown

severity: info

## Example

```
MY_CUSTOM_VARIABLE = "1"
```

## Why is this bad?

As the variable is not known, it is advised to create a layer specific oelint-adv ``--constantmod`` extension.

## Ways to fix it

Create a ``--constantmod`` extension and reference it while running the linter.
21 changes: 21 additions & 0 deletions docs/wiki/oelint.vars.pythonpnusage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# oelint.vars.pythonpnusage

severity: info

## Example

```
A = "${PYTHON_PN}"
```

## Why is this bad?

``${PYTHON_PN}`` was marked deprecated from ``scarthgap`` release.

## Ways to fix it

Use ``python3`` instead

```
A = "python3"
```
1 change: 1 addition & 0 deletions oelint_adv/tweaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Tweaks:
"mickledore": {"constantmods": {"-": {"variables": {"known": ["PACKAGEBUILDPKGD"]}}}},
"nanbield": {"constantmods": {"-": {"variables": {"suggested": ["AUTHOR"]}}}},
"scarthgap": {},
"latest": {},
}

@staticmethod
Expand Down
19 changes: 17 additions & 2 deletions wiki-creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
import subprocess # noqa: S404

TEMPLATE_FILE = os.path.join(os.path.dirname(__file__), 'docs/_template.md')
TEMPLATE_FILE = os.path.join(os.path.dirname(__file__), 'docs/template.md')
WIKI_PATH = os.path.join(os.path.dirname(__file__), 'docs/wiki')


Expand All @@ -12,6 +12,21 @@ def create_templates(map_: dict):
if os.path.exists(os.path.join(WIKI_PATH, f'{k}.md')):
continue

if any(k.startswith(x) for x in [
'oelint.append.protvars.',
'oelint.task.order.',
'oelint.var.inherit.',
'oelint.var.inheritdevtool.',
'oelint.var.mandatoryvar.',
'oelint.var.order.',
'oelint.var.suggestedvar.',
'oelint.vars.bbvars.',
'oelint.vars.filessetting.',
'oelint.vars.pathhardcode.',
'oelint.vars.pkgspecific.',
]):
continue

rpl_map = {
'%title%': k,
'%severity%': v,
Expand All @@ -30,7 +45,7 @@ def create_templates(map_: dict):
def main():
try:
create_templates(json.loads(subprocess.check_output( # noqa: S607, S603
['python3', '-m', 'oelint_adv', '--print-rulefile'], universal_newlines=True)))
['python3', '-m', 'oelint_adv', '--print-rulefile', '--release=latest'], universal_newlines=True)))
except subprocess.CalledProcessError:
pass

Expand Down