summaryrefslogtreecommitdiffstats
path: root/support/scripts/checkpackagelib_mk.py
Commit message (Collapse)AuthorAgeFilesLines
* check-package: move parts to subdirectoryRicardo Martincoski2017-04-201-223/+0
| | | | | | | | | | | | | | | | | | | | Currently the check-package script uses many files in the same directory. This commit keeps the main script in support/scripts/ and moves the rest into a subdirectory. The modules were previously prefixed to make it easy to identify which script they belong to. This is no longer needed when using a subdirectory, so the prefix is removed. Note: if this commit is checked out and the script is run, and later on a previous version is checked out, the file support/scripts/checkpackagelib/__init__.pyc needs to be manually removed to prevent Python interpreter to look for checkpackagelib package when only the checkpackagelib module is available. Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* check-package: check *.mk for typo in variableRicardo Martincoski2017-04-081-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Warn when a variable is defined in a .mk file and it don't start with the package name. This function generates false warnings and the maintenance of the whitelist can be an extra burden, but it catches some typos really hard to see: - POPLER_CONF_OPTS [1] - BALELD_LICENSE [2] - DRDB_UTILS_DEPENDENCIES [3] - PERL_LIBWWW_LICENSE_FILES [4] - AVRDUDR_LICENSE_FILES [5] - GST1_PLUGINS_ULGY_HAS_GPL_LICENSE [6] - ON2_8170_LICENSE [7] - LIBFDTI_CONF_OPTS [8][9] - IPSEC_DEPENDENCIES [10] [1] http://patchwork.ozlabs.org/patch/681533 [2] http://patchwork.ozlabs.org/patch/643293 [3] http://patchwork.ozlabs.org/patch/449589 [4] http://patchwork.ozlabs.org/patch/464545 [5] http://patchwork.ozlabs.org/patch/305060 [6] http://patchwork.ozlabs.org/patch/253089 [7] http://patchwork.ozlabs.org/patch/250523 [8] http://patchwork.ozlabs.org/patch/394125 [9] https://github.com/buildroot/buildroot/commit/fe7a4b524b72bcb448f7e723873d8244620cb2f1 [10] https://github.com/buildroot/buildroot/commit/dff1d590b2a0fadf58b6eed60029b2ecbab7c710 Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Cc: Romain Naour <romain.naour@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* check-package: check *.mk filesRicardo Martincoski2017-04-081-0/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Warn when there are obvious indentation errors: - the number of expect tabs is not yet checked since it is more complex to achieve; - the content inside define ... endef should be indented with tab(s), see [1]; - line just after a backslash should be indented with tab(s), see [2]; - other lines should not be indented, see [3]; - ignore empty lines and comments. Warn when there is no well-formatted header in the file: - 80 hashes at lines 1 and 5; - 1 hash at lines 2 and 4; - empty line at line 6; - see [4]; - ignore files that only include other mk files. Warn when there are more than one space before backslash, see [5]. Warn when there is a trailing backslash [6]. Warn for flags set to default value YES or NO, see [7], [8], [9]. [1] http://patchwork.ozlabs.org/patch/681429/ [2] http://patchwork.ozlabs.org/patch/681430/ [3] http://patchwork.ozlabs.org/patch/559209/ [4] http://nightly.buildroot.org/#writing-rules-mk [5] http://patchwork.ozlabs.org/patch/649084/ [6] http://patchwork.ozlabs.org/patch/535550/ [7] http://patchwork.ozlabs.org/patch/704718/ [8] http://nightly.buildroot.org/#_infrastructure_for_packages_with_specific_build_systems [9] http://nightly.buildroot.org/#_infrastructure_for_autotools_based_packages Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* check-package: check whitespace and empty linesRicardo Martincoski2017-04-081-0/+3
| | | | | | | | | | | | | | | | | Create 3 new check functions to warn when: - there are consecutive empty lines in the file, see [1]; - the last line of the file is empty, see [2]; - there are lines with trailing whitespace, see [3]. Apply these functions to Config.*, *.mk and *.hash, but not for *.patch files since they can contain any of these and still be valid. [1] http://patchwork.ozlabs.org/patch/682660/ [2] http://patchwork.ozlabs.org/patch/643288/ [3] http://patchwork.ozlabs.org/patch/398984/ Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/scripts/check-package: new scriptRicardo Martincoski2017-04-081-0/+8
Create the infra to check the style of new packages before submitting. The overall function of the script is described inside a txt file. It is designed to process the actual files and NOT the patch files generated by git format-patch. Also add the first check function, to warn if a file (Config.*, *.mk, *.hash, *.patch) has no newline at the last line of the file, see [1]. Basic usage for simple packages: support/scripts/check-package -vvv package/newpackage/* Basic usage for packages with subdirs: support/scripts/check-package -vvv $(find package/newpackage/ -type f) See "checkpackage" in [2]. [1] http://patchwork.ozlabs.org/patch/631129/ [2] http://elinux.org/Buildroot#Todo_list Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
OpenPOWER on IntegriCloud