The following issues were found

tests/extmod/uctypes_ptr_native_le.py
9 issues
Unable to import 'usys'
Error

Line: 1 Column: 1

              import usys

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

if usys.byteorder != "little":

            

Reported by Pylint.

Consider explicitly re-raising using the 'from' keyword
Error

Line: 7 Column: 5

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

if usys.byteorder != "little":
    print("SKIP")
    raise SystemExit


            

Reported by Pylint.

Redefining built-in 'bytes'
Error

Line: 20 Column: 1

                  "ptr2": (uctypes.PTR | 0, {"b": uctypes.UINT8 | 0}),
}

bytes = b"01"

addr = uctypes.addressof(bytes)
buf = addr.to_bytes(uctypes.sizeof(desc), "little")

S = uctypes.struct(uctypes.addressof(buf), desc, uctypes.NATIVE)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import usys

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

if usys.byteorder != "little":

            

Reported by Pylint.

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

Line: 20 Column: 1

                  "ptr2": (uctypes.PTR | 0, {"b": uctypes.UINT8 | 0}),
}

bytes = b"01"

addr = uctypes.addressof(bytes)
buf = addr.to_bytes(uctypes.sizeof(desc), "little")

S = uctypes.struct(uctypes.addressof(buf), desc, uctypes.NATIVE)

            

Reported by Pylint.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

Line: 28
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

              S = uctypes.struct(uctypes.addressof(buf), desc, uctypes.NATIVE)

print(S.ptr[0])
assert S.ptr[0] == ord("0")
print(S.ptr[1])
assert S.ptr[1] == ord("1")
print(hex(S.ptr16[0]))
assert hex(S.ptr16[0]) == "0x3130"
print(S.ptr2[0].b, S.ptr2[1].b)

            

Reported by Bandit.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

Line: 30
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

              print(S.ptr[0])
assert S.ptr[0] == ord("0")
print(S.ptr[1])
assert S.ptr[1] == ord("1")
print(hex(S.ptr16[0]))
assert hex(S.ptr16[0]) == "0x3130"
print(S.ptr2[0].b, S.ptr2[1].b)
print(S.ptr2[0].b, S.ptr2[1].b)
print(hex(S.ptr16[0]))

            

Reported by Bandit.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

Line: 32
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

              print(S.ptr[1])
assert S.ptr[1] == ord("1")
print(hex(S.ptr16[0]))
assert hex(S.ptr16[0]) == "0x3130"
print(S.ptr2[0].b, S.ptr2[1].b)
print(S.ptr2[0].b, S.ptr2[1].b)
print(hex(S.ptr16[0]))
assert (S.ptr2[0].b, S.ptr2[1].b) == (48, 49)

            

Reported by Bandit.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

Line: 36
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

              print(S.ptr2[0].b, S.ptr2[1].b)
print(S.ptr2[0].b, S.ptr2[1].b)
print(hex(S.ptr16[0]))
assert (S.ptr2[0].b, S.ptr2[1].b) == (48, 49)

            

Reported by Bandit.

ports/esp32/boards/manifest.py
9 issues
Undefined variable 'freeze'
Error

Line: 1 Column: 1

              freeze("$(PORT_DIR)/modules")
freeze("$(MPY_DIR)/tools", ("upip.py", "upip_utarfile.py"))
freeze("$(MPY_DIR)/ports/esp8266/modules", "ntptime.py")
freeze("$(MPY_DIR)/drivers/dht", "dht.py")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
include("$(MPY_DIR)/drivers/neopixel/manifest.py")

            

Reported by Pylint.

Undefined variable 'freeze'
Error

Line: 2 Column: 1

              freeze("$(PORT_DIR)/modules")
freeze("$(MPY_DIR)/tools", ("upip.py", "upip_utarfile.py"))
freeze("$(MPY_DIR)/ports/esp8266/modules", "ntptime.py")
freeze("$(MPY_DIR)/drivers/dht", "dht.py")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
include("$(MPY_DIR)/drivers/neopixel/manifest.py")

            

Reported by Pylint.

Undefined variable 'freeze'
Error

Line: 3 Column: 1

              freeze("$(PORT_DIR)/modules")
freeze("$(MPY_DIR)/tools", ("upip.py", "upip_utarfile.py"))
freeze("$(MPY_DIR)/ports/esp8266/modules", "ntptime.py")
freeze("$(MPY_DIR)/drivers/dht", "dht.py")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
include("$(MPY_DIR)/drivers/neopixel/manifest.py")

            

Reported by Pylint.

Undefined variable 'freeze'
Error

Line: 4 Column: 1

              freeze("$(PORT_DIR)/modules")
freeze("$(MPY_DIR)/tools", ("upip.py", "upip_utarfile.py"))
freeze("$(MPY_DIR)/ports/esp8266/modules", "ntptime.py")
freeze("$(MPY_DIR)/drivers/dht", "dht.py")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
include("$(MPY_DIR)/drivers/neopixel/manifest.py")

            

Reported by Pylint.

Undefined variable 'freeze'
Error

Line: 5 Column: 1

              freeze("$(MPY_DIR)/tools", ("upip.py", "upip_utarfile.py"))
freeze("$(MPY_DIR)/ports/esp8266/modules", "ntptime.py")
freeze("$(MPY_DIR)/drivers/dht", "dht.py")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
include("$(MPY_DIR)/drivers/neopixel/manifest.py")

            

Reported by Pylint.

Undefined variable 'include'
Error

Line: 6 Column: 1

              freeze("$(MPY_DIR)/ports/esp8266/modules", "ntptime.py")
freeze("$(MPY_DIR)/drivers/dht", "dht.py")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
include("$(MPY_DIR)/drivers/neopixel/manifest.py")

            

Reported by Pylint.

Undefined variable 'include'
Error

Line: 7 Column: 1

              freeze("$(MPY_DIR)/drivers/dht", "dht.py")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
include("$(MPY_DIR)/drivers/neopixel/manifest.py")

            

Reported by Pylint.

Undefined variable 'include'
Error

Line: 8 Column: 1

              freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
include("$(MPY_DIR)/drivers/neopixel/manifest.py")

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              freeze("$(PORT_DIR)/modules")
freeze("$(MPY_DIR)/tools", ("upip.py", "upip_utarfile.py"))
freeze("$(MPY_DIR)/ports/esp8266/modules", "ntptime.py")
freeze("$(MPY_DIR)/drivers/dht", "dht.py")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
include("$(MPY_DIR)/extmod/webrepl/manifest.py")
include("$(MPY_DIR)/drivers/neopixel/manifest.py")

            

Reported by Pylint.

tests/basics/exceptpoly.py
9 issues
Catching too general exception Exception
Error

Line: 3 Column: 8

              try:
    raise ArithmeticError
except Exception:
    print("Caught ArithmeticError via Exception")

try:
    raise ArithmeticError
except ArithmeticError:
    print("Caught ArithmeticError")

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 13 Column: 8

              
try:
    raise AssertionError
except Exception:
    print("Caught AssertionError via Exception")

try:
    raise AssertionError
except AssertionError:

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 23 Column: 8

              
try:
    raise AttributeError
except Exception:
    print("Caught AttributeError via Exception")

try:
    raise AttributeError
except AttributeError:

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 33 Column: 8

              
try:
    raise EOFError
except Exception:
    print("Caught EOFError via Exception")

try:
    raise EOFError
except EOFError:

            

Reported by Pylint.

Catching too general exception BaseException
Error

Line: 43 Column: 8

              
try:
    raise Exception
except BaseException:
    print("Caught Exception via BaseException")

try:
    raise Exception
except Exception:

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 48 Column: 8

              
try:
    raise Exception
except Exception:
    print("Caught Exception")

try:
    raise ImportError
except Exception:

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 53 Column: 8

              
try:
    raise ImportError
except Exception:
    print("Caught ImportError via Exception")

try:
    raise ImportError
except ImportError:

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 93 Column: 8

              
try:
    raise LookupError
except Exception:
    print("Caught LookupError via Exception")

try:
    raise LookupError
except LookupError:

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    raise ArithmeticError
except Exception:
    print("Caught ArithmeticError via Exception")

try:
    raise ArithmeticError
except ArithmeticError:
    print("Caught ArithmeticError")

            

Reported by Pylint.

tests/micropython/viper_subscr.py
9 issues
Undefined variable 'micropython'
Error

Line: 4 Column: 2

              # test standard Python subscr using viper types


@micropython.viper
def get(dest, i: int):
    i += 1
    return dest[i]



            

Reported by Pylint.

Undefined variable 'micropython'
Error

Line: 10 Column: 2

                  return dest[i]


@micropython.viper
def set(dest, i: int, val: int):
    i += 1
    dest[i] = val + 1



            

Reported by Pylint.

Redefining name 'i' from outer scope (line 18)
Error

Line: 5 Column: 15

              

@micropython.viper
def get(dest, i: int):
    i += 1
    return dest[i]


@micropython.viper

            

Reported by Pylint.

Redefining name 'i' from outer scope (line 18)
Error

Line: 11 Column: 15

              

@micropython.viper
def set(dest, i: int, val: int):
    i += 1
    dest[i] = val + 1


ar = [i for i in range(3)]

            

Reported by Pylint.

Redefining built-in 'set'
Error

Line: 11 Column: 1

              

@micropython.viper
def set(dest, i: int, val: int):
    i += 1
    dest[i] = val + 1


ar = [i for i in range(3)]

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test standard Python subscr using viper types


@micropython.viper
def get(dest, i: int):
    i += 1
    return dest[i]



            

Reported by Pylint.

Missing function or method docstring
Error

Line: 5 Column: 1

              

@micropython.viper
def get(dest, i: int):
    i += 1
    return dest[i]


@micropython.viper

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 11 Column: 1

              

@micropython.viper
def set(dest, i: int, val: int):
    i += 1
    dest[i] = val + 1


ar = [i for i in range(3)]

            

Reported by Pylint.

Unnecessary use of a comprehension
Error

Line: 16 Column: 1

                  dest[i] = val + 1


ar = [i for i in range(3)]

for i in range(len(ar)):
    set(ar, i - 1, i)
print(ar)


            

Reported by Pylint.

tests/basics/del_attr.py
9 issues
Method has no argument
Error

Line: 2 Column: 5

              class C:
    def f():
        pass

# del a class attribute

del C.f
try:
    print(C.x)

            

Reported by Pylint.

Attribute 'x' defined outside __init__
Error

Line: 21 Column: 1

              
c = C()

c.x = 1
print(c.x)

del c.x
try:
    print(c.x)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              class C:
    def f():
        pass

# del a class attribute

del C.f
try:
    print(C.x)

            

Reported by Pylint.

Class name "C" doesn't conform to PascalCase naming style
Error

Line: 1 Column: 1

              class C:
    def f():
        pass

# del a class attribute

del C.f
try:
    print(C.x)

            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 1 Column: 1

              class C:
    def f():
        pass

# del a class attribute

del C.f
try:
    print(C.x)

            

Reported by Pylint.

Missing class docstring
Error

Line: 1 Column: 1

              class C:
    def f():
        pass

# del a class attribute

del C.f
try:
    print(C.x)

            

Reported by Pylint.

Method name "f" doesn't conform to snake_case naming style
Error

Line: 2 Column: 5

              class C:
    def f():
        pass

# del a class attribute

del C.f
try:
    print(C.x)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 2 Column: 5

              class C:
    def f():
        pass

# del a class attribute

del C.f
try:
    print(C.x)

            

Reported by Pylint.

Attribute name "x" doesn't conform to snake_case naming style
Error

Line: 21 Column: 1

              
c = C()

c.x = 1
print(c.x)

del c.x
try:
    print(c.x)

            

Reported by Pylint.

tests/basics/logic_constfolding.py
9 issues
Undefined variable 'foo'
Error

Line: 12 Column: 12

                  return False

print(0 or False)
print(1 or foo)
print(f_false() or 1 or foo)
print(f_false() or 1 or f_true())

print(0 and foo)
print(1 and True)

            

Reported by Pylint.

Undefined variable 'foo'
Error

Line: 13 Column: 25

              
print(0 or False)
print(1 or foo)
print(f_false() or 1 or foo)
print(f_false() or 1 or f_true())

print(0 and foo)
print(1 and True)
print(f_true() and 0 and foo)

            

Reported by Pylint.

Undefined variable 'foo'
Error

Line: 16 Column: 13

              print(f_false() or 1 or foo)
print(f_false() or 1 or f_true())

print(0 and foo)
print(1 and True)
print(f_true() and 0 and foo)
print(f_true() and 1 and f_false())

print(not 0)

            

Reported by Pylint.

Undefined variable 'foo'
Error

Line: 18 Column: 26

              
print(0 and foo)
print(1 and True)
print(f_true() and 0 and foo)
print(f_true() and 1 and f_false())

print(not 0)
print(not False)
print(not 1)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # tests logical constant folding in parser

def f_true():
    print('f_true')
    return True

def f_false():
    print('f_false')
    return False

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 3 Column: 1

              # tests logical constant folding in parser

def f_true():
    print('f_true')
    return True

def f_false():
    print('f_false')
    return False

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 7 Column: 1

                  print('f_true')
    return True

def f_false():
    print('f_false')
    return False

print(0 or False)
print(1 or foo)

            

Reported by Pylint.

Consider changing "not not 0" to "0"
Error

Line: 25 Column: 7

              print(not False)
print(not 1)
print(not True)
print(not not 0)
print(not not 1)

            

Reported by Pylint.

Consider changing "not not 1" to "1"
Error

Line: 26 Column: 7

              print(not 1)
print(not True)
print(not not 0)
print(not not 1)

            

Reported by Pylint.

tests/thread/thread_exc1.py
9 issues
Undefined variable 'n_finished'
Error

Line: 19 Column: 9

                      pass
    with lock:
        global n_finished
        n_finished += 1


lock = _thread.allocate_lock()
n_thread = 4
n_finished = 0

            

Reported by Pylint.

Using the global statement
Error

Line: 18 Column: 9

                  except ValueError:
        pass
    with lock:
        global n_finished
        n_finished += 1


lock = _thread.allocate_lock()
n_thread = 4

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test raising and catching an exception within a thread
#
# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd

import _thread


def foo():
    raise ValueError

            

Reported by Pylint.

Black listed name "foo"
Error

Line: 8 Column: 1

              import _thread


def foo():
    raise ValueError


def thread_entry():
    try:

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 8 Column: 1

              import _thread


def foo():
    raise ValueError


def thread_entry():
    try:

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 12 Column: 1

                  raise ValueError


def thread_entry():
    try:
        foo()
    except ValueError:
        pass
    with lock:

            

Reported by Pylint.

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

Line: 18 Column: 9

                  except ValueError:
        pass
    with lock:
        global n_finished
        n_finished += 1


lock = _thread.allocate_lock()
n_thread = 4

            

Reported by Pylint.

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

Line: 23 Column: 1

              

lock = _thread.allocate_lock()
n_thread = 4
n_finished = 0

# spawn threads
for i in range(n_thread):
    while True:

            

Reported by Pylint.

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

Line: 24 Column: 1

              
lock = _thread.allocate_lock()
n_thread = 4
n_finished = 0

# spawn threads
for i in range(n_thread):
    while True:
        try:

            

Reported by Pylint.

tests/basics/closure2.py
9 issues
Redefining name 'x' from outer scope (line 11)
Error

Line: 3 Column: 7

              # closures; closing over an argument

def f(x):
    y = 2 * x
    def g(z):
        return x + y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

Redefining name 'y' from outer scope (line 12)
Error

Line: 4 Column: 5

              # closures; closing over an argument

def f(x):
    y = 2 * x
    def g(z):
        return x + y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # closures; closing over an argument

def f(x):
    y = 2 * x
    def g(z):
        return x + y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 3 Column: 1

              # closures; closing over an argument

def f(x):
    y = 2 * x
    def g(z):
        return x + y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

Function name "f" doesn't conform to snake_case naming style
Error

Line: 3 Column: 1

              # closures; closing over an argument

def f(x):
    y = 2 * x
    def g(z):
        return x + y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

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

Line: 3 Column: 1

              # closures; closing over an argument

def f(x):
    y = 2 * x
    def g(z):
        return x + y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

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

Line: 4 Column: 5

              # closures; closing over an argument

def f(x):
    y = 2 * x
    def g(z):
        return x + y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

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

Line: 5 Column: 5

              
def f(x):
    y = 2 * x
    def g(z):
        return x + y + z
    return g

print(f(1)(1))


            

Reported by Pylint.

Function name "g" doesn't conform to snake_case naming style
Error

Line: 5 Column: 5

              
def f(x):
    y = 2 * x
    def g(z):
        return x + y + z
    return g

print(f(1)(1))


            

Reported by Pylint.

tests/basics/closure1.py
9 issues
Redefining name 'x' from outer scope (line 11)
Error

Line: 3 Column: 7

              # closures

def f(x):
    y = 2 * x
    def g(z):
        return y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

Redefining name 'y' from outer scope (line 12)
Error

Line: 4 Column: 5

              # closures

def f(x):
    y = 2 * x
    def g(z):
        return y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # closures

def f(x):
    y = 2 * x
    def g(z):
        return y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

Function name "f" doesn't conform to snake_case naming style
Error

Line: 3 Column: 1

              # closures

def f(x):
    y = 2 * x
    def g(z):
        return y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 3 Column: 1

              # closures

def f(x):
    y = 2 * x
    def g(z):
        return y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

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

Line: 3 Column: 1

              # closures

def f(x):
    y = 2 * x
    def g(z):
        return y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

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

Line: 4 Column: 5

              # closures

def f(x):
    y = 2 * x
    def g(z):
        return y + z
    return g

print(f(1)(1))

            

Reported by Pylint.

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

Line: 5 Column: 5

              
def f(x):
    y = 2 * x
    def g(z):
        return y + z
    return g

print(f(1)(1))


            

Reported by Pylint.

Function name "g" doesn't conform to snake_case naming style
Error

Line: 5 Column: 5

              
def f(x):
    y = 2 * x
    def g(z):
        return y + z
    return g

print(f(1)(1))


            

Reported by Pylint.

examples/ledangle.py
9 issues
Module 'pyb' has no 'LED' member; maybe 'LCD'?
Error

Line: 6 Column: 10

              
def led_angle(seconds_to_run_for):
    # make LED objects
    l1 = pyb.LED(1)
    l2 = pyb.LED(2)
    accel = pyb.Accel()

    for i in range(20 * seconds_to_run_for):
        # get x-axis

            

Reported by Pylint.

Module 'pyb' has no 'LED' member; maybe 'LCD'?
Error

Line: 7 Column: 10

              def led_angle(seconds_to_run_for):
    # make LED objects
    l1 = pyb.LED(1)
    l2 = pyb.LED(2)
    accel = pyb.Accel()

    for i in range(20 * seconds_to_run_for):
        # get x-axis
        x = accel.x()

            

Reported by Pylint.

Module 'pyb' has no 'Accel' member
Error

Line: 8 Column: 13

                  # make LED objects
    l1 = pyb.LED(1)
    l2 = pyb.LED(2)
    accel = pyb.Accel()

    for i in range(20 * seconds_to_run_for):
        # get x-axis
        x = accel.x()


            

Reported by Pylint.

Unused variable 'i'
Error

Line: 10 Column: 9

                  l2 = pyb.LED(2)
    accel = pyb.Accel()

    for i in range(20 * seconds_to_run_for):
        # get x-axis
        x = accel.x()

        # turn on LEDs depending on angle
        if x < -10:

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import pyb


def led_angle(seconds_to_run_for):
    # make LED objects
    l1 = pyb.LED(1)
    l2 = pyb.LED(2)
    accel = pyb.Accel()


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 4 Column: 1

              import pyb


def led_angle(seconds_to_run_for):
    # make LED objects
    l1 = pyb.LED(1)
    l2 = pyb.LED(2)
    accel = pyb.Accel()


            

Reported by Pylint.

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

Line: 6 Column: 5

              
def led_angle(seconds_to_run_for):
    # make LED objects
    l1 = pyb.LED(1)
    l2 = pyb.LED(2)
    accel = pyb.Accel()

    for i in range(20 * seconds_to_run_for):
        # get x-axis

            

Reported by Pylint.

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

Line: 7 Column: 5

              def led_angle(seconds_to_run_for):
    # make LED objects
    l1 = pyb.LED(1)
    l2 = pyb.LED(2)
    accel = pyb.Accel()

    for i in range(20 * seconds_to_run_for):
        # get x-axis
        x = accel.x()

            

Reported by Pylint.

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

Line: 12 Column: 9

              
    for i in range(20 * seconds_to_run_for):
        # get x-axis
        x = accel.x()

        # turn on LEDs depending on angle
        if x < -10:
            l1.on()
            l2.off()

            

Reported by Pylint.