The following issues were found

tests/extmod/framebuf1.py
6 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 5 Column: 5

                  import framebuf
except ImportError:
    print("SKIP")
    raise SystemExit

w = 5
h = 16
size = w * h // 8
buf = bytearray(size)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    import framebuf
except ImportError:
    print("SKIP")
    raise SystemExit

w = 5
h = 16
size = w * h // 8

            

Reported by Pylint.

Constant name "w" doesn't conform to UPPER_CASE naming style
Error

Line: 7 Column: 1

                  print("SKIP")
    raise SystemExit

w = 5
h = 16
size = w * h // 8
buf = bytearray(size)
maps = {
    framebuf.MONO_VLSB: "MONO_VLSB",

            

Reported by Pylint.

Constant name "h" doesn't conform to UPPER_CASE naming style
Error

Line: 8 Column: 1

                  raise SystemExit

w = 5
h = 16
size = w * h // 8
buf = bytearray(size)
maps = {
    framebuf.MONO_VLSB: "MONO_VLSB",
    framebuf.MONO_HLSB: "MONO_HLSB",

            

Reported by Pylint.

Constant name "size" doesn't conform to UPPER_CASE naming style
Error

Line: 9 Column: 1

              
w = 5
h = 16
size = w * h // 8
buf = bytearray(size)
maps = {
    framebuf.MONO_VLSB: "MONO_VLSB",
    framebuf.MONO_HLSB: "MONO_HLSB",
    framebuf.MONO_HMSB: "MONO_HMSB",

            

Reported by Pylint.

Consider iterating the dictionary directly instead of calling .keys()
Error

Line: 17 Column: 16

                  framebuf.MONO_HMSB: "MONO_HMSB",
}

for mapping in maps.keys():
    for x in range(size):
        buf[x] = 0
    fbuf = framebuf.FrameBuffer(buf, w, h, mapping)
    print(maps[mapping])
    # access as buffer

            

Reported by Pylint.

tests/net_hosted/connect_nonblock.py
6 issues
No exception type(s) specified
Error

Line: 6 Column: 1

              try:
    import usocket as socket
    import uerrno as errno
except:
    import socket, errno


def test(peer_addr):
    s = socket.socket()

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test that socket.connect() on a non-blocking socket raises EINPROGRESS

try:
    import usocket as socket
    import uerrno as errno
except:
    import socket, errno



            

Reported by Pylint.

Multiple imports on one line (socket, errno)
Error

Line: 7 Column: 5

                  import usocket as socket
    import uerrno as errno
except:
    import socket, errno


def test(peer_addr):
    s = socket.socket()
    s.setblocking(False)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 10 Column: 1

                  import socket, errno


def test(peer_addr):
    s = socket.socket()
    s.setblocking(False)
    try:
        s.connect(peer_addr)
    except OSError as er:

            

Reported by Pylint.

Variable name "s" doesn't conform to snake_case naming style
Error

Line: 11 Column: 5

              

def test(peer_addr):
    s = socket.socket()
    s.setblocking(False)
    try:
        s.connect(peer_addr)
    except OSError as er:
        print(er.errno == errno.EINPROGRESS)

            

Reported by Pylint.

Variable name "er" doesn't conform to snake_case naming style
Error

Line: 15 Column: 5

                  s.setblocking(False)
    try:
        s.connect(peer_addr)
    except OSError as er:
        print(er.errno == errno.EINPROGRESS)
    s.close()


if __name__ == "__main__":

            

Reported by Pylint.

ports/esp32/boards/manifest_release.py
6 issues
Undefined variable 'include'
Error

Line: 1 Column: 1

              include("manifest.py")

freeze("$(MPY_LIB_DIR)/python-ecosys/urequests", "urequests.py")

freeze("$(MPY_LIB_DIR)/micropython/upysh", "upysh.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.simple", "umqtt/simple.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.robust", "umqtt/robust.py")

            

Reported by Pylint.

Undefined variable 'freeze'
Error

Line: 3 Column: 1

              include("manifest.py")

freeze("$(MPY_LIB_DIR)/python-ecosys/urequests", "urequests.py")

freeze("$(MPY_LIB_DIR)/micropython/upysh", "upysh.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.simple", "umqtt/simple.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.robust", "umqtt/robust.py")

            

Reported by Pylint.

Undefined variable 'freeze'
Error

Line: 5 Column: 1

              
freeze("$(MPY_LIB_DIR)/python-ecosys/urequests", "urequests.py")

freeze("$(MPY_LIB_DIR)/micropython/upysh", "upysh.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.simple", "umqtt/simple.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.robust", "umqtt/robust.py")

            

Reported by Pylint.

Undefined variable 'freeze'
Error

Line: 6 Column: 1

              freeze("$(MPY_LIB_DIR)/python-ecosys/urequests", "urequests.py")

freeze("$(MPY_LIB_DIR)/micropython/upysh", "upysh.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.simple", "umqtt/simple.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.robust", "umqtt/robust.py")

            

Reported by Pylint.

Undefined variable 'freeze'
Error

Line: 7 Column: 1

              
freeze("$(MPY_LIB_DIR)/micropython/upysh", "upysh.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.simple", "umqtt/simple.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.robust", "umqtt/robust.py")

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              include("manifest.py")

freeze("$(MPY_LIB_DIR)/python-ecosys/urequests", "urequests.py")

freeze("$(MPY_LIB_DIR)/micropython/upysh", "upysh.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.simple", "umqtt/simple.py")
freeze("$(MPY_LIB_DIR)/micropython/umqtt.robust", "umqtt/robust.py")

            

Reported by Pylint.

py/makemoduledefs.py
6 issues
Using the global statement
Error

Line: 44 Column: 5

                  :param str c_file: path to c file to check
    :return: List[(module_name, obj_module, enabled_define)]
    """
    global pattern

    if c_file is None:
        # No c file to match the object file, skip
        return set()


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              #!/usr/bin/env python

# This pre-processor parses provided objects' c files for
# MP_REGISTER_MODULE(module_name, obj_module, enabled_define)
# These are used to generate a header with the required entries for
# "mp_rom_map_elem_t mp_builtin_module_table[]" in py/objmodule.c

from __future__ import print_function


            

Reported by Pylint.

Variable name "p" doesn't conform to snake_case naming style
Error

Line: 29 Column: 9

                  c_file = None
    relative_c_file = os.path.splitext(obj_file)[0] + ".c"
    relative_c_file = relative_c_file.lstrip("/\\")
    for p in vpath:
        possible_c_file = os.path.join(p, relative_c_file)
        if os.path.exists(possible_c_file):
            c_file = possible_c_file
            break


            

Reported by Pylint.

Constant name "pattern" doesn't conform to UPPER_CASE naming style
Error

Line: 44 Column: 5

                  :param str c_file: path to c file to check
    :return: List[(module_name, obj_module, enabled_define)]
    """
    global pattern

    if c_file is None:
        # No c file to match the object file, skip
        return set()


            

Reported by Pylint.

Line too long (102/100)
Error

Line: 71 Column: 1

                          (
                "#if ({enabled_define})\n"
                "    extern const struct _mp_obj_module_t {obj_module};\n"
                "    #define {mod_def} {{ MP_ROM_QSTR({module_name}), MP_ROM_PTR(&{obj_module}) }},\n"
                "#else\n"
                "    #define {mod_def}\n"
                "#endif\n"
            ).format(
                module_name=module_name,

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 91 Column: 1

                  print("// MICROPY_REGISTERED_MODULES")


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--vpath", default=".", help="comma separated list of folders to search for c files in"
    )
    parser.add_argument("files", nargs="*", help="list of c files to search")

            

Reported by Pylint.

tests/internal_bench/var-5-class-attr.py
6 issues
Unused argument 'num'
Error

Line: 8 Column: 10

                  num = 20000000


def test(num):
    i = 0
    while i < Foo.num:
        i += 1



            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import bench


class Foo:
    num = 20000000


def test(num):
    i = 0

            

Reported by Pylint.

Module name "var-5-class-attr" doesn't conform to snake_case naming style
Error

Line: 1 Column: 1

              import bench


class Foo:
    num = 20000000


def test(num):
    i = 0

            

Reported by Pylint.

Missing class docstring
Error

Line: 4 Column: 1

              import bench


class Foo:
    num = 20000000


def test(num):
    i = 0

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 4 Column: 1

              import bench


class Foo:
    num = 20000000


def test(num):
    i = 0

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 8 Column: 1

                  num = 20000000


def test(num):
    i = 0
    while i < Foo.num:
        i += 1



            

Reported by Pylint.

tests/extmod/framebuf4.py
6 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 5 Column: 5

                  import framebuf
except ImportError:
    print("SKIP")
    raise SystemExit


def printbuf():
    print("--8<--")
    for y in range(h):

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    import framebuf
except ImportError:
    print("SKIP")
    raise SystemExit


def printbuf():
    print("--8<--")

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 8 Column: 1

                  raise SystemExit


def printbuf():
    print("--8<--")
    for y in range(h):
        print(buf[y * w // 2 : (y + 1) * w // 2])
    print("-->8--")


            

Reported by Pylint.

Variable name "y" doesn't conform to snake_case naming style
Error

Line: 10 Column: 9

              
def printbuf():
    print("--8<--")
    for y in range(h):
        print(buf[y * w // 2 : (y + 1) * w // 2])
    print("-->8--")


w = 16

            

Reported by Pylint.

Constant name "w" doesn't conform to UPPER_CASE naming style
Error

Line: 15 Column: 1

                  print("-->8--")


w = 16
h = 8
buf = bytearray(w * h // 2)
fbuf = framebuf.FrameBuffer(buf, w, h, framebuf.GS4_HMSB)

# fill

            

Reported by Pylint.

Constant name "h" doesn't conform to UPPER_CASE naming style
Error

Line: 16 Column: 1

              

w = 16
h = 8
buf = bytearray(w * h // 2)
fbuf = framebuf.FrameBuffer(buf, w, h, framebuf.GS4_HMSB)

# fill
fbuf.fill(0x0F)

            

Reported by Pylint.

examples/network/http_client.py
6 issues
No exception type(s) specified
Error

Line: 3 Column: 1

              try:
    import usocket as socket
except:
    import socket


def main(use_stream=False):
    s = socket.socket()


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    import usocket as socket
except:
    import socket


def main(use_stream=False):
    s = socket.socket()


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 7 Column: 1

                  import socket


def main(use_stream=False):
    s = socket.socket()

    ai = socket.getaddrinfo("google.com", 80)
    print("Address infos:", ai)
    addr = ai[0][-1]

            

Reported by Pylint.

Variable name "s" doesn't conform to snake_case naming style
Error

Line: 8 Column: 5

              

def main(use_stream=False):
    s = socket.socket()

    ai = socket.getaddrinfo("google.com", 80)
    print("Address infos:", ai)
    addr = ai[0][-1]


            

Reported by Pylint.

Variable name "ai" doesn't conform to snake_case naming style
Error

Line: 10 Column: 5

              def main(use_stream=False):
    s = socket.socket()

    ai = socket.getaddrinfo("google.com", 80)
    print("Address infos:", ai)
    addr = ai[0][-1]

    print("Connect address:", addr)
    s.connect(addr)

            

Reported by Pylint.

Variable name "s" doesn't conform to snake_case naming style
Error

Line: 20 Column: 9

                  if use_stream:
        # MicroPython socket objects support stream (aka file) interface
        # directly, but the line below is needed for CPython.
        s = s.makefile("rwb", 0)
        s.write(b"GET / HTTP/1.0\r\n\r\n")
        print(s.read())
    else:
        s.send(b"GET / HTTP/1.0\r\n\r\n")
        print(s.recv(4096))

            

Reported by Pylint.

tests/internal_bench/func_args-1.1-pos_1.py
6 issues
Unused argument 'a'
Error

Line: 4 Column: 10

              import bench


def func(a):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import bench


def func(a):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

Module name "1-pos_1" doesn't conform to snake_case naming style
Error

Line: 1 Column: 1

              import bench


def func(a):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

Argument name "a" doesn't conform to snake_case naming style
Error

Line: 4 Column: 1

              import bench


def func(a):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 4 Column: 1

              import bench


def func(a):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 8 Column: 1

                  pass


def test(num):
    for i in iter(range(num)):
        func(i)


bench.run(test)

            

Reported by Pylint.

tests/internal_bench/func_args-3.1-kw_1.py
6 issues
Unused argument 'a'
Error

Line: 4 Column: 10

              import bench


def func(a):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

Module name "1-kw_1" doesn't conform to snake_case naming style
Error

Line: 1 Column: 1

              import bench


def func(a):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import bench


def func(a):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 4 Column: 1

              import bench


def func(a):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

Argument name "a" doesn't conform to snake_case naming style
Error

Line: 4 Column: 1

              import bench


def func(a):
    pass


def test(num):
    for i in iter(range(num)):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 8 Column: 1

                  pass


def test(num):
    for i in iter(range(num)):
        func(a=i)


bench.run(test)

            

Reported by Pylint.

tests/wipy/modwipy.py
6 issues
Unable to import 'wipy'
Error

Line: 6 Column: 1

              """

import os
import wipy

mch = os.uname().machine
if not "LaunchPad" in mch and not "WiPy" in mch:
    raise Exception("Board not supported!")


            

Reported by Pylint.

Module 'os' has no 'uname' member
Error

Line: 8 Column: 7

              import os
import wipy

mch = os.uname().machine
if not "LaunchPad" in mch and not "WiPy" in mch:
    raise Exception("Board not supported!")

print(wipy.heartbeat() == True)
wipy.heartbeat(False)

            

Reported by Pylint.

No exception type(s) specified
Error

Line: 20 Column: 1

              
try:
    wipy.heartbeat(True, 1)
except:
    print("Exception")

            

Reported by Pylint.

Comparison 'wipy.heartbeat() == True' should be 'wipy.heartbeat() is True' if checking for the singleton value True, or 'bool(wipy.heartbeat())' if testing for truthiness
Error

Line: 12 Column: 7

              if not "LaunchPad" in mch and not "WiPy" in mch:
    raise Exception("Board not supported!")

print(wipy.heartbeat() == True)
wipy.heartbeat(False)
print(wipy.heartbeat() == False)
wipy.heartbeat(True)
print(wipy.heartbeat() == True)


            

Reported by Pylint.

Comparison 'wipy.heartbeat() == False' should be 'wipy.heartbeat() is False' if checking for the singleton value False, or 'not wipy.heartbeat()' if testing for falsiness
Error

Line: 14 Column: 7

              
print(wipy.heartbeat() == True)
wipy.heartbeat(False)
print(wipy.heartbeat() == False)
wipy.heartbeat(True)
print(wipy.heartbeat() == True)

try:
    wipy.heartbeat(True, 1)

            

Reported by Pylint.

Comparison 'wipy.heartbeat() == True' should be 'wipy.heartbeat() is True' if checking for the singleton value True, or 'bool(wipy.heartbeat())' if testing for truthiness
Error

Line: 16 Column: 7

              wipy.heartbeat(False)
print(wipy.heartbeat() == False)
wipy.heartbeat(True)
print(wipy.heartbeat() == True)

try:
    wipy.heartbeat(True, 1)
except:
    print("Exception")

            

Reported by Pylint.