All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] support/run-tests: reorder imports
@ 2020-02-13 10:09 yegorslists at googlemail.com
  2020-02-13 10:09 ` [Buildroot] [PATCH 2/2] support/run-tests: check for empty sequences in a pythonic way yegorslists at googlemail.com
  2020-02-16 14:39 ` [Buildroot] [PATCH 1/2] support/run-tests: reorder imports Peter Korsgaard
  0 siblings, 2 replies; 8+ messages in thread
From: yegorslists at googlemail.com @ 2020-02-13 10:09 UTC (permalink / raw)
  To: buildroot

From: Yegor Yefremov <yegorslists@googlemail.com>

Reorder imports using the isort utility.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 support/testing/run-tests | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/support/testing/run-tests b/support/testing/run-tests
index 74741aee1b..77a13dc78c 100755
--- a/support/testing/run-tests
+++ b/support/testing/run-tests
@@ -1,9 +1,10 @@
 #!/usr/bin/env python3
 import argparse
-import sys
+import multiprocessing
 import os
+import sys
+
 import nose2
-import multiprocessing
 
 from infra.basetest import BRConfigTest
 
-- 
2.17.0

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

* [Buildroot] [PATCH 2/2] support/run-tests: check for empty sequences in a pythonic way
  2020-02-13 10:09 [Buildroot] [PATCH 1/2] support/run-tests: reorder imports yegorslists at googlemail.com
@ 2020-02-13 10:09 ` yegorslists at googlemail.com
  2020-02-16 14:47   ` Peter Korsgaard
  2020-02-16 14:39 ` [Buildroot] [PATCH 1/2] support/run-tests: reorder imports Peter Korsgaard
  1 sibling, 1 reply; 8+ messages in thread
From: yegorslists at googlemail.com @ 2020-02-13 10:09 UTC (permalink / raw)
  To: buildroot

From: Yegor Yefremov <yegorslists@googlemail.com>

According to PEP8 empty sequences should be checked as booleans.

Fixes the following PEP8 warning:
Do not use `len(SEQUENCE)` to determine if a sequence is empty

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 support/testing/run-tests | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/support/testing/run-tests b/support/testing/run-tests
index 77a13dc78c..022209b414 100755
--- a/support/testing/run-tests
+++ b/support/testing/run-tests
@@ -71,7 +71,7 @@ def main():
 
     BRConfigTest.outputdir = os.path.abspath(args.output)
 
-    if args.all is False and len(args.testname) == 0:
+    if args.all is False and not args.testname:
         print("No test selected")
         print("")
         parser.print_help()
@@ -113,7 +113,7 @@ def main():
                   "-s", test_dir,
                   "-c", os.path.join(test_dir, "conf/unittest.cfg")]
 
-    if len(args.testname) != 0:
+    if args.testname:
         nose2_args += args.testname
 
     nose2.discover(argv=nose2_args)
-- 
2.17.0

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

* [Buildroot] [PATCH 1/2] support/run-tests: reorder imports
  2020-02-13 10:09 [Buildroot] [PATCH 1/2] support/run-tests: reorder imports yegorslists at googlemail.com
  2020-02-13 10:09 ` [Buildroot] [PATCH 2/2] support/run-tests: check for empty sequences in a pythonic way yegorslists at googlemail.com
@ 2020-02-16 14:39 ` Peter Korsgaard
  2020-02-17  7:13   ` Yegor Yefremov
  1 sibling, 1 reply; 8+ messages in thread
From: Peter Korsgaard @ 2020-02-16 14:39 UTC (permalink / raw)
  To: buildroot

>>>>> "yegorslists" == yegorslists  <yegorslists@googlemail.com> writes:

 > From: Yegor Yefremov <yegorslists@googlemail.com>
 > Reorder imports using the isort utility.

Why? Does the current order cause any issues or warnings from linters?

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH 2/2] support/run-tests: check for empty sequences in a pythonic way
  2020-02-13 10:09 ` [Buildroot] [PATCH 2/2] support/run-tests: check for empty sequences in a pythonic way yegorslists at googlemail.com
@ 2020-02-16 14:47   ` Peter Korsgaard
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Korsgaard @ 2020-02-16 14:47 UTC (permalink / raw)
  To: buildroot

>>>>> "yegorslists" == yegorslists  <yegorslists@googlemail.com> writes:

 > From: Yegor Yefremov <yegorslists@googlemail.com>
 > According to PEP8 empty sequences should be checked as booleans.

 > Fixes the following PEP8 warning:
 > Do not use `len(SEQUENCE)` to determine if a sequence is empty

 > Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH 1/2] support/run-tests: reorder imports
  2020-02-16 14:39 ` [Buildroot] [PATCH 1/2] support/run-tests: reorder imports Peter Korsgaard
@ 2020-02-17  7:13   ` Yegor Yefremov
  2020-02-17  8:02     ` Peter Korsgaard
  0 siblings, 1 reply; 8+ messages in thread
From: Yegor Yefremov @ 2020-02-17  7:13 UTC (permalink / raw)
  To: buildroot

Hi Peter,

On Sun, Feb 16, 2020 at 3:39 PM Peter Korsgaard <peter@korsgaard.com> wrote:
>
> >>>>> "yegorslists" == yegorslists  <yegorslists@googlemail.com> writes:
>
>  > From: Yegor Yefremov <yegorslists@googlemail.com>
>  > Reorder imports using the isort utility.
>
> Why? Does the current order cause any issues or warnings from linters?

I get this warning:

wrong-import-order: standard import "import multiprocessing" should be
placed before "import nose2"

Yegor

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

* [Buildroot] [PATCH 1/2] support/run-tests: reorder imports
  2020-02-17  7:13   ` Yegor Yefremov
@ 2020-02-17  8:02     ` Peter Korsgaard
  2020-02-17  8:10       ` Yegor Yefremov
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Korsgaard @ 2020-02-17  8:02 UTC (permalink / raw)
  To: buildroot

>>>>> "Yegor" == Yegor Yefremov <yegorslists@googlemail.com> writes:

 > Hi Peter,
 > On Sun, Feb 16, 2020 at 3:39 PM Peter Korsgaard <peter@korsgaard.com> wrote:
 >> 
 >> >>>>> "yegorslists" == yegorslists  <yegorslists@googlemail.com> writes:
 >> 
 >> > From: Yegor Yefremov <yegorslists@googlemail.com>
 >> > Reorder imports using the isort utility.
 >> 
 >> Why? Does the current order cause any issues or warnings from linters?

 > I get this warning:

 > wrong-import-order: standard import "import multiprocessing" should be
 > placed before "import nose2"

Ok, From what checker do you get this warning?

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [PATCH 1/2] support/run-tests: reorder imports
  2020-02-17  8:02     ` Peter Korsgaard
@ 2020-02-17  8:10       ` Yegor Yefremov
  2020-02-17  9:12         ` Peter Korsgaard
  0 siblings, 1 reply; 8+ messages in thread
From: Yegor Yefremov @ 2020-02-17  8:10 UTC (permalink / raw)
  To: buildroot

On Mon, Feb 17, 2020 at 9:02 AM Peter Korsgaard <peter@korsgaard.com> wrote:
>
> >>>>> "Yegor" == Yegor Yefremov <yegorslists@googlemail.com> writes:
>
>  > Hi Peter,
>  > On Sun, Feb 16, 2020 at 3:39 PM Peter Korsgaard <peter@korsgaard.com> wrote:
>  >>
>  >> >>>>> "yegorslists" == yegorslists  <yegorslists@googlemail.com> writes:
>  >>
>  >> > From: Yegor Yefremov <yegorslists@googlemail.com>
>  >> > Reorder imports using the isort utility.
>  >>
>  >> Why? Does the current order cause any issues or warnings from linters?
>
>  > I get this warning:
>
>  > wrong-import-order: standard import "import multiprocessing" should be
>  > placed before "import nose2"
>
> Ok, From what checker do you get this warning?

pylint3 support/testing/run-tests

No config file found, using default configuration
************* Module run-tests
C:  1, 0: Module name "run-tests" doesn't conform to snake_case naming
style (invalid-name)
C:  1, 0: Missing module docstring (missing-docstring)
C: 11, 0: Missing function docstring (missing-docstring)
C: 73,29: Do not use `len(SEQUENCE)` to determine if a sequence is
empty (len-as-condition)
C:115, 7: Do not use `len(SEQUENCE)` to determine if a sequence is
empty (len-as-condition)
R: 11, 0: Either all return statements in a function should return an
expression, or none of them should. (inconsistent-return-statements)
R: 11, 0: Too many return statements (7/6) (too-many-return-statements)
R: 11, 0: Too many branches (14/12) (too-many-branches)
R: 11, 0: Too many statements (64/50) (too-many-statements)
C:  6, 0: standard import "import multiprocessing" should be placed
before "import nose2" (wrong-import-order)

------------------------------------------------------------------
Your code has been rated at 8.73/10 (previous run: 8.73/10, +0.00)

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

* [Buildroot] [PATCH 1/2] support/run-tests: reorder imports
  2020-02-17  8:10       ` Yegor Yefremov
@ 2020-02-17  9:12         ` Peter Korsgaard
  0 siblings, 0 replies; 8+ messages in thread
From: Peter Korsgaard @ 2020-02-17  9:12 UTC (permalink / raw)
  To: buildroot

>>>>> "Yegor" == Yegor Yefremov <yegorslists@googlemail.com> writes:

 > On Mon, Feb 17, 2020 at 9:02 AM Peter Korsgaard <peter@korsgaard.com> wrote:
 >> 
 >> >>>>> "Yegor" == Yegor Yefremov <yegorslists@googlemail.com> writes:
 >> 
 >> > Hi Peter,
 >> > On Sun, Feb 16, 2020 at 3:39 PM Peter Korsgaard <peter@korsgaard.com> wrote:
 >> >>
 >> >> >>>>> "yegorslists" == yegorslists  <yegorslists@googlemail.com> writes:
 >> >>
 >> >> > From: Yegor Yefremov <yegorslists@googlemail.com>
 >> >> > Reorder imports using the isort utility.
 >> >>
 >> >> Why? Does the current order cause any issues or warnings from linters?
 >> 
 >> > I get this warning:
 >> 
 >> > wrong-import-order: standard import "import multiprocessing" should be
 >> > placed before "import nose2"
 >> 
 >> Ok, From what checker do you get this warning?

 > pylint3 support/testing/run-tests

Ok, committed with that added to the commit message, thanks.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2020-02-17  9:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-13 10:09 [Buildroot] [PATCH 1/2] support/run-tests: reorder imports yegorslists at googlemail.com
2020-02-13 10:09 ` [Buildroot] [PATCH 2/2] support/run-tests: check for empty sequences in a pythonic way yegorslists at googlemail.com
2020-02-16 14:47   ` Peter Korsgaard
2020-02-16 14:39 ` [Buildroot] [PATCH 1/2] support/run-tests: reorder imports Peter Korsgaard
2020-02-17  7:13   ` Yegor Yefremov
2020-02-17  8:02     ` Peter Korsgaard
2020-02-17  8:10       ` Yegor Yefremov
2020-02-17  9:12         ` 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.