* [ptxdist] [PATCH 1/2] ptxd_make_world_lint_credits: fix typo @ 2021-06-06 14:01 Roland Hieber 2021-06-06 14:01 ` [ptxdist] [PATCH 2/2] ptxd_make_world_lint: allow single linters to be run Roland Hieber 2021-06-16 10:35 ` [ptxdist] [APPLIED] ptxd_make_world_lint_credits: fix typo Michael Olbrich 0 siblings, 2 replies; 5+ messages in thread From: Roland Hieber @ 2021-06-06 14:01 UTC (permalink / raw) To: ptxdist; +Cc: Roland Hieber Signed-off-by: Roland Hieber <rhi@pengutronix.de> --- scripts/lib/ptxd_make_world_lint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lib/ptxd_make_world_lint.sh b/scripts/lib/ptxd_make_world_lint.sh index 410cb2747394..06926e58d614 100644 --- a/scripts/lib/ptxd_make_world_lint.sh +++ b/scripts/lib/ptxd_make_world_lint.sh @@ -185,7 +185,7 @@ PTXDIST_LINT_COMMANDS="${PTXDIST_LINT_COMMANDS} autogen" ptxd_make_world_lint_credits() { local filefd file - echo "Checking for obsolte 'See CREDITS for details about who has contributed to this project.' comment ..." + echo "Checking for obsolete 'See CREDITS for details about who has contributed to this project.' comment ..." exec {filefd}< <(ptxd_make_world_lint_makefiles) while read file <&${filefd}; do -- 2.29.2 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de ^ permalink raw reply [flat|nested] 5+ messages in thread
* [ptxdist] [PATCH 2/2] ptxd_make_world_lint: allow single linters to be run 2021-06-06 14:01 [ptxdist] [PATCH 1/2] ptxd_make_world_lint_credits: fix typo Roland Hieber @ 2021-06-06 14:01 ` Roland Hieber 2021-06-11 7:53 ` Michael Olbrich 2021-06-16 10:35 ` [ptxdist] [APPLIED] ptxd_make_world_lint_credits: fix typo Michael Olbrich 1 sibling, 1 reply; 5+ messages in thread From: Roland Hieber @ 2021-06-06 14:01 UTC (permalink / raw) To: ptxdist; +Cc: Roland Hieber Some linters can take a while to run. Speed up the run-edit loop during recipe development by making it possible to run a single linter, and add a way of listing available linters. Signed-off-by: Roland Hieber <rhi@pengutronix.de> --- bin/ptxdist | 5 ++++- doc/ref_parameter.rst | 4 +++- scripts/lib/ptxd_make_world_lint.sh | 30 ++++++++++++++++++++++++----- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/bin/ptxdist b/bin/ptxdist index c41065311f0c..97370d92fc03 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -776,7 +776,8 @@ Misc: printnext <var> assumes that the contents of <var> is another variable and print the contents of this variable licensecheck check md5sums of license files for all packages - lint run some basic checks for the bsp and PTXdist + lint [<linter>] run some basic checks for the BSP and PTXdist + (see 'lint list' for a list of available linters) list-packages print a list of all selected packages local-src <pkg> [<directory>] overwrite a package source with a locally provided directory containing the sourcecode. @@ -1831,6 +1832,8 @@ EOF ;; lint) export PTXDIST_GEN_ALL=1 + export PTXDIST_LINT_TARGET=${1:-all} + shift check_premake_compiler && ptxd_make_log ptxdist-lint && if [ -e "${PTXDIST_TEMPDIR}/lint-failed" ]; then diff --git a/doc/ref_parameter.rst b/doc/ref_parameter.rst index a5b9bfe9eca6..3b49ee68b7ce 100644 --- a/doc/ref_parameter.rst +++ b/doc/ref_parameter.rst @@ -250,10 +250,12 @@ Misc Actions For the specified package (or all selected packages), check the MD5 sums of license files. -``lint`` +``lint [<linter>]`` check the BSP and PTXdist for all kinds of issues. These are not checks for things that cause build errors. Instead the checks look for inconsistencies that may cause hidden problems. + ``<linter>`` can be a single linter to run, or ``list`` to print a list of + available linters, or ``all`` to run all linters (the default). ``list-packages`` print a list of all selected packages. This list does not include the diff --git a/scripts/lib/ptxd_make_world_lint.sh b/scripts/lib/ptxd_make_world_lint.sh index 06926e58d614..a08198411292 100644 --- a/scripts/lib/ptxd_make_world_lint.sh +++ b/scripts/lib/ptxd_make_world_lint.sh @@ -199,10 +199,30 @@ export -f ptxd_make_world_lint_credits PTXDIST_LINT_COMMANDS="${PTXDIST_LINT_COMMANDS} credits" ptxd_make_world_lint() { - local command - - for command in ${PTXDIST_LINT_COMMANDS}; do - ptxd_make_world_lint_${command} - done + local command done + + case "${PTXDIST_LINT_TARGET}" in + list|help) + echo "Available linters: ${PTXDIST_LINT_COMMANDS}" + return + ;; + all) + for command in ${PTXDIST_LINT_COMMANDS}; do + ptxd_make_world_lint_${command} + done + ;; + *) + for command in ${PTXDIST_LINT_COMMANDS}; do + if [ "${PTXDIST_LINT_TARGET}" = "${command}" ]; then + done=1 + ptxd_make_world_lint_${command} + fi + done + if [ -z "${done}" ]; then + ptxd_bailout "No such linter: '${PTXDIST_LINT_TARGET}'" \ + "Available linters: ${PTXDIST_LINT_COMMANDS}" + fi + ;; + esac } export -f ptxd_make_world_lint -- 2.29.2 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ptxdist] [PATCH 2/2] ptxd_make_world_lint: allow single linters to be run 2021-06-06 14:01 ` [ptxdist] [PATCH 2/2] ptxd_make_world_lint: allow single linters to be run Roland Hieber @ 2021-06-11 7:53 ` Michael Olbrich 2021-06-12 17:57 ` Roland Hieber 0 siblings, 1 reply; 5+ messages in thread From: Michael Olbrich @ 2021-06-11 7:53 UTC (permalink / raw) To: ptxdist On Sun, Jun 06, 2021 at 04:01:47PM +0200, Roland Hieber wrote: > Some linters can take a while to run. Speed up the run-edit loop during > recipe development by making it possible to run a single linter, and add > a way of listing available linters. > > Signed-off-by: Roland Hieber <rhi@pengutronix.de> > --- > bin/ptxdist | 5 ++++- > doc/ref_parameter.rst | 4 +++- > scripts/lib/ptxd_make_world_lint.sh | 30 ++++++++++++++++++++++++----- > 3 files changed, 32 insertions(+), 7 deletions(-) > > diff --git a/bin/ptxdist b/bin/ptxdist > index c41065311f0c..97370d92fc03 100755 > --- a/bin/ptxdist > +++ b/bin/ptxdist > @@ -776,7 +776,8 @@ Misc: > printnext <var> assumes that the contents of <var> is another > variable and print the contents of this variable > licensecheck check md5sums of license files for all packages > - lint run some basic checks for the bsp and PTXdist > + lint [<linter>] run some basic checks for the BSP and PTXdist > + (see 'lint list' for a list of available linters) > list-packages print a list of all selected packages > local-src <pkg> [<directory>] overwrite a package source with a locally provided > directory containing the sourcecode. > @@ -1831,6 +1832,8 @@ EOF > ;; > lint) > export PTXDIST_GEN_ALL=1 > + export PTXDIST_LINT_TARGET=${1:-all} > + shift > check_premake_compiler && > ptxd_make_log ptxdist-lint && > if [ -e "${PTXDIST_TEMPDIR}/lint-failed" ]; then > diff --git a/doc/ref_parameter.rst b/doc/ref_parameter.rst > index a5b9bfe9eca6..3b49ee68b7ce 100644 > --- a/doc/ref_parameter.rst > +++ b/doc/ref_parameter.rst > @@ -250,10 +250,12 @@ Misc Actions > For the specified package (or all selected packages), check the MD5 sums > of license files. > > -``lint`` > +``lint [<linter>]`` > check the BSP and PTXdist for all kinds of issues. These are not checks > for things that cause build errors. Instead the checks look for > inconsistencies that may cause hidden problems. > + ``<linter>`` can be a single linter to run, or ``list`` to print a list of > + available linters, or ``all`` to run all linters (the default). > > ``list-packages`` > print a list of all selected packages. This list does not include the > diff --git a/scripts/lib/ptxd_make_world_lint.sh b/scripts/lib/ptxd_make_world_lint.sh > index 06926e58d614..a08198411292 100644 > --- a/scripts/lib/ptxd_make_world_lint.sh > +++ b/scripts/lib/ptxd_make_world_lint.sh > @@ -199,10 +199,30 @@ export -f ptxd_make_world_lint_credits > PTXDIST_LINT_COMMANDS="${PTXDIST_LINT_COMMANDS} credits" > > ptxd_make_world_lint() { > - local command > - > - for command in ${PTXDIST_LINT_COMMANDS}; do > - ptxd_make_world_lint_${command} > - done > + local command done > + > + case "${PTXDIST_LINT_TARGET}" in > + list|help) > + echo "Available linters: ${PTXDIST_LINT_COMMANDS}" > + return > + ;; > + all) > + for command in ${PTXDIST_LINT_COMMANDS}; do > + ptxd_make_world_lint_${command} > + done > + ;; > + *) > + for command in ${PTXDIST_LINT_COMMANDS}; do > + if [ "${PTXDIST_LINT_TARGET}" = "${command}" ]; then > + done=1 > + ptxd_make_world_lint_${command} > + fi > + done > + if [ -z "${done}" ]; then > + ptxd_bailout "No such linter: '${PTXDIST_LINT_TARGET}'" \ > + "Available linters: ${PTXDIST_LINT_COMMANDS}" > + fi The indention is wrong. And I think we can allow multiple linters as arguments (untested): above: export PTXDIST_LINT_TARGET="${*:-all}" I don't think you need the 'shift'. If I'm wrong then 'set --' should help. for command in ${PTXDIST_LINT_TARGET}; do if [[ " ${command} " =~ " ${PTXDIST_LINT_COMMANDS} " ]]; then ptxd_make_world_lint_${command} else ptxd_bailout "No such linter: '${command}'" \ "Available linters: ${PTXDIST_LINT_COMMANDS}" fi Michael > + ;; > + esac > } > export -f ptxd_make_world_lint > -- > 2.29.2 > > > _______________________________________________ > ptxdist mailing list > ptxdist@pengutronix.de > To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ptxdist] [PATCH 2/2] ptxd_make_world_lint: allow single linters to be run 2021-06-11 7:53 ` Michael Olbrich @ 2021-06-12 17:57 ` Roland Hieber 0 siblings, 0 replies; 5+ messages in thread From: Roland Hieber @ 2021-06-12 17:57 UTC (permalink / raw) To: ptxdist On Fri, Jun 11, 2021 at 09:53:04AM +0200, Michael Olbrich wrote: > On Sun, Jun 06, 2021 at 04:01:47PM +0200, Roland Hieber wrote: > > Some linters can take a while to run. Speed up the run-edit loop during > > recipe development by making it possible to run a single linter, and add > > a way of listing available linters. > > > > Signed-off-by: Roland Hieber <rhi@pengutronix.de> > > --- > > bin/ptxdist | 5 ++++- > > doc/ref_parameter.rst | 4 +++- > > scripts/lib/ptxd_make_world_lint.sh | 30 ++++++++++++++++++++++++----- > > 3 files changed, 32 insertions(+), 7 deletions(-) > > > > diff --git a/bin/ptxdist b/bin/ptxdist > > index c41065311f0c..97370d92fc03 100755 > > --- a/bin/ptxdist > > +++ b/bin/ptxdist > > @@ -776,7 +776,8 @@ Misc: > > printnext <var> assumes that the contents of <var> is another > > variable and print the contents of this variable > > licensecheck check md5sums of license files for all packages > > - lint run some basic checks for the bsp and PTXdist > > + lint [<linter>] run some basic checks for the BSP and PTXdist > > + (see 'lint list' for a list of available linters) > > list-packages print a list of all selected packages > > local-src <pkg> [<directory>] overwrite a package source with a locally provided > > directory containing the sourcecode. > > @@ -1831,6 +1832,8 @@ EOF > > ;; > > lint) > > export PTXDIST_GEN_ALL=1 > > + export PTXDIST_LINT_TARGET=${1:-all} > > + shift > > check_premake_compiler && > > ptxd_make_log ptxdist-lint && > > if [ -e "${PTXDIST_TEMPDIR}/lint-failed" ]; then > > diff --git a/doc/ref_parameter.rst b/doc/ref_parameter.rst > > index a5b9bfe9eca6..3b49ee68b7ce 100644 > > --- a/doc/ref_parameter.rst > > +++ b/doc/ref_parameter.rst > > @@ -250,10 +250,12 @@ Misc Actions > > For the specified package (or all selected packages), check the MD5 sums > > of license files. > > > > -``lint`` > > +``lint [<linter>]`` > > check the BSP and PTXdist for all kinds of issues. These are not checks > > for things that cause build errors. Instead the checks look for > > inconsistencies that may cause hidden problems. > > + ``<linter>`` can be a single linter to run, or ``list`` to print a list of > > + available linters, or ``all`` to run all linters (the default). > > > > ``list-packages`` > > print a list of all selected packages. This list does not include the > > diff --git a/scripts/lib/ptxd_make_world_lint.sh b/scripts/lib/ptxd_make_world_lint.sh > > index 06926e58d614..a08198411292 100644 > > --- a/scripts/lib/ptxd_make_world_lint.sh > > +++ b/scripts/lib/ptxd_make_world_lint.sh > > @@ -199,10 +199,30 @@ export -f ptxd_make_world_lint_credits > > PTXDIST_LINT_COMMANDS="${PTXDIST_LINT_COMMANDS} credits" > > > > ptxd_make_world_lint() { > > - local command > > - > > - for command in ${PTXDIST_LINT_COMMANDS}; do > > - ptxd_make_world_lint_${command} > > - done > > + local command done > > + > > + case "${PTXDIST_LINT_TARGET}" in > > + list|help) > > + echo "Available linters: ${PTXDIST_LINT_COMMANDS}" > > + return > > + ;; > > + all) > > + for command in ${PTXDIST_LINT_COMMANDS}; do > > + ptxd_make_world_lint_${command} > > + done > > + ;; > > + *) > > + for command in ${PTXDIST_LINT_COMMANDS}; do > > + if [ "${PTXDIST_LINT_TARGET}" = "${command}" ]; then > > + done=1 > > + ptxd_make_world_lint_${command} > > + fi > > + done > > + if [ -z "${done}" ]; then > > + ptxd_bailout "No such linter: '${PTXDIST_LINT_TARGET}'" \ > > + "Available linters: ${PTXDIST_LINT_COMMANDS}" > > + fi > > The indention is wrong. No, the indentation is wrong in the rest of the file. > And I think we can allow multiple linters as > arguments (untested): > > above: > export PTXDIST_LINT_TARGET="${*:-all}" > > I don't think you need the 'shift'. If I'm wrong then 'set --' should help. > > for command in ${PTXDIST_LINT_TARGET}; do > if [[ " ${command} " =~ " ${PTXDIST_LINT_COMMANDS} " ]]; then > ptxd_make_world_lint_${command} > else > ptxd_bailout "No such linter: '${command}'" \ > "Available linters: ${PTXDIST_LINT_COMMANDS}" > fi Yes, I've also already thought about this, so I'll pick it up in v2. - Roland -- Roland Hieber, Pengutronix e.K. | r.hieber@pengutronix.de | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ptxdist] [APPLIED] ptxd_make_world_lint_credits: fix typo 2021-06-06 14:01 [ptxdist] [PATCH 1/2] ptxd_make_world_lint_credits: fix typo Roland Hieber 2021-06-06 14:01 ` [ptxdist] [PATCH 2/2] ptxd_make_world_lint: allow single linters to be run Roland Hieber @ 2021-06-16 10:35 ` Michael Olbrich 1 sibling, 0 replies; 5+ messages in thread From: Michael Olbrich @ 2021-06-16 10:35 UTC (permalink / raw) To: ptxdist; +Cc: Roland Hieber Thanks, applied as cc3374d2a85fe26c2b5afedff1e402dc741920ed. Michael [sent from post-receive hook] On Wed, 16 Jun 2021 12:35:30 +0200, Roland Hieber <rhi@pengutronix.de> wrote: > Signed-off-by: Roland Hieber <rhi@pengutronix.de> > Message-Id: <20210606140144.28444-1-rhi@pengutronix.de> > Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> > > diff --git a/scripts/lib/ptxd_make_world_lint.sh b/scripts/lib/ptxd_make_world_lint.sh > index 410cb2747394..06926e58d614 100644 > --- a/scripts/lib/ptxd_make_world_lint.sh > +++ b/scripts/lib/ptxd_make_world_lint.sh > @@ -185,7 +185,7 @@ PTXDIST_LINT_COMMANDS="${PTXDIST_LINT_COMMANDS} autogen" > ptxd_make_world_lint_credits() { > local filefd file > > - echo "Checking for obsolte 'See CREDITS for details about who has contributed to this project.' comment ..." > + echo "Checking for obsolete 'See CREDITS for details about who has contributed to this project.' comment ..." > > exec {filefd}< <(ptxd_make_world_lint_makefiles) > while read file <&${filefd}; do _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-06-16 10:36 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-06-06 14:01 [ptxdist] [PATCH 1/2] ptxd_make_world_lint_credits: fix typo Roland Hieber 2021-06-06 14:01 ` [ptxdist] [PATCH 2/2] ptxd_make_world_lint: allow single linters to be run Roland Hieber 2021-06-11 7:53 ` Michael Olbrich 2021-06-12 17:57 ` Roland Hieber 2021-06-16 10:35 ` [ptxdist] [APPLIED] ptxd_make_world_lint_credits: fix typo Michael Olbrich
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox