All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] utils/check-package: Add a quiet flag
@ 2019-07-02 18:52 Brandon Maier
  2019-07-03 21:39 ` Arnout Vandecappelle
  2019-07-07  6:42 ` Peter Korsgaard
  0 siblings, 2 replies; 4+ messages in thread
From: Brandon Maier @ 2019-07-02 18:52 UTC (permalink / raw)
  To: buildroot

When running in a CI system, stat messages become white noise. Introduce
an option to suppress non-error, non-warning, messages.

Signed-off-by: Brandon Maier <brandon.maier@rockwellcollins.com>
---
 utils/check-package | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/utils/check-package b/utils/check-package
index ce1fe98d67..f09aaeea03 100755
--- a/utils/check-package
+++ b/utils/check-package
@@ -33,6 +33,7 @@ def parse_args():
                         default="http://nightly.buildroot.org/",
                         help="default: %(default)s")
     parser.add_argument("--verbose", "-v", action="count", default=0)
+    parser.add_argument("--quiet", "-q", action="count", default=0)
 
     # Now the debug options in the order they are processed.
     parser.add_argument("--include-only", dest="include_list", action="append",
@@ -177,8 +178,10 @@ def __main__():
     # (e.g. counted by 'wc'), so for stats use stderr. Wait all warnings are
     # printed, for the case there are many of them, before printing stats.
     sys.stdout.flush()
-    print("{} lines processed".format(total_lines), file=sys.stderr)
-    print("{} warnings generated".format(total_warnings), file=sys.stderr)
+
+    if not flags.quiet:
+        print("{} lines processed".format(total_lines), file=sys.stderr)
+        print("{} warnings generated".format(total_warnings), file=sys.stderr)
 
     if total_warnings > 0:
         sys.exit(1)
-- 
2.21.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/1] utils/check-package: Add a quiet flag
  2019-07-02 18:52 [Buildroot] [PATCH 1/1] utils/check-package: Add a quiet flag Brandon Maier
@ 2019-07-03 21:39 ` Arnout Vandecappelle
  2019-07-07 14:43   ` Brandon Maier
  2019-07-07  6:42 ` Peter Korsgaard
  1 sibling, 1 reply; 4+ messages in thread
From: Arnout Vandecappelle @ 2019-07-03 21:39 UTC (permalink / raw)
  To: buildroot

 Hi Brandon,

On 02/07/2019 20:52, Brandon Maier wrote:
> When running in a CI system, stat messages become white noise. Introduce
> an option to suppress non-error, non-warning, messages.
> 
> Signed-off-by: Brandon Maier <brandon.maier@rockwellcollins.com>

 Applied to master, thanks.

 However, could you give an example of a case where this is annoying in CI
output? If I look at e.g. the output in gitlab-ci [1], the cruft that is added
by gitlab-ci itself makes it pretty verbose already.

 Regards,
 Arnout

[1] https://gitlab.com/buildroot.org/buildroot/-/jobs/242921394


> ---
>  utils/check-package | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/utils/check-package b/utils/check-package
> index ce1fe98d67..f09aaeea03 100755
> --- a/utils/check-package
> +++ b/utils/check-package
> @@ -33,6 +33,7 @@ def parse_args():
>                          default="http://nightly.buildroot.org/",
>                          help="default: %(default)s")
>      parser.add_argument("--verbose", "-v", action="count", default=0)
> +    parser.add_argument("--quiet", "-q", action="count", default=0)
>  
>      # Now the debug options in the order they are processed.
>      parser.add_argument("--include-only", dest="include_list", action="append",
> @@ -177,8 +178,10 @@ def __main__():
>      # (e.g. counted by 'wc'), so for stats use stderr. Wait all warnings are
>      # printed, for the case there are many of them, before printing stats.
>      sys.stdout.flush()
> -    print("{} lines processed".format(total_lines), file=sys.stderr)
> -    print("{} warnings generated".format(total_warnings), file=sys.stderr)
> +
> +    if not flags.quiet:
> +        print("{} lines processed".format(total_lines), file=sys.stderr)
> +        print("{} warnings generated".format(total_warnings), file=sys.stderr)
>  
>      if total_warnings > 0:
>          sys.exit(1)
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/1] utils/check-package: Add a quiet flag
  2019-07-02 18:52 [Buildroot] [PATCH 1/1] utils/check-package: Add a quiet flag Brandon Maier
  2019-07-03 21:39 ` Arnout Vandecappelle
@ 2019-07-07  6:42 ` Peter Korsgaard
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2019-07-07  6:42 UTC (permalink / raw)
  To: buildroot

>>>>> "Brandon" == Brandon Maier <brandon.maier@rockwellcollins.com> writes:

 > When running in a CI system, stat messages become white noise. Introduce
 > an option to suppress non-error, non-warning, messages.

 > Signed-off-by: Brandon Maier <brandon.maier@rockwellcollins.com>

While not really a fix, it seems quite safe and it is easier when
tooling behaves the same on the various branches, so committed to
2019.02.x and 2019.05.x - Thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/1] utils/check-package: Add a quiet flag
  2019-07-03 21:39 ` Arnout Vandecappelle
@ 2019-07-07 14:43   ` Brandon Maier
  0 siblings, 0 replies; 4+ messages in thread
From: Brandon Maier @ 2019-07-07 14:43 UTC (permalink / raw)
  To: buildroot

On Wed, Jul 3, 2019, 4:39 PM Arnout Vandecappelle <arnout@mind.be> wrote:

>  Hi Brandon,
>
> On 02/07/2019 20:52, Brandon Maier wrote:
> > When running in a CI system, stat messages become white noise. Introduce
> > an option to suppress non-error, non-warning, messages.
> >
> > Signed-off-by: Brandon Maier <brandon.maier@rockwellcollins.com>
>
>  Applied to master, thanks.

Thanks

>
>  However, could you give an example of a case where this is annoying in CI
> output? If I look at e.g. the output in gitlab-ci [1], the cruft that is
> added
> by gitlab-ci itself makes it pretty verbose already.
>

We have a custom tool to run various checks on our team's pull requests and
display findings. E.g. check-package, checkpatch, shellcheck, pylint, etc.

It's a simple tool though, and dumps stdout/stderr into the report. So it
assumes no output means everything is okay. All the other checkers have a
-q equivalent, so figured it'd be easiest to add it to check-package as
well.


>  Regards,
>  Arnout
>
> [1] https://gitlab.com/buildroot.org/buildroot/-/jobs/242921394
>
>
> > ---
> >  utils/check-package | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/utils/check-package b/utils/check-package
> > index ce1fe98d67..f09aaeea03 100755
> > --- a/utils/check-package
> > +++ b/utils/check-package
> > @@ -33,6 +33,7 @@ def parse_args():
> >                          default="http://nightly.buildroot.org/",
> >                          help="default: %(default)s")
> >      parser.add_argument("--verbose", "-v", action="count", default=0)
> > +    parser.add_argument("--quiet", "-q", action="count", default=0)
> >
> >      # Now the debug options in the order they are processed.
> >      parser.add_argument("--include-only", dest="include_list",
> action="append",
> > @@ -177,8 +178,10 @@ def __main__():
> >      # (e.g. counted by 'wc'), so for stats use stderr. Wait all
> warnings are
> >      # printed, for the case there are many of them, before printing
> stats.
> >      sys.stdout.flush()
> > -    print("{} lines processed".format(total_lines), file=sys.stderr)
> > -    print("{} warnings generated".format(total_warnings),
> file=sys.stderr)
> > +
> > +    if not flags.quiet:
> > +        print("{} lines processed".format(total_lines), file=sys.stderr)
> > +        print("{} warnings generated".format(total_warnings),
> file=sys.stderr)
> >
> >      if total_warnings > 0:
> >          sys.exit(1)
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20190707/0de8b419/attachment.html>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-07 14:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-02 18:52 [Buildroot] [PATCH 1/1] utils/check-package: Add a quiet flag Brandon Maier
2019-07-03 21:39 ` Arnout Vandecappelle
2019-07-07 14:43   ` Brandon Maier
2019-07-07  6:42 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.