From 527b97fb91e2dac18ad081c4d838db405e9ee099 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Wed, 3 Aug 2022 08:58:04 +0100 Subject: [PATCH 1/2] Python: Show source of linting errors. --- .github/workflows/python.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 58fbbb40..79c10e62 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -17,14 +17,14 @@ jobs: - name: Lint micropython/modules_py shell: bash run: | - python3 -m flake8 --ignore E501 micropython/modules_py + python3 -m flake8 --show-source --ignore E501 micropython/modules_py - name: Lint micropython/examples shell: bash run: | - python3 -m flake8 --ignore E501 micropython/examples + python3 -m flake8 --show-source --ignore E501 micropython/examples - name: Lint .py tools in C++ examples shell: bash run: | - python3 -m flake8 --ignore E501 examples \ No newline at end of file + python3 -m flake8 --show-source --ignore E501 examples \ No newline at end of file From b529475148d4cde86799ced437a9e6f48dcb9704 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Wed, 3 Aug 2022 09:07:32 +0100 Subject: [PATCH 2/2] Python: Fix new linting errors. --- micropython/examples/breakout_pmw3901/frame_capture.py | 2 +- micropython/examples/breakout_pmw3901/motion.py | 2 +- micropython/examples/common/lib/tinyweb/server.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/micropython/examples/breakout_pmw3901/frame_capture.py b/micropython/examples/breakout_pmw3901/frame_capture.py index ee13fe6d..79f1a714 100644 --- a/micropython/examples/breakout_pmw3901/frame_capture.py +++ b/micropython/examples/breakout_pmw3901/frame_capture.py @@ -29,7 +29,7 @@ def value_to_char(value): return chosen_char * 2 # Double chars to - sort of - correct aspect ratio -while(True): +while True: print("Capturing...") time.sleep(0.1) diff --git a/micropython/examples/breakout_pmw3901/motion.py b/micropython/examples/breakout_pmw3901/motion.py index 59eaab56..e33f3383 100644 --- a/micropython/examples/breakout_pmw3901/motion.py +++ b/micropython/examples/breakout_pmw3901/motion.py @@ -16,7 +16,7 @@ ty = 0 x = 0 y = 0 -while(True): +while True: delta = flo.get_motion() if delta is not None: x = delta[0] diff --git a/micropython/examples/common/lib/tinyweb/server.py b/micropython/examples/common/lib/tinyweb/server.py index d0d15952..c274a072 100644 --- a/micropython/examples/common/lib/tinyweb/server.py +++ b/micropython/examples/common/lib/tinyweb/server.py @@ -16,7 +16,7 @@ import usocket as socket log = logging.getLogger('WEB') -type_gen = type((lambda: (yield))()) +type_gen = type((lambda: (yield))()) # noqa: E275 # uasyncio v3 is shipped with MicroPython 1.13, and contains some subtle # but breaking changes. See also https://github.com/peterhinch/micropython-async/blob/master/v3/README.md