From 218071ef408c87d41311d3933d15d5316cdb936d Mon Sep 17 00:00:00 2001 From: Konrad Weihmann Date: Thu, 14 Mar 2024 17:59:55 +0000 Subject: [PATCH] wiki: add documents explain the rules Closes #530 Signed-off-by: Konrad Weihmann --- .github/PULL_REQUEST_TEMPLATE.md | 1 + README.md | 202 +++++++++--------- docs/wiki/oelint.append.protvars.md | 25 +++ docs/wiki/oelint.bbclass.underscores.md | 17 ++ docs/wiki/oelint.exportfunction.dash.md | 23 ++ .../oelint.file.inactiveupstreamdetails.md | 40 ++++ docs/wiki/oelint.file.inappropriatemsg.md | 50 +++++ docs/wiki/oelint.file.includenotfound.md | 35 +++ docs/wiki/oelint.file.includerelpath.md | 23 ++ docs/wiki/oelint.file.inlinesuppress_na.md | 23 ++ docs/wiki/oelint.file.nospaces.md | 15 ++ docs/wiki/oelint.file.patchsignedoff.md | 26 +++ docs/wiki/oelint.file.requireinclude.md | 29 +++ docs/wiki/oelint.file.requirenotfound.md | 35 +++ docs/wiki/oelint.file.underscores.md | 22 ++ docs/wiki/oelint.file.upstreamstatus.md | 26 +++ docs/wiki/oelint.func.specific.md | 37 ++++ .../oelint.jetm.vars.dependssingleline.md | 22 ++ docs/wiki/oelint.newline.consecutive.md | 26 +++ docs/wiki/oelint.newline.eof.md | 21 ++ docs/wiki/oelint.spaces.emptyline.md | 23 ++ docs/wiki/oelint.spaces.linebeginning.md | 21 ++ docs/wiki/oelint.spaces.linecont.md | 28 +++ docs/wiki/oelint.spaces.lineend.md | 19 ++ docs/wiki/oelint.tabs.notabs.md | 26 +++ docs/wiki/oelint.task.addnotaskbody.md | 38 ++++ docs/wiki/oelint.task.customorder.md | 39 ++++ docs/wiki/oelint.task.dash.md | 26 +++ docs/wiki/oelint.task.docstrings.md | 27 +++ docs/wiki/oelint.task.heredocs.md | 34 +++ docs/wiki/oelint.task.multifragments.md | 27 +++ docs/wiki/oelint.task.noanonpython.md | 38 ++++ docs/wiki/oelint.task.nocopy.md | 25 +++ docs/wiki/oelint.task.nomkdir.md | 26 +++ docs/wiki/oelint.task.nopythonprefix.md | 26 +++ docs/wiki/oelint.task.order.md | 43 ++++ docs/wiki/oelint.task.pythonprefix.md | 26 +++ docs/wiki/oelint.var.addpylib.md | 19 ++ docs/wiki/oelint.var.bbclassextend.md | 23 ++ docs/wiki/oelint.var.filesoverride.md | 24 +++ docs/wiki/oelint.var.improperinherit.md | 27 +++ docs/wiki/oelint.var.licenseremotefile.md | 24 +++ docs/wiki/oelint.var.mandatoryvar.md | 34 +++ docs/wiki/oelint.var.multiinclude.md | 25 +++ docs/wiki/oelint.var.multiinherit.md | 25 +++ docs/wiki/oelint.var.nativefilename.md | 20 ++ docs/wiki/oelint.var.nativesdkfilename.md | 20 ++ docs/wiki/oelint.var.order.md | 58 +++++ docs/wiki/oelint.var.override.md | 38 ++++ docs/wiki/oelint.var.rootfspostcmd.md | 22 ++ docs/wiki/oelint.var.srcuriwildcard.md | 23 ++ docs/wiki/oelint.var.suggestedvar.md | 35 +++ docs/wiki/oelint.vars.appendop.md | 25 +++ docs/wiki/oelint.vars.autorev.md | 24 +++ docs/wiki/oelint.vars.bbvars.md | 94 ++++++++ docs/wiki/oelint.vars.bugtrackerisurl.md | 21 ++ docs/wiki/oelint.vars.dependsappend.md | 33 +++ docs/wiki/oelint.vars.dependsclass.md | 23 ++ docs/wiki/oelint.vars.dependsordered.md | 29 +++ docs/wiki/oelint.vars.descriptionsame.md | 21 ++ docs/wiki/oelint.vars.descriptiontoobrief.md | 20 ++ docs/wiki/oelint.vars.doublemodify.md | 30 +++ docs/wiki/oelint.vars.downloadfilename.md | 30 +++ docs/wiki/oelint.vars.duplicate.md | 24 +++ docs/wiki/oelint.vars.dusageinpkgfuncs.md | 31 +++ docs/wiki/oelint.vars.fileextrapaths.md | 21 ++ docs/wiki/oelint.vars.fileextrapathsop.md | 23 ++ docs/wiki/oelint.vars.filessetting.md | 31 +++ docs/wiki/oelint.vars.homepageping.md | 21 ++ docs/wiki/oelint.vars.homepageprefix.md | 21 ++ docs/wiki/oelint.vars.inconspaces.md | 23 ++ docs/wiki/oelint.vars.insaneskip.md | 24 +++ docs/wiki/oelint.vars.licensesdpx.md | 22 ++ docs/wiki/oelint.vars.licfileprefix.md | 21 ++ docs/wiki/oelint.vars.listappend.md | 47 ++++ docs/wiki/oelint.vars.mispell.md | 22 ++ docs/wiki/oelint.vars.multilineident.md | 28 +++ docs/wiki/oelint.vars.notneededspace.md | 21 ++ docs/wiki/oelint.vars.notrailingslash.md | 27 +++ docs/wiki/oelint.vars.overrideappend.md | 27 +++ docs/wiki/oelint.vars.pathhardcode.md | 42 ++++ docs/wiki/oelint.vars.pbpusage.md | 26 +++ docs/wiki/oelint.vars.pkgspecific.md | 37 ++++ docs/wiki/oelint.vars.pnbpnusage.md | 26 +++ docs/wiki/oelint.vars.pnusagediscouraged.md | 36 ++++ docs/wiki/oelint.vars.sectionlowercase.md | 19 ++ docs/wiki/oelint.vars.spacesassignment.md | 22 ++ docs/wiki/oelint.vars.specific.md | 25 +++ docs/wiki/oelint.vars.srcuriappend.md | 38 ++++ docs/wiki/oelint.vars.srcurichecksum.md | 36 ++++ docs/wiki/oelint.vars.srcuridomains.md | 25 +++ docs/wiki/oelint.vars.srcurifile.md | 28 +++ docs/wiki/oelint.vars.srcurigittag.md | 25 +++ docs/wiki/oelint.vars.srcurioptions.md | 22 ++ docs/wiki/oelint.vars.srcurisrcrevtag.md | 26 +++ docs/wiki/oelint.vars.summary80chars.md | 22 ++ docs/wiki/oelint.vars.summarylinebreaks.md | 21 ++ docs/wiki/oelint.vars.valuequoted.md | 21 ++ docs/wiki/oelint.vars.virtual.md | 22 ++ docs/wiki/template.md | 19 ++ wiki-creator.py | 39 ++++ 101 files changed, 2867 insertions(+), 101 deletions(-) create mode 100644 docs/wiki/oelint.append.protvars.md create mode 100644 docs/wiki/oelint.bbclass.underscores.md create mode 100644 docs/wiki/oelint.exportfunction.dash.md create mode 100644 docs/wiki/oelint.file.inactiveupstreamdetails.md create mode 100644 docs/wiki/oelint.file.inappropriatemsg.md create mode 100644 docs/wiki/oelint.file.includenotfound.md create mode 100644 docs/wiki/oelint.file.includerelpath.md create mode 100644 docs/wiki/oelint.file.inlinesuppress_na.md create mode 100644 docs/wiki/oelint.file.nospaces.md create mode 100644 docs/wiki/oelint.file.patchsignedoff.md create mode 100644 docs/wiki/oelint.file.requireinclude.md create mode 100644 docs/wiki/oelint.file.requirenotfound.md create mode 100644 docs/wiki/oelint.file.underscores.md create mode 100644 docs/wiki/oelint.file.upstreamstatus.md create mode 100644 docs/wiki/oelint.func.specific.md create mode 100644 docs/wiki/oelint.jetm.vars.dependssingleline.md create mode 100644 docs/wiki/oelint.newline.consecutive.md create mode 100644 docs/wiki/oelint.newline.eof.md create mode 100644 docs/wiki/oelint.spaces.emptyline.md create mode 100644 docs/wiki/oelint.spaces.linebeginning.md create mode 100644 docs/wiki/oelint.spaces.linecont.md create mode 100644 docs/wiki/oelint.spaces.lineend.md create mode 100644 docs/wiki/oelint.tabs.notabs.md create mode 100644 docs/wiki/oelint.task.addnotaskbody.md create mode 100644 docs/wiki/oelint.task.customorder.md create mode 100644 docs/wiki/oelint.task.dash.md create mode 100644 docs/wiki/oelint.task.docstrings.md create mode 100644 docs/wiki/oelint.task.heredocs.md create mode 100644 docs/wiki/oelint.task.multifragments.md create mode 100644 docs/wiki/oelint.task.noanonpython.md create mode 100644 docs/wiki/oelint.task.nocopy.md create mode 100644 docs/wiki/oelint.task.nomkdir.md create mode 100644 docs/wiki/oelint.task.nopythonprefix.md create mode 100644 docs/wiki/oelint.task.order.md create mode 100644 docs/wiki/oelint.task.pythonprefix.md create mode 100644 docs/wiki/oelint.var.addpylib.md create mode 100644 docs/wiki/oelint.var.bbclassextend.md create mode 100644 docs/wiki/oelint.var.filesoverride.md create mode 100644 docs/wiki/oelint.var.improperinherit.md create mode 100644 docs/wiki/oelint.var.licenseremotefile.md create mode 100644 docs/wiki/oelint.var.mandatoryvar.md create mode 100644 docs/wiki/oelint.var.multiinclude.md create mode 100644 docs/wiki/oelint.var.multiinherit.md create mode 100644 docs/wiki/oelint.var.nativefilename.md create mode 100644 docs/wiki/oelint.var.nativesdkfilename.md create mode 100644 docs/wiki/oelint.var.order.md create mode 100644 docs/wiki/oelint.var.override.md create mode 100644 docs/wiki/oelint.var.rootfspostcmd.md create mode 100644 docs/wiki/oelint.var.srcuriwildcard.md create mode 100644 docs/wiki/oelint.var.suggestedvar.md create mode 100644 docs/wiki/oelint.vars.appendop.md create mode 100644 docs/wiki/oelint.vars.autorev.md create mode 100644 docs/wiki/oelint.vars.bbvars.md create mode 100644 docs/wiki/oelint.vars.bugtrackerisurl.md create mode 100644 docs/wiki/oelint.vars.dependsappend.md create mode 100644 docs/wiki/oelint.vars.dependsclass.md create mode 100644 docs/wiki/oelint.vars.dependsordered.md create mode 100644 docs/wiki/oelint.vars.descriptionsame.md create mode 100644 docs/wiki/oelint.vars.descriptiontoobrief.md create mode 100644 docs/wiki/oelint.vars.doublemodify.md create mode 100644 docs/wiki/oelint.vars.downloadfilename.md create mode 100644 docs/wiki/oelint.vars.duplicate.md create mode 100644 docs/wiki/oelint.vars.dusageinpkgfuncs.md create mode 100644 docs/wiki/oelint.vars.fileextrapaths.md create mode 100644 docs/wiki/oelint.vars.fileextrapathsop.md create mode 100644 docs/wiki/oelint.vars.filessetting.md create mode 100644 docs/wiki/oelint.vars.homepageping.md create mode 100644 docs/wiki/oelint.vars.homepageprefix.md create mode 100644 docs/wiki/oelint.vars.inconspaces.md create mode 100644 docs/wiki/oelint.vars.insaneskip.md create mode 100644 docs/wiki/oelint.vars.licensesdpx.md create mode 100644 docs/wiki/oelint.vars.licfileprefix.md create mode 100644 docs/wiki/oelint.vars.listappend.md create mode 100644 docs/wiki/oelint.vars.mispell.md create mode 100644 docs/wiki/oelint.vars.multilineident.md create mode 100644 docs/wiki/oelint.vars.notneededspace.md create mode 100644 docs/wiki/oelint.vars.notrailingslash.md create mode 100644 docs/wiki/oelint.vars.overrideappend.md create mode 100644 docs/wiki/oelint.vars.pathhardcode.md create mode 100644 docs/wiki/oelint.vars.pbpusage.md create mode 100644 docs/wiki/oelint.vars.pkgspecific.md create mode 100644 docs/wiki/oelint.vars.pnbpnusage.md create mode 100644 docs/wiki/oelint.vars.pnusagediscouraged.md create mode 100644 docs/wiki/oelint.vars.sectionlowercase.md create mode 100644 docs/wiki/oelint.vars.spacesassignment.md create mode 100644 docs/wiki/oelint.vars.specific.md create mode 100644 docs/wiki/oelint.vars.srcuriappend.md create mode 100644 docs/wiki/oelint.vars.srcurichecksum.md create mode 100644 docs/wiki/oelint.vars.srcuridomains.md create mode 100644 docs/wiki/oelint.vars.srcurifile.md create mode 100644 docs/wiki/oelint.vars.srcurigittag.md create mode 100644 docs/wiki/oelint.vars.srcurioptions.md create mode 100644 docs/wiki/oelint.vars.srcurisrcrevtag.md create mode 100644 docs/wiki/oelint.vars.summary80chars.md create mode 100644 docs/wiki/oelint.vars.summarylinebreaks.md create mode 100644 docs/wiki/oelint.vars.valuequoted.md create mode 100644 docs/wiki/oelint.vars.virtual.md create mode 100644 docs/wiki/template.md create mode 100755 wiki-creator.py diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 42bc1dca..85f04c5f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,6 +7,7 @@ ## New feature - [ ] A testcase was added to test the behavior +- [ ] ``wiki-creator.py`` was run and a new wiki document was filled with information - [ ] New functions are documented with docstrings - [ ] No debug code is left - [ ] README.md was updated to reflect the changes (check even if n.a.) diff --git a/README.md b/README.md index 0195e87f..cfcc8a4a 100644 --- a/README.md +++ b/README.md @@ -114,106 +114,106 @@ As long as you don't pass **--nobackup** a backup copy (filename + .bak) will be Rules marked with **[F]** are able to perform automatic fixing Rules marked with **[S]** can have multiple sub-IDs -* oelint.append.protvars - Variables that shouldn't be set in a bbappend **[S]** -* oelint.bbclass.underscores - bbclass filenames shall not contain dashes -* oelint.exportfunction.dash - EXPORT_FUNCTIONS shall not contain dashes -* oelint.file.inactiveupstreamdetails - Patches with Upstream-Status: Inactive-Upstream require more details -* oelint.file.inappropriatemsg - Patches with Upstream-Status: Inappropriate should provide a valid reasoning -* oelint.file.includenotfound - File to be included not found -* oelint.file.includerelpath - Require should be used instead of include -* oelint.file.inlinesuppress_na - A not applicable inline suppression has been found -* oelint.file.nospaces - Path to file should not contain spaces -* oelint.file.patchsignedoff - Patches should contain a Signed-Of-By entry -* oelint.file.requireinclude - Require should be used instead of include -* oelint.file.requirenotfound - File to be required not found -* oelint.file.underscores - Checks the correct usage of underscores in filename -* oelint.file.upstreamstatus - Patches should contain a Upstream-Status entry -* oelint.func.specific - Function is specific to an unknown identifier -* oelint.newline.consecutive - Consecutive blank lines should be avoided **[F]** -* oelint.newline.eof - File shall end on a newline **[F]** -* oelint.spaces.emptyline - Empty line should not contain spaces or tabs **[F]** -* oelint.spaces.linebeginning - No space at a line beginning **[F]** -* oelint.spaces.linecont - Safe line continuation **[F]** -* oelint.spaces.lineend - No spaces at line end **[F]** -* oelint.tabs.notabs - No tabs allowed **[F]** -* oelint.task.addnotaskbody - Task added by addtask cannot be found -* oelint.task.customorder - order of custom tasks added via addtask -* oelint.task.dash - Functions and related statements shall not contain dashes -* oelint.task.docstrings - Custom tasks should have docstrings -* oelint.task.heredocs - Usage of heredocs should be avoided. Use files instead -* oelint.task.multifragments - Multiple fragments of the same function in the same file should be merged -* oelint.task.noanonpython - Avoid anonymous python functions -* oelint.task.nocopy - No cp usage in do_install -* oelint.task.nomkdir - No mkdir usage in do_install -* oelint.task.nopythonprefix - Tasks containing shell code should NOT be prefixed with 'python' in function header -* oelint.task.order - Order of tasks **[S]** -* oelint.task.pythonprefix - Tasks containing python code should be prefixed with 'python' in function header -* oelint.var.addpylib - addpylib is only valid in .conf files -* oelint.var.bbclassextend - Use BBCLASSEXTEND when possible -* oelint.var.filesoverride - FILES:*(FILES_*) variables should not be overridden -* oelint.var.improperinherit - Warn about improperly named inherits -* oelint.var.inherit - Check the correct usage of inherit and inherit_defer (scarthgap+) -* oelint.var.inheritdevtool - inherit_defer is recommended for native and nativesdk class **[S]** (scarthgap+) -* oelint.var.licenseremotefile - License shall be a file in remote source not a local file -* oelint.var.licensesdpx - Check for correct SPDX syntax in licenses -* oelint.var.mandatoryvar - Check for mandatory variables **[S]** -* oelint.var.multiinclude - Warn on including the same file more than once -* oelint.var.multiinherit - Warn on inherit the same file more than once -* oelint.var.nativefilename - Native only recipes should be named -native -* oelint.var.nativesdkfilename - NativeSDK only recipes should be named nativesdk- -* oelint.var.order - Variable order **[S]** -* oelint.var.override - Check if include/append is overriding a variable -* oelint.var.rootfspostcmd - ROOTFS_POSTPROCESS_COMMAND should not have trailing blanks -* oelint.var.srcuriwildcard - 'SRC_URI' should not contain any wildcards -* oelint.var.suggestedvar - Notice on suggested variables **[S]** -* oelint.vars.appendop - Use ':append(_append)' instead of ' += ' -* oelint.vars.autorev - The usage of 'AUTOREV' for SRCREV leads to not reproducible builds -* oelint.vars.bbvars - Variables that shouldn't be altered in recipe scope **[S]** -* oelint.vars.bugtrackerisurl - BUGTRACKER should be an URL -* oelint.vars.dependsappend - DEPENDS should only be appended, not overwritten -* oelint.vars.dependsclass - DEPENDS should use the correct class variants -* oelint.vars.dependsordered - RDEPENDS entries should be ordered alphabetically -* oelint.vars.descriptionsame - 'DESCRIPTION' is the same a 'SUMMARY' - it can be removed then -* oelint.vars.descriptiontoobrief - 'DESCRIPTION' is the shorter than 'SUMMARY' -* oelint.vars.doublemodify - Multiple modifiers of append/prepend/remove/+= found in one operation -* oelint.vars.downloadfilename - Fetcher does create a download artifact without 'PV' in the filename -* oelint.vars.duplicate - No duplicates in DEPENDS and RDEPENDS -* oelint.vars.dusageinpkgfuncs - use \$D instead of \$\{D\} in pkg functions **[F]** -* oelint.vars.fileextrapaths - 'FILESEXTRAPATHS' shouldn't be used in a bb file -* oelint.vars.fileextrapathsop - 'FILESEXTRAPATHS' should only be used in combination with ' := ' -* oelint.vars.filessetting - unnecessary FILES settings -* oelint.vars.homepageping - 'HOMEPAGE' isn't reachable -* oelint.vars.homepageprefix - HOMEPAGE should begin with https:// or http:// -* oelint.vars.inconspaces - Inconsistent use of spaces on append operation -* oelint.vars.insaneskip - INSANE_SKIP should be avoided at any cost -* oelint.vars.licfileprefix - Unnecessary prefix to LIC_FILES_CHKSUM detected **[F]** -* oelint.vars.listappend - Proper append/prepend to lists **[F]** -* oelint.vars.mispell - Possible typo detected -* oelint.vars.mispell.unknown - Variable is not known from CONSTANTS, typo is unlikely -* oelint.vars.multilineident - On a multiline assignment, line indent is desirable -* oelint.vars.notneededspace - Space at the beginning of the var is not needed **[F]** -* oelint.vars.notrailingslash - Variable shall not end on a slash -* oelint.vars.overrideappend - Check correct order of append/prepend on variables with override syntax -* oelint.vars.pathhardcode - Warn about the usage of hardcoded paths **[S]** -* oelint.vars.pbpusage - \$\{BP\} should be used instead of \$\{P\} **[F]** -* oelint.vars.pkgspecific - Variable is package-specific, but isn't set in that way **[S]** -* oelint.vars.pnbpnusage - \$\{BPN\} should be used instead of \$\{PN\} **[F]** -* oelint.vars.pnusagediscouraged - Variable shouldn't contain \$\{PN\} or \$\{BPN\} -* oelint.vars.pythonpnusage - python3 should be used instead of \$\{PYTHON_PN\} **[F]** (scarthgap+) -* oelint.vars.sectionlowercase - SECTION should be lowercase only **[F]** -* oelint.vars.spacesassignment - ' = ' should be correct variable assignment -* oelint.vars.specific - Variable is specific to an unknown identifier -* oelint.vars.srcuriappend - Use SRC_URI:append(SRC_URI_append) otherwise this will override weak defaults by inherit -* oelint.vars.srcurichecksum - If SRC_URI has URLs pointing single file that is not from VCS, then checksusm is required -* oelint.vars.srcuridomains - Recipe is pulling from different domains, this will likely cause issues -* oelint.vars.srcurifile - First item of SRC_URI should not be a file:// fetcher, if multiple fetcher are used -* oelint.vars.srcurigittag - 'tag' in SRC_URI-options leads to not-reproducible builds -* oelint.vars.srcurioptions - Unsupported fetcher or invalid options detected -* oelint.vars.srcurisrcrevtag - 'tag' in SRC_URI and a SRCREV for the same component doesn't compute -* oelint.vars.summary80chars - SUMMARY should max. be 80 characters long -* oelint.vars.summarylinebreaks - No line breaks in SUMMARY -* oelint.vars.valuequoted - Variable values should be properly quoted -* oelint.vars.virtual - no virtual/ items in RDEPENDS/RPROVIDES +* [oelint.append.protvars](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.append.protvars.md) - Variables that shouldn't be set in a bbappend **[S]** +* [oelint.bbclass.underscores](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.bbclass.underscores.md) - bbclass filenames shall not contain dashes +* [oelint.exportfunction.dash](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.exportfunction.dash.md) - EXPORT_FUNCTIONS shall not contain dashes +* [oelint.file.inactiveupstreamdetails](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.file.inactiveupstreamdetails.md) - Patches with Upstream-Status: Inactive-Upstream require more details +* [oelint.file.inappropriatemsg](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.file.inappropriatemsg.md) - Patches with Upstream-Status: Inappropriate should provide a valid reasoning +* [oelint.file.includenotfound](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.file.includenotfound.md) - File to be included not found +* [oelint.file.includerelpath](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.file.includerelpath.md) - Require should be used instead of include +* [oelint.file.inlinesuppress_na](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.file.inlinesuppress_na.md) - A not applicable inline suppression has been found +* [oelint.file.nospaces](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.file.nospaces.md) - Path to file should not contain spaces +* [oelint.file.patchsignedoff](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.file.patchsignedoff.md) - Patches should contain a Signed-Of-By entry +* [oelint.file.requireinclude](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.file.requireinclude.md) - Require should be used instead of include +* [oelint.file.requirenotfound](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.file.requirenotfound.md) - File to be required not found +* [oelint.file.underscores](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.file.underscores.md) - Checks the correct usage of underscores in filename +* [oelint.file.upstreamstatus](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.file.upstreamstatus.md) - Patches should contain a Upstream-Status entry +* [oelint.func.specific](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.func.specific.md) - Function is specific to an unknown identifier +* [oelint.newline.consecutive](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.newline.consecutive.md) - Consecutive blank lines should be avoided **[F]** +* [oelint.newline.eof](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.newline.eof.md) - File shall end on a newline **[F]** +* [oelint.spaces.emptyline](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.spaces.emptyline.md) - Empty line should not contain spaces or tabs **[F]** +* [oelint.spaces.linebeginning](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.spaces.linebeginning.md) - No space at a line beginning **[F]** +* [oelint.spaces.linecont](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.spaces.linecont.md) - Safe line continuation **[F]** +* [oelint.spaces.lineend](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.spaces.lineend.md) - No spaces at line end **[F]** +* [oelint.tabs.notabs](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.tabs.notabs.md) - No tabs allowed **[F]** +* [oelint.task.addnotaskbody](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.task.addnotaskbody.md) - Task added by addtask cannot be found +* [oelint.task.customorder](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.task.customorder.md) - order of custom tasks added via addtask +* [oelint.task.dash](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.task.dash.md) - Functions and related statements shall not contain dashes +* [oelint.task.docstrings](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.task.docstrings.md) - Custom tasks should have docstrings +* [oelint.task.heredocs](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.task.heredocs.md) - Usage of heredocs should be avoided. Use files instead +* [oelint.task.multifragments](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.task.multifragments.md) - Multiple fragments of the same function in the same file should be merged +* [oelint.task.noanonpython](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.task.noanonpython.md) - Avoid anonymous python functions +* [oelint.task.nocopy](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.task.nocopy.md) - No cp usage in do_install +* [oelint.task.nomkdir](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.task.nomkdir.md) - No mkdir usage in do_install +* [oelint.task.nopythonprefix](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.task.nopythonprefix.md) - Tasks containing shell code should NOT be prefixed with 'python' in function header +* [oelint.task.order](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.task.order.md) - Order of tasks **[S]** +* [oelint.task.pythonprefix](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.task.pythonprefix.md) - Tasks containing python code should be prefixed with 'python' in function header +* [oelint.var.addpylib](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.addpylib.md) - addpylib is only valid in .conf files +* [oelint.var.bbclassextend](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.bbclassextend.md) - Use BBCLASSEXTEND when possible +* [oelint.var.filesoverride](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.filesoverride.md) - FILES:*(FILES_*) variables should not be overridden +* [oelint.var.improperinherit](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.improperinherit.md) - Warn about improperly named inherits +* [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.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 +* [oelint.var.rootfspostcmd](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.rootfspostcmd.md) - ROOTFS_POSTPROCESS_COMMAND should not have trailing blanks +* [oelint.var.srcuriwildcard](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.srcuriwildcard.md) - 'SRC_URI' should not contain any wildcards +* [oelint.var.suggestedvar](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.var.suggestedvar.md) - Notice on suggested variables **[S]** +* [oelint.vars.appendop](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.appendop.md) - Use ':append(_append)' instead of ' += ' +* [oelint.vars.autorev](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.autorev.md) - The usage of 'AUTOREV' for SRCREV leads to not reproducible builds +* [oelint.vars.bbvars](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.bbvars.md) - Variables that shouldn't be altered in recipe scope **[S]** +* [oelint.vars.bugtrackerisurl](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.bugtrackerisurl.md) - BUGTRACKER should be an URL +* [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.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 +* [oelint.vars.duplicate](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.duplicate.md) - No duplicates in DEPENDS and RDEPENDS +* [oelint.vars.dusageinpkgfuncs](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.dusageinpkgfuncs.md) - use \$D instead of \$\{D\} in pkg functions **[F]** +* [oelint.vars.fileextrapaths](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.fileextrapaths.md) - 'FILESEXTRAPATHS' shouldn't be used in a bb file +* [oelint.vars.fileextrapathsop](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.fileextrapathsop.md) - 'FILESEXTRAPATHS' should only be used in combination with ' := ' +* [oelint.vars.filessetting](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.filessetting.md) - unnecessary FILES settings +* [oelint.vars.homepageping](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.homepageping.md) - 'HOMEPAGE' isn't reachable +* [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.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.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 +* [oelint.vars.overrideappend](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.overrideappend.md) - Check correct order of append/prepend on variables with override syntax +* [oelint.vars.pathhardcode](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.pathhardcode.md) - Warn about the usage of hardcoded paths **[S]** +* [oelint.vars.pbpusage](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.pbpusage.md) - \$\{BP\} should be used instead of \$\{P\} **[F]** +* [oelint.vars.pkgspecific](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.pkgspecific.md) - Variable is package-specific, but isn't set in that way **[S]** +* [oelint.vars.pnbpnusage](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.pnbpnusage.md) - \$\{BPN\} should be used instead of \$\{PN\} **[F]** +* [oelint.vars.pnusagediscouraged](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.pnusagediscouraged.md) - Variable shouldn't contain \$\{PN\} or \$\{BPN\} +* [oelint.vars.pythonpnusage](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.pythonpnusage.md) - python3 should be used instead of \$\{PYTHON_PN\} **[F]** (scarthgap+) +* [oelint.vars.sectionlowercase](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.sectionlowercase.md) - SECTION should be lowercase only **[F]** +* [oelint.vars.spacesassignment](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.spacesassignment.md) - ' = ' should be correct variable assignment +* [oelint.vars.specific](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.specific.md) - Variable is specific to an unknown identifier +* [oelint.vars.srcuriappend](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.srcuriappend.md) - Use SRC_URI:append(SRC_URI_append) otherwise this will override weak defaults by inherit +* [oelint.vars.srcurichecksum](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.srcurichecksum.md) - If SRC_URI has URLs pointing single file that is not from VCS, then checksusm is required +* [oelint.vars.srcuridomains](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.srcuridomains.md) - Recipe is pulling from different domains, this will likely cause issues +* [oelint.vars.srcurifile](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.srcurifile.md) - First item of SRC_URI should not be a file:// fetcher, if multiple fetcher are used +* [oelint.vars.srcurigittag](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.srcurigittag.md) - 'tag' in SRC_URI-options leads to not-reproducible builds +* [oelint.vars.srcurioptions](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.srcurioptions.md) - Unsupported fetcher or invalid options detected +* [oelint.vars.srcurisrcrevtag](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.srcurisrcrevtag.md) - 'tag' in SRC_URI and a SRCREV for the same component doesn't compute +* [oelint.vars.summary80chars](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.summary80chars.md) - SUMMARY should max. be 80 characters long +* [oelint.vars.summarylinebreaks](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.summarylinebreaks.md) - No line breaks in SUMMARY +* [oelint.vars.valuequoted](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.valuequoted.md) - Variable values should be properly quoted +* [oelint.vars.virtual](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.vars.virtual.md) - no virtual/ items in RDEPENDS/RPROVIDES ### Non-default rulesets @@ -228,7 +228,7 @@ To enable pass **--addrules jetm** to CLI. Rules marked with **[F]** are able to perform automatic fixing. -* oelint.jetm.vars.dependssingleline - Each [R]DEPENDS entry should be put into a single line +* [oelint.jetm.vars.dependssingleline](https://github.com/priv-kweihmann/oelint-adv/blob/master/docs/wiki/oelint.jetm.vars.dependssingleline.md) - Each [R]DEPENDS entry should be put into a single line ### Writing your own additional rules diff --git a/docs/wiki/oelint.append.protvars.md b/docs/wiki/oelint.append.protvars.md new file mode 100644 index 00000000..9556f750 --- /dev/null +++ b/docs/wiki/oelint.append.protvars.md @@ -0,0 +1,25 @@ +# oelint.append.protvars + +severity: error + +## Example + +In `my-random-%.bbappend` + +``` +LICENSE = "MIT" +LIC_FILES_CHKSUM = "foo;md5sum=f3e466264f6a083f8febd2b6921ce8c2" +PR = "4" +PV = "4" +SRCREV = "f161ebd29699d93411cec0915c5133c0f3229a28" +``` + +## Why is this bad? + +This will obscure the license detection and change detection, leading to unpredictable effects, like +missing rebuilds or missed out license changes. + +## Ways to fix it + +- do **NOT** use any of ``LICENSE``, ``LIC_FILES_CHKSUM``, ``PR``, ``PV`` or ``SRCREV`` in ``*.bbappend`` +- create a copy of the recipe instead and use `PREFERRED_PROVIDER` instead diff --git a/docs/wiki/oelint.bbclass.underscores.md b/docs/wiki/oelint.bbclass.underscores.md new file mode 100644 index 00000000..ab31ad21 --- /dev/null +++ b/docs/wiki/oelint.bbclass.underscores.md @@ -0,0 +1,17 @@ +# oelint.bbclass.underscores + +severity: error + +## Example + +`my-class.bbclass` + +## Why is this bad? + +Bitbake tries to create shell and/or python functions out of the base name of the class when +using ``EXPORT_FUNCTIONS`` in this particular class. +``-`` is unfortunately not a valid symbol in neither shell nor python. + +## Ways to fix it + +Use ``_`` instead of ``-`` in the filename. diff --git a/docs/wiki/oelint.exportfunction.dash.md b/docs/wiki/oelint.exportfunction.dash.md new file mode 100644 index 00000000..f3514837 --- /dev/null +++ b/docs/wiki/oelint.exportfunction.dash.md @@ -0,0 +1,23 @@ +# oelint.exportfunction.dash + +severity: error + +## Example + +In ``my_class.bbclass`` + +``` +EXPORT_FUNCTIONS my_class_do-install +``` + +## Why is this bad? + +Bitbake tries to create shell and/or python functions out of the base name of the class when +using ``EXPORT_FUNCTIONS``. +``-`` is unfortunately not a valid symbol in neither shell nor python. + +## Ways to fix it + +``` +EXPORT_FUNCTIONS my_class_do_install +``` diff --git a/docs/wiki/oelint.file.inactiveupstreamdetails.md b/docs/wiki/oelint.file.inactiveupstreamdetails.md new file mode 100644 index 00000000..6f922398 --- /dev/null +++ b/docs/wiki/oelint.file.inactiveupstreamdetails.md @@ -0,0 +1,40 @@ +# oelint.file.inactiveupstreamdetails + +severity: info + +## Example + +With `my.patch` + +``` +Upstream-Status: Inactive-Upstream +``` + +or + +``` +Upstream-Status: Inactive-Upstream [1234] +``` + +## Why is this bad? + +``Inactive-Upstream`` shall name a timestamp when the last activity was seen upstream, +see former [OpenEmbedded contribution guide](https://www.openembedded.org/index.php?title=Commit_Patch_Message_Guidelines&oldid=10935) + +## Ways to fix it + +``` +Inactive-Upstream [lastcommit: 11.11.2011] +``` + +or + +``` +Inactive-Upstream [lastrelease: 11.11.2011] +``` + +or even + +``` +Inactive-Upstream [lastcommit: 11.11.2011, lastrelease: 11.11.2011] +``` diff --git a/docs/wiki/oelint.file.inappropriatemsg.md b/docs/wiki/oelint.file.inappropriatemsg.md new file mode 100644 index 00000000..cea773e3 --- /dev/null +++ b/docs/wiki/oelint.file.inappropriatemsg.md @@ -0,0 +1,50 @@ +# oelint.file.inappropriatemsg + +severity: info + +## Example + +With `my.patch` + +``` +Upstream-Status: Inappropriate [me don't care] +``` + +or + +``` +Upstream-Status: Inappropriate +``` + +or + +``` +Upstream-Status: Inappropriate (configuration) +``` + +## Why is this bad? + +``Inappropriate`` will create technical debt, as the will never be merged upstream, +so labelling why this patch is needed is essential for tracking. +See [OpenEmbedded contribution guide](https://www.openembedded.org/index.php?title=Commit_Patch_Message_Guidelines&oldid=10935) + +## Ways to fix it + +``` +Inappropriate [licensing] +``` + +or any other reason in the square brackets from the following list + +- oe-specific +- OE specific +- oe-core specific +- not author +- native +- configuration +- enable feature +- disable feature +- bugfix .* +- embedded specific +- no upstream +- other diff --git a/docs/wiki/oelint.file.includenotfound.md b/docs/wiki/oelint.file.includenotfound.md new file mode 100644 index 00000000..2d9ceb39 --- /dev/null +++ b/docs/wiki/oelint.file.includenotfound.md @@ -0,0 +1,35 @@ +# oelint.file.includenotfound + +severity: warning + +## Example + +``` +include this/file/does/not/exist.inc +``` + +or + +``` +include a/file/from/another/layer.inc +``` + + +## Why is this bad? + +If the an include file doesn't reside in the same layer, it creates an external dependency on something +that is likely beyond the control of the layer. +It will create breakage if the other layer changes the name and/or the path of the include file. + +Or the include simply doesn't exit at all. + +## Ways to fix it + +Fix the include path or + +``` +# noelint: oelint.file.includenotfound +include a/file/from/another/layer.inc +``` + +in case the include file is from another layer. diff --git a/docs/wiki/oelint.file.includerelpath.md b/docs/wiki/oelint.file.includerelpath.md new file mode 100644 index 00000000..f019d96c --- /dev/null +++ b/docs/wiki/oelint.file.includerelpath.md @@ -0,0 +1,23 @@ +# oelint.file.includerelpath + +severity: warning + +## Example + +``` +include ../../include-file.inc +``` + +## Why is this bad? + +This makes assumptions about the layout, how layers are stored on the storage of the local +workspace. +If now someone places the files in a different layout, the include will be broken. + +## Ways to fix it + +Use a relative path from the layer root instead + +``` +include recipes-something/some-path/include-file.inc +``` diff --git a/docs/wiki/oelint.file.inlinesuppress_na.md b/docs/wiki/oelint.file.inlinesuppress_na.md new file mode 100644 index 00000000..3f883402 --- /dev/null +++ b/docs/wiki/oelint.file.inlinesuppress_na.md @@ -0,0 +1,23 @@ +# oelint.file.inlinesuppress_na + +severity: info + +## Example + +``` +# nooelint: some.warning +A = "1" +``` + +## Why is this bad? + +A warning couldn't be reproduced from the line in question, meaning that there is no warning of the +specified ID. + +## Ways to fix it + +remove the ``nooelint`` line + +``` +A = "1" +``` diff --git a/docs/wiki/oelint.file.nospaces.md b/docs/wiki/oelint.file.nospaces.md new file mode 100644 index 00000000..88341901 --- /dev/null +++ b/docs/wiki/oelint.file.nospaces.md @@ -0,0 +1,15 @@ +# oelint.file.nospaces + +severity: error + +## Example + +File ``/some/file/with/a /space/ in /its/path.bb`` + +## Why is this bad? + +Bitbake doesn't support spaces at any place in the absolute file path. + +## Ways to fix it + +Rename to ``/some/file/with/a_/space/_in_/its/path.bb`` diff --git a/docs/wiki/oelint.file.patchsignedoff.md b/docs/wiki/oelint.file.patchsignedoff.md new file mode 100644 index 00000000..e468fcfb --- /dev/null +++ b/docs/wiki/oelint.file.patchsignedoff.md @@ -0,0 +1,26 @@ +# oelint.file.inappropriatemsg + +severity: info + +## Example + +With `my.patch` + +``` +Signed-off-by: some body +``` + +is missing + +## Why is this bad? + +Every upstreamable patch should have a ``Signed-off-by`` line. +See [OpenEmbedded contribution guide](https://www.openembedded.org/index.php?title=Commit_Patch_Message_Guidelines&oldid=10935) + +## Ways to fix it + +Add to the patch file + +``` +Signed-off-by: some body +``` diff --git a/docs/wiki/oelint.file.requireinclude.md b/docs/wiki/oelint.file.requireinclude.md new file mode 100644 index 00000000..07483ac1 --- /dev/null +++ b/docs/wiki/oelint.file.requireinclude.md @@ -0,0 +1,29 @@ +# oelint.file.requireinclude + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +include some-include-file.inc +``` + +## Why is this bad? + +``include`` statement fail silently is the file is not found. +``require`` will fail if the file hasn't been found. + +## Ways to fix it + +``` +require some-include-file.inc +``` + +or if that is indented behavior + +``` +# nooelint: oelint.file.requireinclude +include some-include-file.inc +``` diff --git a/docs/wiki/oelint.file.requirenotfound.md b/docs/wiki/oelint.file.requirenotfound.md new file mode 100644 index 00000000..9b40a924 --- /dev/null +++ b/docs/wiki/oelint.file.requirenotfound.md @@ -0,0 +1,35 @@ +# oelint.file.includenotfound + +severity: warning + +## Example + +``` +require this/file/does/not/exist.inc +``` + +or + +``` +require a/file/from/another/layer.inc +``` + + +## Why is this bad? + +If the an include file doesn't reside in the same layer, it creates an external dependency on something +that is likely beyond the control of the layer. +It will create breakage if the other layer changes the name and/or the path of the include file. + +Or the include simply doesn't exit at all. + +## Ways to fix it + +Fix the include path or + +``` +# noelint: oelint.file.includenotfound +require a/file/from/another/layer.inc +``` + +in case the include file is from another layer. diff --git a/docs/wiki/oelint.file.underscores.md b/docs/wiki/oelint.file.underscores.md new file mode 100644 index 00000000..1efcca48 --- /dev/null +++ b/docs/wiki/oelint.file.underscores.md @@ -0,0 +1,22 @@ +# oelint.file.underscores + +severity: error + +## Example + +``my_recipe_1.0.bb`` + +or + +``my-recipe.bb`` + +## Why is this bad? + +Bitbake's version detection takes the last chunk after a ``_`` of the filename as the default version. +If not present ``1.0`` is assumed, so any updates to the recipe might not result in a rebuild of the recipe. + +## Ways to fix it + +rename to + +``my-recipe_1.0.bb`` diff --git a/docs/wiki/oelint.file.upstreamstatus.md b/docs/wiki/oelint.file.upstreamstatus.md new file mode 100644 index 00000000..ba732e82 --- /dev/null +++ b/docs/wiki/oelint.file.upstreamstatus.md @@ -0,0 +1,26 @@ +# oelint.file.upstreamstatus + +severity: info + +## Example + +With `my.patch` + +``` +Upstream-Status: reason +``` + +is missing or not classified properly + +## Why is this bad? + +Every patch should have a ``Upstream-Status`` line. +See [OpenEmbedded contribution guide](https://www.openembedded.org/index.php?title=Commit_Patch_Message_Guidelines&oldid=10935) + +## Ways to fix it + +Add to the patch file + +``` +Upstream-Status: reason +``` diff --git a/docs/wiki/oelint.func.specific.md b/docs/wiki/oelint.func.specific.md new file mode 100644 index 00000000..de2f1475 --- /dev/null +++ b/docs/wiki/oelint.func.specific.md @@ -0,0 +1,37 @@ +# oelint.func.specific + +severity: error + +## Example + +``` +do_install:append:fooarch() { + abc +} +``` + +or + +``` +do_install:qemuall () { + cp -r ${B}/testsuite ${D}${PTEST_PATH}/ + cp ${B}/.config ${D}${PTEST_PATH}/ + ln -s /bin/busybox ${D}${PTEST_PATH}/busybox +} +``` + +## Why is this bad? + +The override item should be known from either ``MACHINE``, ``MACHINEOVERRIDES``, ``PACKAGES`` or ``DISTRO``, otherwise +there is a high chance that the function will never get run. + +## Ways to fix it + +Use a known override - See the corresponding [README section](https://github.com/priv-kweihmann/oelint-adv#configure-your-custom-machine-or-distro-settings) or +if it's a ``PACKAGE`` set + +``` +PACKAGE_BEFORE_PN += "${PN}-mypackage" + +FILES:${PN}-mypackage += "some/file" +``` diff --git a/docs/wiki/oelint.jetm.vars.dependssingleline.md b/docs/wiki/oelint.jetm.vars.dependssingleline.md new file mode 100644 index 00000000..4e151851 --- /dev/null +++ b/docs/wiki/oelint.jetm.vars.dependssingleline.md @@ -0,0 +1,22 @@ +# oelint.jetm.vars.dependssingleline + +severity: warning + +## Example + +``` +DEPENDS = "foo bar" +``` + +## Why is this bad? + +Writing each ``DEPENDS`` or ``RDEPENDS`` item on a single line enables using ``grep`` to search a local file tree. + +## Ways to fix it + +Write every item on a single line + +``` +DEPENDS = "foo" +DEPENDS += "bar" +``` diff --git a/docs/wiki/oelint.newline.consecutive.md b/docs/wiki/oelint.newline.consecutive.md new file mode 100644 index 00000000..cc46ee94 --- /dev/null +++ b/docs/wiki/oelint.newline.consecutive.md @@ -0,0 +1,26 @@ +# oelint.newline.consecutive + +severity: warning + +## Example + +``` +A = "2" + + +B = "1" +``` + +## Why is this bad? + +Consecutive empty lines decrease readability and do not add any additional value. + +## Ways to fix it + +Remove the empty lines + +``` +A = "2" + +B = "1" +``` diff --git a/docs/wiki/oelint.newline.eof.md b/docs/wiki/oelint.newline.eof.md new file mode 100644 index 00000000..65fdf2a3 --- /dev/null +++ b/docs/wiki/oelint.newline.eof.md @@ -0,0 +1,21 @@ +# oelint.newline.eof + +severity: warning + +## Example + +``` +A = "2" +``` + +## Why is this bad? + +The file should end on a blank line. + +## Ways to fix it + +Add a new blank line at the end of the file + +``` +A = "2" +``` diff --git a/docs/wiki/oelint.spaces.emptyline.md b/docs/wiki/oelint.spaces.emptyline.md new file mode 100644 index 00000000..4c6c7c96 --- /dev/null +++ b/docs/wiki/oelint.spaces.emptyline.md @@ -0,0 +1,23 @@ +# oelint.spaces.emptyline + +severity: warning + +## Example + +``` +A = "2" + +B = "2" +``` + +## Why is this bad? + +Spaces or tabs in empty lines do not add any additional value. + +## Ways to fix it + +``` +A = "2" + +B = "2" +``` diff --git a/docs/wiki/oelint.spaces.linebeginning.md b/docs/wiki/oelint.spaces.linebeginning.md new file mode 100644 index 00000000..59a5fcfe --- /dev/null +++ b/docs/wiki/oelint.spaces.linebeginning.md @@ -0,0 +1,21 @@ +# oelint.spaces.linebeginning + +severity: warning + +## Example + +``` + A = "2" +``` + +## Why is this bad? + +Spaces or tabs at the beginning of a newline decrease readability and do not add value. + +## Ways to fix it + +Remove the leading spaces + +``` +A = "2" +``` \ No newline at end of file diff --git a/docs/wiki/oelint.spaces.linecont.md b/docs/wiki/oelint.spaces.linecont.md new file mode 100644 index 00000000..f3c8ce39 --- /dev/null +++ b/docs/wiki/oelint.spaces.linecont.md @@ -0,0 +1,28 @@ +# oelint.spaces.linecont + +severity: error + +## Example + +``` +A = "\ + 1 \ + 2 \ +" +``` + +## Why is this bad? + +Space(s) after the line continuation character ``\`` should be avoided. +They do not add value and have been an illegal syntax in some versions of bitbake. + +## Ways to fix it + +Remove all spaces after the line continuation character ``\`` + +``` +A = "\ + 1 \ + 2 \ +" +``` diff --git a/docs/wiki/oelint.spaces.lineend.md b/docs/wiki/oelint.spaces.lineend.md new file mode 100644 index 00000000..d4e15a34 --- /dev/null +++ b/docs/wiki/oelint.spaces.lineend.md @@ -0,0 +1,19 @@ +# oelint.spaces.lineend + +severity: warning + +## Example + +``` +A = "2" +``` + +## Why is this bad? + +Additional spaces at the end of a line do not add value, they should be avoided. + +## Ways to fix it + +``` +A = "2" +``` diff --git a/docs/wiki/oelint.tabs.notabs.md b/docs/wiki/oelint.tabs.notabs.md new file mode 100644 index 00000000..eba00980 --- /dev/null +++ b/docs/wiki/oelint.tabs.notabs.md @@ -0,0 +1,26 @@ +# oelint.tabs.notabs + +severity: warning + +## Example + +``` +A = "\ +1 \ +" +``` + +## Why is this bad? + +The [Yocto project style guide](https://docs.yoctoproject.org/contributor-guide/recipe-style-guide.html#variable-formatting) discourages the +use of tabs. + +## Ways to fix it + +Use spaces instead + +``` +A = "\ +1 \ +" +``` diff --git a/docs/wiki/oelint.task.addnotaskbody.md b/docs/wiki/oelint.task.addnotaskbody.md new file mode 100644 index 00000000..c677096c --- /dev/null +++ b/docs/wiki/oelint.task.addnotaskbody.md @@ -0,0 +1,38 @@ +# oelint.task.addnotaskbody + +severity: warning + +## Example + +``` +do_foo() { + +} +addtask do_foo +``` + +## Why is this bad? + +A task without code is considered illegal syntax. + +## Ways to fix it + +Fill the task with code instructions + +``` +do_foo() { + call some code here +} +addtask do_foo +``` + +or add + +``` +do_foo() { + : +} +addtask do_foo +``` + +to indicate any empty task diff --git a/docs/wiki/oelint.task.customorder.md b/docs/wiki/oelint.task.customorder.md new file mode 100644 index 00000000..e9554abd --- /dev/null +++ b/docs/wiki/oelint.task.customorder.md @@ -0,0 +1,39 @@ +# oelint.task.customorder + +severity: error + +## Example + +``` +do_bar() { + : +} + +addtask do_bar after compile before configure +``` + +## Why is this bad? + +The task creates a cyclic or illogical dependency between tasks. + +## Ways to fix it + +The common order of functions is + +- do_fetch +- do_unpack +- do_patch +- do_configure +- do_compile +- do_install +- do_package + +make sure setup the custom task to fit into this sequential order + +``` +do_bar() { + : +} + +addtask do_bar after compile before do_package +``` diff --git a/docs/wiki/oelint.task.dash.md b/docs/wiki/oelint.task.dash.md new file mode 100644 index 00000000..2a61166b --- /dev/null +++ b/docs/wiki/oelint.task.dash.md @@ -0,0 +1,26 @@ +# oelint.task.dash + +severity: error + +## Example + +``` +do_my-task() { + : +} +``` + +## Why is this bad? + +As bitbake renders the task into python or shell functions we can't use ``-`` in the name, as this is +an illegal character for the shell and python interpreter + +## Ways to fix it + +Use ``_`` instead + +``` +do_my_task() { + : +} +``` diff --git a/docs/wiki/oelint.task.docstrings.md b/docs/wiki/oelint.task.docstrings.md new file mode 100644 index 00000000..ee6e928e --- /dev/null +++ b/docs/wiki/oelint.task.docstrings.md @@ -0,0 +1,27 @@ +# oelint.task.docstrings + +severity: info + +## Example + +``` +do_my_task() { + : +} +addtask do_my_task +``` + +## Why is this bad? + +Every custom task should have a docstring set, so users get more information about the use of this task. +Also it is very helpful information for ``bitbake -c listtasks``. + +## Ways to fix it + +``` +do_my_task() { + : +} +addtask do_my_task +do_my_task[doc] = "This is my custom task, doing something magical" +``` diff --git a/docs/wiki/oelint.task.heredocs.md b/docs/wiki/oelint.task.heredocs.md new file mode 100644 index 00000000..4356faee --- /dev/null +++ b/docs/wiki/oelint.task.heredocs.md @@ -0,0 +1,34 @@ +# oelint.task.heredocs + +severity: warning + +## Example + +``` +do_foo() { + cat > ${D}/some.files << EOF + kfkdfkd + EOF +} +``` + +## Why is this bad? + +Use of [heredocs](https://en.wikipedia.org/wiki/Here_document) creates a file with the permissions and +filemode bits of the current user running bitbake. +These could differ between users of the same recipe, leading to unpredictable results. + +In addition heredocs are hard to read. + +## Ways to fix it + +create a file with the desired content, or make sure that the correct user and the correct +permissions are set using ``chown`` and ``install`` + +``` +do_foo() { + echo "kfkdfkd" > ${T}/some.files + chown root:root ${T}/some.files + install -m 0644 ${T}/some.files ${D}/some.files +} +``` diff --git a/docs/wiki/oelint.task.multifragments.md b/docs/wiki/oelint.task.multifragments.md new file mode 100644 index 00000000..3a6bdfdd --- /dev/null +++ b/docs/wiki/oelint.task.multifragments.md @@ -0,0 +1,27 @@ +# oelint.task.multifragments + +severity: info + +## Example + +``` +do_install:append() { + a +} +do_install:append() { + b +} +``` + +## Why is this bad? + +Multiple appends, removes, prepends, a.s.o. should be merged into a single append, remove, prepend for better readability. + +## Ways to fix it + +``` +do_install:append() { + a + b +} +``` diff --git a/docs/wiki/oelint.task.noanonpython.md b/docs/wiki/oelint.task.noanonpython.md new file mode 100644 index 00000000..17a4c397 --- /dev/null +++ b/docs/wiki/oelint.task.noanonpython.md @@ -0,0 +1,38 @@ +# oelint.task.noanonpython + +severity: warning + +## Example + +``` +python __anonymous() { + print("foo") +} +``` + +or + +``` +python () { + print("bar") +} +``` + +## Why is this bad? + +Anonymous python functions are run every time the recipe is parsed. +This is expensive in terms of computing. +In addition, as the functions are run last in the parsing process, they can be full of side-effects and are +hard to debug. + +## Ways to fix it + +Turn into a separate function + +``` +python do_mytask() { + print("foo") +} + +addtask do_mytask before configure +``` diff --git a/docs/wiki/oelint.task.nocopy.md b/docs/wiki/oelint.task.nocopy.md new file mode 100644 index 00000000..11a8bf55 --- /dev/null +++ b/docs/wiki/oelint.task.nocopy.md @@ -0,0 +1,25 @@ +# oelint.task.nocopy + +severity: error + +## Example + +``` +do_install() { + cp ${WORKDIR}/foo ${D}/foo +} +``` + +## Why is this bad? + +``cp`` uses the current user's settings for default permissions, which can differ across multiple users. + +## Ways to fix it + +Use ``install`` instead + +``` +do_install() { + install ${WORKDIR}/foo ${D}/foo +} +``` diff --git a/docs/wiki/oelint.task.nomkdir.md b/docs/wiki/oelint.task.nomkdir.md new file mode 100644 index 00000000..cbfe5c19 --- /dev/null +++ b/docs/wiki/oelint.task.nomkdir.md @@ -0,0 +1,26 @@ +# oelint.task.nomkdir + +severity: error + +## Example + +``` +do_install() { + mkdir -p ${D}/foo +} +``` + +## Why is this bad? + +``mkdir`` uses the current user's settings for default permissions, which can differ across multiple users. + +## Ways to fix it + +Use ``install -d`` instead + +``` +do_install() { + install -d ${D}/foo +} +``` + diff --git a/docs/wiki/oelint.task.nopythonprefix.md b/docs/wiki/oelint.task.nopythonprefix.md new file mode 100644 index 00000000..e32ed93d --- /dev/null +++ b/docs/wiki/oelint.task.nopythonprefix.md @@ -0,0 +1,26 @@ +# oelint.task.nopythonprefix + +severity: warning + +## Example + +``` +python do_foo() { + install -d ${D}/something + ./configure +} +``` + +## Why is this bad? + +Tasks that contain shell code should not be prefixed by ``python``, as bitbake would run +the code through the python interpreter. + +## Ways to fix it + +``` +do_foo() { + install -d ${D}/something + ./configure +} +``` diff --git a/docs/wiki/oelint.task.order.md b/docs/wiki/oelint.task.order.md new file mode 100644 index 00000000..c0fd0c75 --- /dev/null +++ b/docs/wiki/oelint.task.order.md @@ -0,0 +1,43 @@ +# oelint.task.order + +severity: warning + +## Example + +``` +do_compile() { + : +} + +do_unpack() { + : +} +``` + +## Why is this bad? + +For better readability the tasks should be written in a particular order. + +## Ways to fix it + +Write the tasks in the following order + +- do_fetch +- do_unpack +- do_patch +- do_configure +- do_compile +- do_install +- do_populate_sysroot +- do_build +- do_package + +``` +do_unpack() { + : +} + +do_compile() { + : +} +``` diff --git a/docs/wiki/oelint.task.pythonprefix.md b/docs/wiki/oelint.task.pythonprefix.md new file mode 100644 index 00000000..53440837 --- /dev/null +++ b/docs/wiki/oelint.task.pythonprefix.md @@ -0,0 +1,26 @@ +# oelint.task.pythonprefix + +severity: warning + +## Example + +``` +do_foo() { + import os + print(os.getcwd()) +} +``` + +## Why is this bad? + +Tasks that contain python code should be prefixed by ``python``, as bitbake would run +the code through the shell interpreter instead. + +## Ways to fix it + +``` +python do_foo() { + import os + print(os.getcwd()) +} +``` diff --git a/docs/wiki/oelint.var.addpylib.md b/docs/wiki/oelint.var.addpylib.md new file mode 100644 index 00000000..870c0bab --- /dev/null +++ b/docs/wiki/oelint.var.addpylib.md @@ -0,0 +1,19 @@ +# oelint.var.addpylib + +severity: error + +## Example + +in ``my-recipe_1.0.bb`` + +``` +addpylib ${LAYERDIR}/foo a +``` + +## Why is this bad? + +The ``addpylib`` statement is only valid in ``.conf`` files, such as ``distro.conf`` and ``layer.conf`` + +## Ways to fix it + +Remove the statement and if needed move it to ``layer.conf`` diff --git a/docs/wiki/oelint.var.bbclassextend.md b/docs/wiki/oelint.var.bbclassextend.md new file mode 100644 index 00000000..86900b5d --- /dev/null +++ b/docs/wiki/oelint.var.bbclassextend.md @@ -0,0 +1,23 @@ +# oelint.var.bbclassextend + +severity: info + +## Example + +In ``my-recipe_1.0.bb`` + +``` +A = "2" +``` + +## Why is this bad? + +To allow the use in the SDK or as a ``native`` variant ``BBCLASSEXTEND`` should be set. + +## Ways to fix it + +``` +A = "2" + +BBCLASSEXTEND = "native nativesdk" +``` diff --git a/docs/wiki/oelint.var.filesoverride.md b/docs/wiki/oelint.var.filesoverride.md new file mode 100644 index 00000000..fd7dd1db --- /dev/null +++ b/docs/wiki/oelint.var.filesoverride.md @@ -0,0 +1,24 @@ +# oelint.var.filesoverride + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +FILES:${PN} = " foo" +``` + +## Why is this bad? + +Override of ``FILES`` can lead to files accidentally installed into a different than the desired package. +Do not override the default of Yocto/OE. + +## Ways to fix it + +Append instead + +``` +FILES:${PN} += " foo" +``` diff --git a/docs/wiki/oelint.var.improperinherit.md b/docs/wiki/oelint.var.improperinherit.md new file mode 100644 index 00000000..99334aa5 --- /dev/null +++ b/docs/wiki/oelint.var.improperinherit.md @@ -0,0 +1,27 @@ +# oelint.var.improperinherit + +severity: error + +## Example + +``` +inherit abc/abc +``` + +or + +``` +inherit def~AAAA +``` + +## Why is this bad? + +``inherit`` statements only support [A-Za-z0-9-_] characters + +## Ways to fix it + +Avoid unsupported characters + +``` +inherit abc +``` diff --git a/docs/wiki/oelint.var.licenseremotefile.md b/docs/wiki/oelint.var.licenseremotefile.md new file mode 100644 index 00000000..df78133a --- /dev/null +++ b/docs/wiki/oelint.var.licenseremotefile.md @@ -0,0 +1,24 @@ +# oelint.var.licenseremotefile + +severity: warning + +## Example + +``` +LIC_FILES_CHKSUM = "file://${COMMON_LIC_DIR}/MIT;md5=sjdjasdjhddh" +``` + +## Why is this bad? + +This works around the license detection. +Changes in LICENSE won't be found in that case. +Also this is prone to setting the wrong LICENSE in the recipe. + +## Ways to fix it + +Get in touch with the maintainer of the source code and ask them to ship a proper license file with +the release. Alternatively use a ``git://`` fetcher instead of downloading an archive. + +``` +LIC_FILES_CHKSUM = "file://LICENSE;md5=sjdjasdjhddh" +``` diff --git a/docs/wiki/oelint.var.mandatoryvar.md b/docs/wiki/oelint.var.mandatoryvar.md new file mode 100644 index 00000000..f7cae1ca --- /dev/null +++ b/docs/wiki/oelint.var.mandatoryvar.md @@ -0,0 +1,34 @@ +# oelint.var.mandatoryvar + +severity: error + +## Example + +In ``my-recipe_1.0.bb`` + +``` +A = "1" +``` + +## Why is this bad? + +Some variables should be always set to have more information about the purpose, license and origin of the sources +that this recipe is using. + +## Ways to fix it + +The following variables should always be set in the recipe + +- SUMMARY +- DESCRIPTION +- HOMEPAGE +- LICENSE +- SRC_URI + +``` +SUMMARY = "My recipe" +DESCRIPTION = "My recipe that does all the magic" +HOMEPAGE = "https://my-homepage.com" +LICENSE = "MIT" +SRC_URI = "https://my-homepage.com/foo_${PV}.zip" +``` diff --git a/docs/wiki/oelint.var.multiinclude.md b/docs/wiki/oelint.var.multiinclude.md new file mode 100644 index 00000000..e24e335c --- /dev/null +++ b/docs/wiki/oelint.var.multiinclude.md @@ -0,0 +1,25 @@ +# oelint.var.multiinclude + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +include abc.inc +include abc.inc +``` + +## Why is this bad? + +Including the same file more than once, doesn't add value and likely will modify variables and functions multiple times, +leading all kinds of undesired effects. + +## Ways to fix it + +Only include the same file once + +``` +include abc.inc +``` diff --git a/docs/wiki/oelint.var.multiinherit.md b/docs/wiki/oelint.var.multiinherit.md new file mode 100644 index 00000000..6db66ccf --- /dev/null +++ b/docs/wiki/oelint.var.multiinherit.md @@ -0,0 +1,25 @@ +# oelint.var.multiinherit + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +inherit abc +inherit abc +``` + +## Why is this bad? + +Inheriting the same file more than once, doesn't add value and likely will modify variables and functions multiple times, +leading all kinds of undesired effects. + +## Ways to fix it + +Only inherit the same file once + +``` +inherit abc +``` diff --git a/docs/wiki/oelint.var.nativefilename.md b/docs/wiki/oelint.var.nativefilename.md new file mode 100644 index 00000000..5125cd2f --- /dev/null +++ b/docs/wiki/oelint.var.nativefilename.md @@ -0,0 +1,20 @@ +# oelint.var.nativefilename + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +inherit native +``` + +## Why is this bad? + +``native`` only recipes should have ``-native`` in their filename. +This makes it much easier to identify them. + +## Ways to fix it + +Rename the file to ``my-recipe-native_1.0.bb`` diff --git a/docs/wiki/oelint.var.nativesdkfilename.md b/docs/wiki/oelint.var.nativesdkfilename.md new file mode 100644 index 00000000..6461fc2d --- /dev/null +++ b/docs/wiki/oelint.var.nativesdkfilename.md @@ -0,0 +1,20 @@ +# oelint.var.nativesdkfilename + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +inherit nativesdk +``` + +## Why is this bad? + +``nativesdk`` only recipes should have ``nativesdk-`` in their filename. +This makes it much easier to identify them. + +## Ways to fix it + +Rename the file to ``nativesdk-my-recipe_1.0.bb`` diff --git a/docs/wiki/oelint.var.order.md b/docs/wiki/oelint.var.order.md new file mode 100644 index 00000000..b33ac7a1 --- /dev/null +++ b/docs/wiki/oelint.var.order.md @@ -0,0 +1,58 @@ +# oelint.var.order + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +inherit cmake + +SRCREV = "f161ebd29699d93411cec0915c5133c0f3229a28" +SRC_URI = "git://some.repo.com/repo.git" +``` + +## Why is this bad? + +For readability and to avoid situations where immediate variable expansion is used (``:=`` operator), variables should be +set in the defined order. + +## Ways to fix it + +Variables should be set in the following order + +- SUMMARY +- DESCRIPTION +- AUTHOR +- HOMEPAGE +- BUGTRACKER +- SECTION +- LICENSE +- LIC_FILES_CHKSUM +- DEPENDS +- PROVIDES +- PV +- SRC_URI +- SRCREV +- S +- inherit +- PACKAGECONFIG +- EXTRA_QMAKEVARS_POST +- EXTRA_OECONF +- PACKAGE_ARCH +- PACKAGES +- FILES +- RDEPENDS +- RRECOMMENDS +- RSUGGESTS +- RPROVIDES +- RCONFLICTS +- BBCLASSEXTEND + +``` +SRC_URI = "git://some.repo.com/repo.git" +SRCREV = "f161ebd29699d93411cec0915c5133c0f3229a28" + +inherit cmake +``` diff --git a/docs/wiki/oelint.var.override.md b/docs/wiki/oelint.var.override.md new file mode 100644 index 00000000..e73c88de --- /dev/null +++ b/docs/wiki/oelint.var.override.md @@ -0,0 +1,38 @@ +# oelint.var.override + +severity: error + +## Example + +``` +A = "2" + +include foo.inc + +A = "3" +``` + +## Why is this bad? + +If in between hard variable assignments an immediate variable expansion is used (``:=`` operator) the value of ``A`` would be different +at different stages of the recipe, rendering the value unpredictable + +## Ways to fix it + +Avoid multiple hard assignments of the same variable. + +``` +A = "2" + +include foo.inc +``` + +alternatively use weak assignments + +``` +A ?= "2" + +include foo.inc + +A = "3" +``` diff --git a/docs/wiki/oelint.var.rootfspostcmd.md b/docs/wiki/oelint.var.rootfspostcmd.md new file mode 100644 index 00000000..7155a2b2 --- /dev/null +++ b/docs/wiki/oelint.var.rootfspostcmd.md @@ -0,0 +1,22 @@ +# oelint.var.rootfspostcmd + +severity: warning + +## Example + +In ``my-image.bb`` + +``` +ROOTFS_POSTPROCESS_COMMAND += "abc; adef ;;" +``` + +## Why is this bad? + +Do not leave extra spaces between the function name and ``;``, these can cause that appends to the image, can remove the +function anymore + +## Ways to fix it + +``` +ROOTFS_POSTPROCESS_COMMAND += "abc; adef;;" +``` diff --git a/docs/wiki/oelint.var.srcuriwildcard.md b/docs/wiki/oelint.var.srcuriwildcard.md new file mode 100644 index 00000000..2a8970a3 --- /dev/null +++ b/docs/wiki/oelint.var.srcuriwildcard.md @@ -0,0 +1,23 @@ +# oelint.var.srcuriwildcard + +severity: error + +## Example + +In ``my-recipe_1.0.bb`` + +``` +SRC_URI = "file://*" +``` + +## Why is this bad? + +File wildcards are discouraged, as bitbake might not see changes to the directory, thus missing out on rebuilds. + +## Ways to fix it + +Use a fixed list of files + +``` +SRC_URI = "file://file1 file://file2" +``` diff --git a/docs/wiki/oelint.var.suggestedvar.md b/docs/wiki/oelint.var.suggestedvar.md new file mode 100644 index 00000000..fc0a577a --- /dev/null +++ b/docs/wiki/oelint.var.suggestedvar.md @@ -0,0 +1,35 @@ +# oelint.var.suggestedvar + +severity: info + +## Example + +In ``my-recipe_1.0.bb`` + +``` +A = "2" +``` + +## Why is this bad? + +A few variables are suggested to be added, as it adds more information what the recipe is about. +In terms of ``CVE_PRODUCT`` it also helps to avoid false positives of the CVE check functionality. + +## Ways to fix it + +The following variables are suggested to be added to each recipe + +- AUTHOR +- BUGTRACKER +- BBCLASSEXTEND +- CVE_PRODUCT +- SECTION + +``` +AUTHOR = "me " +BUGTRACKER = "https://my-homepage/issues" +CVE_PRODUCT = "me/lib" +SECTION = "graphics" + +BBCLASSEXTEND = "native" +``` diff --git a/docs/wiki/oelint.vars.appendop.md b/docs/wiki/oelint.vars.appendop.md new file mode 100644 index 00000000..b4e2488d --- /dev/null +++ b/docs/wiki/oelint.vars.appendop.md @@ -0,0 +1,25 @@ +# oelint.vars.appendop + +severity: error + +## Example + +In ``my-recipe_1.0.bb`` + +``` +A ??= "1" +A += "2" +``` + +## Why is this bad? + +When using weak defines in combination with ``+=`` the latter operation overwrite the entire value of ``A`` + +## Ways to fix it + +Use ``append`` instead + +``` +A ??= "1" +A:append = " 2" +``` diff --git a/docs/wiki/oelint.vars.autorev.md b/docs/wiki/oelint.vars.autorev.md new file mode 100644 index 00000000..a91dbba5 --- /dev/null +++ b/docs/wiki/oelint.vars.autorev.md @@ -0,0 +1,24 @@ +# oelint.vars.autorev + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +SRCREV = "${AUTOREV}" +``` + +## Why is this bad? + +``AUTOREV`` will pull always the latest commit, breaking reproducible builds in general. +The usage is discouraged in general other than for local experiments. + +## Ways to fix it + +Use a fixed revision + +``` +SRCREV = "e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e" +``` diff --git a/docs/wiki/oelint.vars.bbvars.md b/docs/wiki/oelint.vars.bbvars.md new file mode 100644 index 00000000..a19baa72 --- /dev/null +++ b/docs/wiki/oelint.vars.bbvars.md @@ -0,0 +1,94 @@ +# oelint.vars.bbvars + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +BBDEBUG = "1" +``` + +## Why is this bad? + +A set of variable from bitbake should only be set in ``local.conf`` or ``distro.conf``, as they need to be set +globally. +They do not have the desired effect when set in a recipe. + +## Ways to fix it + +Remove the usage of the following variable from recipes + +- BB_CONSOLELOG +- BB_CURRENTTASK +- BB_DANGLINGAPPENDS_WARNONLY +- BB_DEFAULT_TASK +- BB_DISKMON_DIRS +- BB_DISKMON_WARNINTERVAL +- BB_ENV_EXTRAWHITE +- BB_ENV_WHITELIST +- BB_FETCH_PREMIRRORONLY +- BB_FILENAME +- BB_GENERATE_MIRROR_TARBALLS +- BB_HASHBASE_WHITELIST +- BB_HASHCHECK_FUNCTION +- BB_HASHCONFIG_WHITELIST +- BB_INVALIDCONF +- BB_LOGFMT +- BB_NICE_LEVEL +- BB_NO_NETWORK +- BB_NUMBER_PARSE_THREADS +- BB_NUMBER_THREADS +- BB_ORIGENV +- BB_PRESERVE_ENV +- BB_RUNFMT +- BB_RUNTASK +- BB_SCHEDULER +- BB_SCHEDULERS +- BB_SETSCENE_DEPVALID +- BB_SETSCENE_VERIFY_FUNCTION +- BB_SIGNATURE_EXCLUDE_FLAGS +- BB_SIGNATURE_HANDLER +- BB_SRCREV_POLICY +- BB_STAMP_POLICY +- BB_STAMP_WHITELIST +- BB_STRICT_CHECKSUM +- BB_TASK_NICE_LEVEL +- BB_TASKHASH +- BB_VERBOSE_LOGS +- BB_WORKERCONTEXT +- BBDEBUG +- BBFILE_COLLECTIONS +- BBFILE_PATTERN +- BBFILE_PRIORITY +- BBFILES +- BBINCLUDED +- BBINCLUDELOGS +- BBINCLUDELOGS_LINES +- BBLAYERS +- BBMASK +- BBPATH +- BBSERVER +- BBVERSIONS +- BITBAKE_UI +- BUILDNAME +- CACHE +- DL_DIR +- FILE +- FILESDIR +- FILESPATH +- INHERIT +- LAYERDEPENDS +- LAYERDIR +- LAYERVERSION +- MIRRORS +- MULTI_PROVIDER_WHITELIST +- PERSISTENT_DIR +- PREFERRED_PROVIDER +- PREFERRED_PROVIDERS +- PREFERRED_VERSION +- PREMIRRORS +- PRSERV_HOST +- STAMP +- TOPDIR diff --git a/docs/wiki/oelint.vars.bugtrackerisurl.md b/docs/wiki/oelint.vars.bugtrackerisurl.md new file mode 100644 index 00000000..90901053 --- /dev/null +++ b/docs/wiki/oelint.vars.bugtrackerisurl.md @@ -0,0 +1,21 @@ +# oelint.vars.bugtrackerisurl + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +BUGTRACKER = "Black board in the kitchen" +``` + +## Why is this bad? + +``BUGTRACKER`` should be a URL, otherwise setting the value doesn't add any value. + +## Ways to fix it + +``` +BUGTRACKER = "https://black-board.kitchen.org" +``` diff --git a/docs/wiki/oelint.vars.dependsappend.md b/docs/wiki/oelint.vars.dependsappend.md new file mode 100644 index 00000000..b11f6578 --- /dev/null +++ b/docs/wiki/oelint.vars.dependsappend.md @@ -0,0 +1,33 @@ +# oelint.vars.dependsappend + +severity: error + +## Example + +In ``my-recipe_1.0.bb`` + +``` +inherit something +DEPENDS = "bar" +``` + +## Why is this bad? + +The ``inherit`` (or ``include`` or ``require``) statement will pull in code that might set ``DEPENDS`` as well. +In the end those setting would be overwritten if ``DEPENDS`` is set after that. + +## Ways to fix it + +Move ``DEPENDS`` before any ``inherit`` or ``include`` or ``require`` statement + +``` +DEPENDS = "bar" +inherit something +``` + +or use + +``` +inherit something +DEPENDS += "bar" +``` diff --git a/docs/wiki/oelint.vars.dependsclass.md b/docs/wiki/oelint.vars.dependsclass.md new file mode 100644 index 00000000..4ca511d2 --- /dev/null +++ b/docs/wiki/oelint.vars.dependsclass.md @@ -0,0 +1,23 @@ +# oelint.vars.dependsclass + +severity: error + +## Example + +In ``my-recipe_1.0.bb`` + +``` +inherit native +DEPENDS = "bar" +``` + +## Why is this bad? + +This would depend on the ``target`` variant of ``bar``, while most likely it should depend on the ``native`` variant. + +## Ways to fix it + +``` +inherit native +DEPENDS = "bar-native" +``` diff --git a/docs/wiki/oelint.vars.dependsordered.md b/docs/wiki/oelint.vars.dependsordered.md new file mode 100644 index 00000000..f07fa77e --- /dev/null +++ b/docs/wiki/oelint.vars.dependsordered.md @@ -0,0 +1,29 @@ +# oelint.vars.dependsordered + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +DEPENDS = "\ + z \ + a \ + f \ +" +``` + +## Why is this bad? + +For better readability (and to avoid added the same value multiple times) ``DEPENDS`` should be ordered alphabetically + +## Ways to fix it + +``` +DEPENDS = "\ + a \ + f \ + z \ +" +``` diff --git a/docs/wiki/oelint.vars.descriptionsame.md b/docs/wiki/oelint.vars.descriptionsame.md new file mode 100644 index 00000000..ccc2eb8f --- /dev/null +++ b/docs/wiki/oelint.vars.descriptionsame.md @@ -0,0 +1,21 @@ +# oelint.vars.descriptionsame + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +SUMMARY = "ABC" +DESCRIPTION = "ABC" +``` + +## Why is this bad? + +``DESCRIPTION`` defaults to ``SUMARRY`` in the standard Yocto project configuration. +No need to set both to the same value. + +## Ways to fix it + +Set ``DESCRIPTION`` to a different value than ``SUMMARY`` or remove ``DESCRIPTION`` entirely. diff --git a/docs/wiki/oelint.vars.descriptiontoobrief.md b/docs/wiki/oelint.vars.descriptiontoobrief.md new file mode 100644 index 00000000..9e2b49bc --- /dev/null +++ b/docs/wiki/oelint.vars.descriptiontoobrief.md @@ -0,0 +1,20 @@ +# oelint.vars.descriptiontoobrief + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +SUMMARY = "ABC" +DESCRIPTION = "AB" +``` + +## Why is this bad? + +``DESCRIPTION`` should give more text than ``SUMMARY`` + +## Ways to fix it + +Set ``DESCRIPTION`` to a longer value than ``SUMMARY`` or remove ``DESCRIPTION`` entirely. diff --git a/docs/wiki/oelint.vars.doublemodify.md b/docs/wiki/oelint.vars.doublemodify.md new file mode 100644 index 00000000..8f9e835c --- /dev/null +++ b/docs/wiki/oelint.vars.doublemodify.md @@ -0,0 +1,30 @@ +# oelint.vars.doublemodify + +severity: error + +## Example + +In ``my-recipe_1.0.bb`` + +``` +A:append += "1" +``` + +## Why is this bad? + +Multiple (potentially conflicting) modify operations to the same variable, do not make sense and can lead to +unpredictable results + +## Ways to fix it + +Use just one modifier at a time + +``` +A:append = " 1" +``` + +or + +``` +A += "1" +``` diff --git a/docs/wiki/oelint.vars.downloadfilename.md b/docs/wiki/oelint.vars.downloadfilename.md new file mode 100644 index 00000000..7e986873 --- /dev/null +++ b/docs/wiki/oelint.vars.downloadfilename.md @@ -0,0 +1,30 @@ +# oelint.vars.downloadfilename + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +SRC_URI += "http://foo.bar/baz.jpg" +``` + +## Why is this bad? + +As the download directory is shared across all builds all artifacts need to be properly versioned. +This makes sure that updates and rebuilds are detected. + +One example is that with version ``1.0`` of the recipe we would download ``baz.jpg`` with a checksum A. +Now we do an upgrade to version ``1.1`` of the recipe leading to checksum B. + +If we now would try to go back to version ``1.0`` the artifact in the download directory would have been +overwritten to version ``1.1``, causing a checksum error while building ``1.0`` again. + +## Ways to fix it + +Add a ``downloadfilename`` including ``PV`` or the hardcoded recipe version + +``` +SRC_URI += "http://foo.bar/baz.jpg;downloadfilename=something.dat.${PV}" +``` diff --git a/docs/wiki/oelint.vars.duplicate.md b/docs/wiki/oelint.vars.duplicate.md new file mode 100644 index 00000000..5cd174d2 --- /dev/null +++ b/docs/wiki/oelint.vars.duplicate.md @@ -0,0 +1,24 @@ +# oelint.vars.duplicate + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +DEPENDS = "foo" +DEPENDS += "foo" +``` + +## Why is this bad? + +There is no need to depend or (r)depend on the same recipe more than once. + +## Ways to fix it + +Remove the duplicates + +``` +DEPENDS = "foo" +``` diff --git a/docs/wiki/oelint.vars.dusageinpkgfuncs.md b/docs/wiki/oelint.vars.dusageinpkgfuncs.md new file mode 100644 index 00000000..0922c157 --- /dev/null +++ b/docs/wiki/oelint.vars.dusageinpkgfuncs.md @@ -0,0 +1,31 @@ +# oelint.vars.dusageinpkgfuncs + +severity: error + +## Example + +In ``my-recipe_1.0.bb`` + +``` +pkg_preinst:${PN} () { + if [ -n "${D}" ]; then + echo "Foo" + fi +} +``` + +## Why is this bad? + +``${D}`` is only known to bitbake, while the ``pkg_*`` function can run on the actual target as well (through package management feature). + +## Ways to fix it + +Use ``$D`` instead + +``` +pkg_preinst:${PN} () { + if [ -n "$D" ]; then + echo "Foo" + fi +} +``` diff --git a/docs/wiki/oelint.vars.fileextrapaths.md b/docs/wiki/oelint.vars.fileextrapaths.md new file mode 100644 index 00000000..7a4a12c0 --- /dev/null +++ b/docs/wiki/oelint.vars.fileextrapaths.md @@ -0,0 +1,21 @@ +# oelint.vars.fileextrapaths + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +FILESEXTRAPATHS:prepend := "${THISDIR}/file" +``` + +## Why is this bad? + +``FILESEXTRAPATHS`` shouldn't be used in a ``bb`` file - please stick to the common folder structure provided by +Yocto/OE configuration instead. +In 99.99999999999% of the cases their is no need to create an additional search path in a recipe. + +## Ways to fix it + +Remove usage of ``FILESEXTRAPATHS`` in ``bb`` files. diff --git a/docs/wiki/oelint.vars.fileextrapathsop.md b/docs/wiki/oelint.vars.fileextrapathsop.md new file mode 100644 index 00000000..cbdf0a20 --- /dev/null +++ b/docs/wiki/oelint.vars.fileextrapathsop.md @@ -0,0 +1,23 @@ +# oelint.vars.fileextrapathsop + +severity: error + +## Example + +In ``my-recipe_%.bbappend`` + +``` +FILESEXTRAPATHS:prepend .= "${THISDIR}/file" +``` + +## Why is this bad? + +``FILESEXTRAPATHS`` needs immediate variable expansion. + +## Ways to fix it + +Always use ``:=`` + +``` +FILESEXTRAPATHS:prepend := "${THISDIR}/file" +``` diff --git a/docs/wiki/oelint.vars.filessetting.md b/docs/wiki/oelint.vars.filessetting.md new file mode 100644 index 00000000..c5f32217 --- /dev/null +++ b/docs/wiki/oelint.vars.filessetting.md @@ -0,0 +1,31 @@ +# oelint.vars.filessetting + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +FILES:${PN} += "${bindir}" + +PACKAGE_BEFORE_PN = "${PN}-mydev" + +FILES:${PN}-mydev += "/some/path" +FILES:${PN}-mydev += "/some/path" +``` + +## Why is this bad? + +Yocto/OE come with a predefined set of values from ``FILES``, so there is no need to add certain values twice. +Same applies for custom packages + +## Ways to fix it + +Remove the mentioned occurrences + +``` +PACKAGE_BEFORE_PN = "${PN}-mydev" + +FILES:${PN}-mydev += "/some/path" +``` diff --git a/docs/wiki/oelint.vars.homepageping.md b/docs/wiki/oelint.vars.homepageping.md new file mode 100644 index 00000000..ef698b02 --- /dev/null +++ b/docs/wiki/oelint.vars.homepageping.md @@ -0,0 +1,21 @@ +# oelint.vars.homepageping + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +HOMEPAGE = "ftp://abc-def.com" +``` + +## Why is this bad? + +``HOMEPAGE`` should point to a website, that is reachable by the user + +## Ways to fix it + +``` +HOMEPAGE = "https://abc-def.com" +``` diff --git a/docs/wiki/oelint.vars.homepageprefix.md b/docs/wiki/oelint.vars.homepageprefix.md new file mode 100644 index 00000000..24ef3a70 --- /dev/null +++ b/docs/wiki/oelint.vars.homepageprefix.md @@ -0,0 +1,21 @@ +# oelint.vars.homepageprefix + +severity: warning + +## Example + +In ``my-recipe_1.0.bb`` + +``` +HOMEPAGE = "ftp://abc-def.com" +``` + +## Why is this bad? + +``HOMEPAGE`` should point to a website, that is reachable by the user - ``http`` and ``https`` considered the only valid prefixes. + +## Ways to fix it + +``` +HOMEPAGE = "https://abc-def.com" +``` \ No newline at end of file diff --git a/docs/wiki/oelint.vars.inconspaces.md b/docs/wiki/oelint.vars.inconspaces.md new file mode 100644 index 00000000..c6ed2aa2 --- /dev/null +++ b/docs/wiki/oelint.vars.inconspaces.md @@ -0,0 +1,23 @@ +# oelint.vars.inconspaces + +severity: error + +## Example + +In a recipe + +``` +VAR += " ffjjj" +VAR:append = "fhhh" +``` + +## Why is this bad? + +``+=`` will add a `` `` automatically, while for ``append`` operation this has to be done explicitly + +## Ways to fix it + +``` +VAR += "ffjjj" +VAR:append = " fhhh" +``` diff --git a/docs/wiki/oelint.vars.insaneskip.md b/docs/wiki/oelint.vars.insaneskip.md new file mode 100644 index 00000000..d5265a42 --- /dev/null +++ b/docs/wiki/oelint.vars.insaneskip.md @@ -0,0 +1,24 @@ +# oelint.vars.insaneskip + +severity: error + +## Example + +``` +INSANE_SKIP:${PN} = "ldflags" +``` + +## Why is this bad? + +Use of ``INSANE_SKIP`` effectively disables core quality checks, rendering the outcome +potentially unusable + +## Ways to fix it + +Avoid the usage of ``INSANE_SKIP``. +For situations where it is still necessary use + +``` +# nooelint: oelint.vars.insaneskip - the reason goes here as a comment +INSANE_SKIP:${PN} = "ldflags" +``` \ No newline at end of file diff --git a/docs/wiki/oelint.vars.licensesdpx.md b/docs/wiki/oelint.vars.licensesdpx.md new file mode 100644 index 00000000..179b0655 --- /dev/null +++ b/docs/wiki/oelint.vars.licensesdpx.md @@ -0,0 +1,22 @@ +# oelint.vars.licensesdpx + +severity: warning + +## Example + +In any recipe + +``` +LICENSE = "ISC &MIT" +``` + +## Why is this bad? + +The syntax is always `` & `` or `` | `` for combined licenses. +Detection might fail if the surrounding spaces are omitted. + +## Ways to fix it + +``` +LICENSE = "ISC & MIT" +``` diff --git a/docs/wiki/oelint.vars.licfileprefix.md b/docs/wiki/oelint.vars.licfileprefix.md new file mode 100644 index 00000000..95fabbf0 --- /dev/null +++ b/docs/wiki/oelint.vars.licfileprefix.md @@ -0,0 +1,21 @@ +# oelint.vars.licfileprefix + +severity: warning + +## Example + +In any recipe + +``` +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=a4a2bbea1db029f21b3a328c7a059172" +``` + +## Why is this bad? + +The ``${S}`` prefix is unnecessary, as the files are always searched relative to ``${S}`` + +## Ways to fix it + +``` +LIC_FILES_CHKSUM = "file://LICENSE;md5=a4a2bbea1db029f21b3a328c7a059172" +``` diff --git a/docs/wiki/oelint.vars.listappend.md b/docs/wiki/oelint.vars.listappend.md new file mode 100644 index 00000000..40369efd --- /dev/null +++ b/docs/wiki/oelint.vars.listappend.md @@ -0,0 +1,47 @@ +# oelint.vars.listappend + +severity: error + +## Example + +``` +RDEPENDS:${PN} .= "bar" +RDEPENDS:${PN}:append = "bar" +``` + +or + +``` +RDEPENDS:${PN} =. "bar" +RDEPENDS:${PN}:prepend = "bar" +``` + +## Why is this bad? + +``append`` operations need to start with a leading space. +``prepend`` operations need to end with trailing space. + +Otherwise it will be just added to a potentially existing value. + +Like + +``` +RDEPENDS:${PN} = "foo" +RDEPENDS:${PN}:prepend = "bar" +``` + +will result in ``RDEPENDS:${PN} = "barfoo"``, while ``RDEPENDS:${PN} = "bar foo"`` is most likely the desired outcome + +## Ways to fix it + +``` +RDEPENDS:${PN} .= " bar" +RDEPENDS:${PN}:append = " bar" +``` + +or + +``` +RDEPENDS:${PN} =. "bar " +RDEPENDS:${PN}:prepend = "bar " +``` diff --git a/docs/wiki/oelint.vars.mispell.md b/docs/wiki/oelint.vars.mispell.md new file mode 100644 index 00000000..e4b7472a --- /dev/null +++ b/docs/wiki/oelint.vars.mispell.md @@ -0,0 +1,22 @@ +# oelint.vars.mispell + +severity: warning + +## Example + +In any bitbake file + +``` +DPENDS += "foo" +``` + +## Why is this bad? + +The variable name is not known but looks very similar to a known one. +Likely that is a typo. + +## Ways to fix it + +``` +DEPENDS += "foo" +``` diff --git a/docs/wiki/oelint.vars.multilineident.md b/docs/wiki/oelint.vars.multilineident.md new file mode 100644 index 00000000..555ce11c --- /dev/null +++ b/docs/wiki/oelint.vars.multilineident.md @@ -0,0 +1,28 @@ +# oelint.vars.multilineident + +severity: info + +## Example + +On every multiline variable assignment + +``` +A = "\ + a \ +b \ +" +``` + +## Why is this bad? + +For better readability the [Yocto project style guide](https://docs.yoctoproject.org/contributor-guide/recipe-style-guide.html#variable-formatting) +suggests to use a common indent (minimum 4 spaces) matching the first ``"`` on the starting line + +## Ways to fix it + +``` +A = "\ + a \ + b \ +" +``` diff --git a/docs/wiki/oelint.vars.notneededspace.md b/docs/wiki/oelint.vars.notneededspace.md new file mode 100644 index 00000000..20b94eb3 --- /dev/null +++ b/docs/wiki/oelint.vars.notneededspace.md @@ -0,0 +1,21 @@ +# oelint.vars.notneededspace + +severity: info + +## Example + +In every bitbake file + +``` +VAR += " a" +``` + +## Why is this bad? + +The leading space is unnecessary and will just bloat the resulting command line(s) + +## Ways to fix it + +``` +VAR += "a" +``` diff --git a/docs/wiki/oelint.vars.notrailingslash.md b/docs/wiki/oelint.vars.notrailingslash.md new file mode 100644 index 00000000..313a0860 --- /dev/null +++ b/docs/wiki/oelint.vars.notrailingslash.md @@ -0,0 +1,27 @@ +# oelint.vars.notrailingslash + +severity: error + +## Example + +In every bitbake recipe + +``` +S = "${WORDKIR}/foo/" +D = "${WORDKIR}/foo/" +T = "${WORDKIR}/foo/" +B = "${WORDKIR}/foo/" +``` + +## Why is this bad? + +A trailing ``/`` on these selected variables will cause ``devtool`` to stop working properly. + +## Ways to fix it + +``` +S = "${WORDKIR}/foo" +D = "${WORDKIR}/foo" +T = "${WORDKIR}/foo" +B = "${WORDKIR}/foo" +``` diff --git a/docs/wiki/oelint.vars.overrideappend.md b/docs/wiki/oelint.vars.overrideappend.md new file mode 100644 index 00000000..13cf9608 --- /dev/null +++ b/docs/wiki/oelint.vars.overrideappend.md @@ -0,0 +1,27 @@ +# oelint.vars.overrideappend + +severity: warning + +## Example + +In every bitbake file + +``` +A = "a" +A:class-target:append = " b" +``` + +## Why is this bad? + +This would create an empty set of ``A`` for ``class-target`` and then ``append`` ``b``, +but most likely what should have been done is take the original value of ``A`` +and add ``b`` in case the recipe is compiled for the target. + +## Ways to fix it + +``append`` (or ``prepend`` or ``remove``) always comes first, then the other overrides + +``` +A = "a" +A:append:class-target = " b" +``` diff --git a/docs/wiki/oelint.vars.pathhardcode.md b/docs/wiki/oelint.vars.pathhardcode.md new file mode 100644 index 00000000..b997f397 --- /dev/null +++ b/docs/wiki/oelint.vars.pathhardcode.md @@ -0,0 +1,42 @@ +# oelint.vars.pathhardcode + +severity: warning + +## Example + +``` +FILES:${PN} += "/usr/share/doc" +``` + +## Why is this bad? + +Bitbake uses variables for certain paths, to enable features like ``usrmerge`` or ``multilib``. +So the variables could change depending if those features (along others) are used or not. +Using hardcoded paths could result in packaging files wrongly or installing files into the +wrong paths. + +## Ways to fix it + +The following variables are known + +- ``${systemd_user_unitdir}`` => ``/usr/lib/systemd/user`` +- ``${systemd_system_unitdir}`` => ``/lib/systemd/system`` +- ``${docdir}`` => ``/usr/share/doc`` +- ``${infodir}`` => ``/usr/share/info`` +- ``${mandir}`` => ``/usr/share/man`` +- ``${libexecdir}`` => ``/usr/libexec`` +- ``${systemd_unitdir}`` => ``/lib/systemd`` +- ``${libdir}`` => ``/usr/lib`` +- ``${bindir}`` => ``/usr/bin`` +- ``${datadir}`` => ``/usr/share`` +- ``${includedir}`` => ``/usr/include`` +- ``${localstatedir}`` => ``/var`` +- ``${nonarch_base_libdir}`` => ``/lib`` +- ``${sbindir}`` => ``/usr/sbin`` +- ``${servicedir}`` => ``/srv`` +- ``${sharedstatedir}`` => ``/com`` +- ``${sysconfdir}`` => ``/etc`` + +``` +FILES:${PN} += "${docdir}" +``` diff --git a/docs/wiki/oelint.vars.pbpusage.md b/docs/wiki/oelint.vars.pbpusage.md new file mode 100644 index 00000000..7ecf9838 --- /dev/null +++ b/docs/wiki/oelint.vars.pbpusage.md @@ -0,0 +1,26 @@ +# oelint.vars.pbpusage + +severity: error + +## Example + +In ``my-recipe_1.0.bb`` + +``` +SRC_URI = "file://${P}.patch" + +BBCLASSEXTEND = "native" +``` + +## Why is this bad? + +If compile for ``native`` (``my-recipe-native``) the value of ``${P}`` changes to ``my-recipe-native``, making the +build access a different file + +## Ways to fix it + +Always use ``${BP}`` instead + +``` +SRC_URI = "file://${BP}.patch" +``` diff --git a/docs/wiki/oelint.vars.pkgspecific.md b/docs/wiki/oelint.vars.pkgspecific.md new file mode 100644 index 00000000..65f91765 --- /dev/null +++ b/docs/wiki/oelint.vars.pkgspecific.md @@ -0,0 +1,37 @@ +# oelint.vars.pkgspecific + +severity: error + +## Example + +In any bitbake file + +``` +RDEPENDS += "foo" +``` + +## Why is this bad? + +A selection of variables/functions are known to be package specific. +Omitting a package override makes the build ignore the setting at all + +## Ways to fix it + +The following variables/functions are known to be package specific + +- RDEPENDS +- RRECOMMENDS +- RSUGGESTS +- RCONFLICTS +- RPROVIDES +- RREPLACES +- FILES +- pkg_preinst +- pkg_postinst +- pkg_prerm +- pkg_postrm +- ALLOW_EMPTY + +``` +RDEPENDS:${PN} += "foo" +``` diff --git a/docs/wiki/oelint.vars.pnbpnusage.md b/docs/wiki/oelint.vars.pnbpnusage.md new file mode 100644 index 00000000..84b45519 --- /dev/null +++ b/docs/wiki/oelint.vars.pnbpnusage.md @@ -0,0 +1,26 @@ +# oelint.vars.pnbpnusage + +severity: error + +## Example + +In ``my-recipe_1.0.bb`` + +``` +SRC_URI = "file://${PN}.patch" + +BBCLASSEXTEND = "native" +``` + +## Why is this bad? + +If compile for ``native`` (``my-recipe-native``) the value of ``${PN}`` changes to ``my-recipe-native``, making the +build access a different file + +## Ways to fix it + +Always use ``${BPN}`` instead + +``` +SRC_URI = "file://${BPN}.patch" +``` diff --git a/docs/wiki/oelint.vars.pnusagediscouraged.md b/docs/wiki/oelint.vars.pnusagediscouraged.md new file mode 100644 index 00000000..8585f75f --- /dev/null +++ b/docs/wiki/oelint.vars.pnusagediscouraged.md @@ -0,0 +1,36 @@ +# oelint.vars.pnusagediscouraged + +severity: warning + +## Example + +In any bitbake recipe + +``` +HOMEPAGE = "http://${PN}.com" +DESCRIPTION = "http://${BPN}.com" +``` + +## Why is this bad? + +For a selection of variables, that provide metadata the use of ``${PN}`` and ``${BPN}`` is discouraged, as those +variables provide links. +And in a unexpanded form they are not clickable immediately from the IDE or editor, leading to manual work. + +Also there is little use in using a variable here, as the information likely will remain static anyway. + +## Ways to fix it + +For variables + +- SUMMARY +- HOMEPAGE +- BUGTRACKER +- DESCRIPTION + +remove the use of ``${PN}`` and ``${BPN}`` + +``` +HOMEPAGE = "http://foo-bar.com" +DESCRIPTION = "http://foo-bar.com" +``` diff --git a/docs/wiki/oelint.vars.sectionlowercase.md b/docs/wiki/oelint.vars.sectionlowercase.md new file mode 100644 index 00000000..a3e93597 --- /dev/null +++ b/docs/wiki/oelint.vars.sectionlowercase.md @@ -0,0 +1,19 @@ +# oelint.vars.sectionlowercase + +severity: warning + +## Example + +``` +SECTION = "AppLiCations" +``` + +## Why is this bad? + +To make the ``SECTION`` setting useful for searching a filtering the value should be all lowercase + +## Ways to fix it + +``` +SECTION = "applications" +``` diff --git a/docs/wiki/oelint.vars.spacesassignment.md b/docs/wiki/oelint.vars.spacesassignment.md new file mode 100644 index 00000000..edda7832 --- /dev/null +++ b/docs/wiki/oelint.vars.spacesassignment.md @@ -0,0 +1,22 @@ +# oelint.vars.spacesassignment + +severity: warning + +## Example + +In any bitbake file + +``` +A ="1" +``` + +## Why is this bad? + +For better readability it's advised to write variable operations always like ``A = "1"``, with +a single space surrounding the variable operation. + +## Ways to fix it + +``` +A = "1" +``` diff --git a/docs/wiki/oelint.vars.specific.md b/docs/wiki/oelint.vars.specific.md new file mode 100644 index 00000000..6740456d --- /dev/null +++ b/docs/wiki/oelint.vars.specific.md @@ -0,0 +1,25 @@ +# oelint.vars.specific + +severity: error + +## Example + +``` +A:append:fooarch = " foo" +``` + +## Why is this bad? + +The override item should be known from either ``MACHINE``, ``MACHINEOVERRIDES``, ``PACKAGES`` or ``DISTRO``, otherwise +there is a high chance that the variable value will never be used. + +## Ways to fix it + +Use a known override - See the corresponding [README section](https://github.com/priv-kweihmann/oelint-adv#configure-your-custom-machine-or-distro-settings) or +if it's a ``PACKAGE`` set + +``` +PACKAGE_BEFORE_PN += "${PN}-mypackage" + +FILES:${PN}-mypackage += "some/file" +``` diff --git a/docs/wiki/oelint.vars.srcuriappend.md b/docs/wiki/oelint.vars.srcuriappend.md new file mode 100644 index 00000000..7d7a4761 --- /dev/null +++ b/docs/wiki/oelint.vars.srcuriappend.md @@ -0,0 +1,38 @@ +# oelint.vars.srcuriappend + +severity: error + +## Example + +In any bitbake recipe + +``` +SRC_URI += "file://abc" +inherit def +``` + +## Why is this bad? + +If the ``inherit`` class uses ``SRC_URI ?= "file://ghi"`` the setting would be ignored, a weak variable default only become +effective if there's no previous value. + +Depending on what should be done the ``SRC_URI`` operation in the recipe should a +hard assignment ``SRC_URI = "file://abc"`` to override the default choices of the ``inherit`` class. + +Or if it should be an ``append`` it needs to be ``SRC_URI:append = " file://abc"`` + +## Ways to fix it + +To override any default value use + +``` +SRC_URI = "file://abc" +inherit def +``` + +or to append use + +``` +SRC_URI += "file://abc" +inherit def +``` \ No newline at end of file diff --git a/docs/wiki/oelint.vars.srcurichecksum.md b/docs/wiki/oelint.vars.srcurichecksum.md new file mode 100644 index 00000000..b1585b57 --- /dev/null +++ b/docs/wiki/oelint.vars.srcurichecksum.md @@ -0,0 +1,36 @@ +# oelint.vars.srcurichecksum + +severity: error + +## Example + +In any bitbake file + +``` +SRC_URI += "ftp://foo;name=f3" +``` + +or + +``` +SRC_URI += "ftp://foo" +``` + +## Why is this bad? + +For any blob fetcher like ``http``, ``https``, ``ftp``, ``ftps``, ``sftp``, ``s3`` or ``az``. +a (named) checksum is required. + +## Ways to fix it + +``` +SRC_URI += "ftp://foo;name=f3" +SRC_URI[f3.sha256sum] = "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865" +``` + +or + +``` +SRC_URI += "ftp://foo" +SRC_URI[sha256sum] = "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865" +``` diff --git a/docs/wiki/oelint.vars.srcuridomains.md b/docs/wiki/oelint.vars.srcuridomains.md new file mode 100644 index 00000000..ba917fa6 --- /dev/null +++ b/docs/wiki/oelint.vars.srcuridomains.md @@ -0,0 +1,25 @@ +# oelint.vars.srcuridomains + +severity: warning + +## Example + +``` +SRC_URI += "git://abc.group.com/a.git" +SRC_URI += "git://def.group.com/b.git" +``` + +## Why is this bad? + +A recipe fetched from different domains will cause issues for instance when using ``devtool``. +Try to avoid if possible + +## Ways to fix it + +Move the second fetching type to a separate recipe, or if not possible suppress the finding (accepting the consequences) + +``` +SRC_URI += "git://abc.group.com/a.git" +# nooelint: oelint.vars.srcuridomains +SRC_URI += "git://def.group.com/b.git" +``` diff --git a/docs/wiki/oelint.vars.srcurifile.md b/docs/wiki/oelint.vars.srcurifile.md new file mode 100644 index 00000000..ede05101 --- /dev/null +++ b/docs/wiki/oelint.vars.srcurifile.md @@ -0,0 +1,28 @@ +# oelint.vars.srcurifile + +severity: warning + +## Example + +In any recipe + +``` +SRC_URI += "file://abc" +SRC_URI += "git://foo.org/gaz.git" +``` + +## Why is this bad? + +When using ``devtool check-upgrade-status`` to check for updates of the recipe, ``devtool`` only uses the +first item of ``SRC_URI`` - in this case a ``file`` fetcher that will not change. + +Leading potentially to missing out on upstream updates to the source code + +## Ways to fix it + +Put ``file`` fetcher at the end of the ``SRC_URI`` list + +``` +SRC_URI += "git://foo.org/gaz.git" +SRC_URI += "file://abc" +``` diff --git a/docs/wiki/oelint.vars.srcurigittag.md b/docs/wiki/oelint.vars.srcurigittag.md new file mode 100644 index 00000000..7899dd18 --- /dev/null +++ b/docs/wiki/oelint.vars.srcurigittag.md @@ -0,0 +1,25 @@ +# oelint.vars.srcurigittag + +severity: warning + +## Example + +In any bitbake recipe + +``` +SRC_URI += "git://foo.org/gaz.git;tag=${PV}" +``` + +## Why is this bad? + +Use of the ``tag`` parameter is risky, as a tag can be forcefully and silently moved to a different +revision by the upstream repository, breaking reproducible builds. + +## Ways to fix it + +Use fixed revisions only + +``` +SRC_URI += "git://foo.org/gaz.git" +SRCREV = "e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e" +``` diff --git a/docs/wiki/oelint.vars.srcurioptions.md b/docs/wiki/oelint.vars.srcurioptions.md new file mode 100644 index 00000000..79490d0e --- /dev/null +++ b/docs/wiki/oelint.vars.srcurioptions.md @@ -0,0 +1,22 @@ +# oelint.vars.srcurioptions + +severity: warning + +## Example + +``` +SRC_URI += "svn://foo;proto=http" +``` + +## Why is this bad? + +Each fetcher type has only a limited set of known parameters. +Using an unknown one will either cause fetching errors or making the parameter ignored entirely. + +## Ways to fix it + +Use only known fetcher parameters + +``` +SRC_URI += "svn://foo;protocol=http" +``` diff --git a/docs/wiki/oelint.vars.srcurisrcrevtag.md b/docs/wiki/oelint.vars.srcurisrcrevtag.md new file mode 100644 index 00000000..35531d88 --- /dev/null +++ b/docs/wiki/oelint.vars.srcurisrcrevtag.md @@ -0,0 +1,26 @@ +# oelint.vars.srcurisrcrevtag + +severity: error + +## Example + +In any bitbake recipe + +``` +SRC_URI += "git://foo.org/gaz.git;tag=${PV}" +SRCREV = "e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e" +``` + +## Why is this bad? + +``tag`` fetcher parameter and a ``SRCREV`` setting contradict each other. +``SRCREV`` is always preferred over the use of ``tag`` fetcher parameter. + +## Ways to fix it + +Use fixed revisions only and no ``tag`` parameter + +``` +SRC_URI += "git://foo.org/gaz.git" +SRCREV = "e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e" +``` diff --git a/docs/wiki/oelint.vars.summary80chars.md b/docs/wiki/oelint.vars.summary80chars.md new file mode 100644 index 00000000..1a68075e --- /dev/null +++ b/docs/wiki/oelint.vars.summary80chars.md @@ -0,0 +1,22 @@ +# oelint.vars.summary80chars + +severity: warning + +## Example + +In any bitbake recipe + +``` +SUMMARY = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +``` + +## Why is this bad? + +The [OpenEmbedded Style guide](https://www.openembedded.org/index.php?title=Styleguide&oldid=10281) requires ``SUMMARY`` to be +a maximum of 80 characters long + +## Ways to fix it + +``` +SUMMARY = "Something shorter than 80 characters" +``` diff --git a/docs/wiki/oelint.vars.summarylinebreaks.md b/docs/wiki/oelint.vars.summarylinebreaks.md new file mode 100644 index 00000000..2ed50d93 --- /dev/null +++ b/docs/wiki/oelint.vars.summarylinebreaks.md @@ -0,0 +1,21 @@ +# oelint.vars.summarylinebreaks + +severity: warning + +## Example + +In any bitbake recipe + +``` +SUMMARY = "a\nb\nc" +``` + +## Why is this bad? + +The [OpenEmbedded Style guide](https://www.openembedded.org/index.php?title=Styleguide&oldid=10281) requires ``SUMMARY`` a single line + +## Ways to fix it + +``` +SUMMARY = "a b c" +``` diff --git a/docs/wiki/oelint.vars.valuequoted.md b/docs/wiki/oelint.vars.valuequoted.md new file mode 100644 index 00000000..d288010b --- /dev/null +++ b/docs/wiki/oelint.vars.valuequoted.md @@ -0,0 +1,21 @@ +# oelint.vars.valuequoted + +severity: error + +## Example + +``` +A = "a +D = a" +``` + +## Why is this bad? + +Variables should be properly quoted, otherwise they will not be parsed properly + +## Ways to fix it + +``` +A = "a" +D = "a" +``` diff --git a/docs/wiki/oelint.vars.virtual.md b/docs/wiki/oelint.vars.virtual.md new file mode 100644 index 00000000..3a6077d6 --- /dev/null +++ b/docs/wiki/oelint.vars.virtual.md @@ -0,0 +1,22 @@ +# oelint.vars.virtual + +severity: error + +## Example + +``` +RDEPENDS:${PN} = "virtual/kernel" +``` + +## Why is this bad? + +The use of ``virtual/`` items is limited to ``DEPENDS`` and ``PROVIDES``, all runtime +related items such as ``RDEPENDS``, ``RPROVIDES`` a.s.o. will ignore ``virtual/`` items. + +## Ways to fix it + +Avoid ``virtual/`` items and use the really package name + +``` +RDEPENDS:${PN} = "linux-yocto" +``` diff --git a/docs/wiki/template.md b/docs/wiki/template.md new file mode 100644 index 00000000..8c861b2e --- /dev/null +++ b/docs/wiki/template.md @@ -0,0 +1,19 @@ +# %title% + +severity: %severity% + +## Example + +``` +example code +``` + +## Why is this bad? + +!!Here goes why this is bad!! + +## Ways to fix it + +``` +example code +``` diff --git a/wiki-creator.py b/wiki-creator.py new file mode 100755 index 00000000..f4721820 --- /dev/null +++ b/wiki-creator.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 +import json +import os +import subprocess # noqa: S404 + +TEMPLATE_FILE = os.path.join(os.path.dirname(__file__), 'docs/_template.md') +WIKI_PATH = os.path.join(os.path.dirname(__file__), 'docs/wiki') + + +def create_templates(map_: dict): + for k, v in map_.items(): + if os.path.exists(os.path.join(WIKI_PATH, f'{k}.md')): + continue + + rpl_map = { + '%title%': k, + '%severity%': v, + } + + cnt = '' + with open(TEMPLATE_FILE) as i: + cnt = i.read() + + with open(os.path.join(WIKI_PATH, f'{k}.md'), 'w') as o: + for rk, rv in rpl_map.items(): + cnt = cnt.replace(rk, rv) + o.write(cnt) + + +def main(): + try: + create_templates(json.loads(subprocess.check_output( # noqa: S607, S603 + ['python3', '-m', 'oelint_adv', '--print-rulefile'], universal_newlines=True))) + except subprocess.CalledProcessError: + pass + + +if __name__ == '__main__': + main() # pragma: no cover