The following issues were found

tests/float/float_array.py
4 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 8 Column: 9

                      from array import array
    except ImportError:
        print("SKIP")
        raise SystemExit


def test(a):
    print(a)
    a.append(1.2)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    from uarray import array
except ImportError:
    try:
        from array import array
    except ImportError:
        print("SKIP")
        raise SystemExit


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 11 Column: 1

                      raise SystemExit


def test(a):
    print(a)
    a.append(1.2)
    print(len(a), "%.3f" % a[0])
    a.append(1)
    a.append(False)

            

Reported by Pylint.

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

Line: 11 Column: 1

                      raise SystemExit


def test(a):
    print(a)
    a.append(1.2)
    print(len(a), "%.3f" % a[0])
    a.append(1)
    a.append(False)

            

Reported by Pylint.

tests/float/float_struct.py
4 issues
No exception type(s) specified
Error

Line: 5 Column: 5

              try:
    try:
        import ustruct as struct
    except:
        import struct
except ImportError:
    print("SKIP")
    raise SystemExit


            

Reported by Pylint.

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

Line: 9 Column: 5

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

i = 1.0 + 1 / 2
# TODO: it looks like '=' format modifier is not yet supported
# for fmt in ('f', 'd', '>f', '>d', '<f', '<d', '=f', '=d'):
for fmt in ("f", "d", ">f", ">d", "<f", "<d"):

            

Reported by Pylint.

TODO: it looks like '=' format modifier is not yet supported
Error

Line: 12 Column: 3

                  raise SystemExit

i = 1.0 + 1 / 2
# TODO: it looks like '=' format modifier is not yet supported
# for fmt in ('f', 'd', '>f', '>d', '<f', '<d', '=f', '=d'):
for fmt in ("f", "d", ">f", ">d", "<f", "<d"):
    x = struct.pack(fmt, i)
    v = struct.unpack(fmt, x)[0]
    print("%2s: %.17f - %s" % (fmt, v, (i == v) and "passed" or "failed"))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test struct package with floats
try:
    try:
        import ustruct as struct
    except:
        import struct
except ImportError:
    print("SKIP")
    raise SystemExit

            

Reported by Pylint.

tests/float/math_factorial_intbig.py
4 issues
Statement seems to have no effect
Error

Line: 4 Column: 5

              try:
    import math

    math.factorial
except (ImportError, AttributeError):
    print("SKIP")
    raise SystemExit



            

Reported by Pylint.

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

Line: 7 Column: 5

                  math.factorial
except (ImportError, AttributeError):
    print("SKIP")
    raise SystemExit


for fun in (math.factorial,):
    for x in range(-1, 30):
        try:

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    import math

    math.factorial
except (ImportError, AttributeError):
    print("SKIP")
    raise SystemExit



            

Reported by Pylint.

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

Line: 14 Column: 9

                  for x in range(-1, 30):
        try:
            print("%d" % fun(x))
        except ValueError as e:
            print("ValueError")

            

Reported by Pylint.

tests/float/string_format_modulo2.py
4 issues
Redefining name 'num' from outer scope (line 25)
Error

Line: 4 Column: 10

              # test formatting floats with large precision, that it doesn't overflow the buffer


def test(num, num_str):
    if num == float("inf") or num == 0.0 and num_str != "0.0":
        # skip numbers that overflow or underflow the FP precision
        return
    for kind in ("e", "f", "g"):
        # check precision either side of the size of the buffer (32 bytes)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test formatting floats with large precision, that it doesn't overflow the buffer


def test(num, num_str):
    if num == float("inf") or num == 0.0 and num_str != "0.0":
        # skip numbers that overflow or underflow the FP precision
        return
    for kind in ("e", "f", "g"):
        # check precision either side of the size of the buffer (32 bytes)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 4 Column: 1

              # test formatting floats with large precision, that it doesn't overflow the buffer


def test(num, num_str):
    if num == float("inf") or num == 0.0 and num_str != "0.0":
        # skip numbers that overflow or underflow the FP precision
        return
    for kind in ("e", "f", "g"):
        # check precision either side of the size of the buffer (32 bytes)

            

Reported by Pylint.

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

Line: 12 Column: 13

                      # check precision either side of the size of the buffer (32 bytes)
        for prec in range(23, 36, 2):
            fmt = "%." + "%d" % prec + kind
            s = fmt % num
            check = abs(float(s) - num)
            if num > 1:
                check /= num
            if check > 1e-6:
                print("FAIL", num_str, fmt, s, len(s), check)

            

Reported by Pylint.

tests/float/string_format_modulo2_intbig.py
4 issues
Redefining name 'num' from outer scope (line 22)
Error

Line: 4 Column: 10

              # test formatting floats with large precision, that it doesn't overflow the buffer


def test(num, num_str):
    if num == float("inf") or num == 0.0 and num_str != "0.0":
        # skip numbers that overflow or underflow the FP precision
        return
    for kind in ("e", "f", "g"):
        # check precision either side of the size of the buffer (32 bytes)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # test formatting floats with large precision, that it doesn't overflow the buffer


def test(num, num_str):
    if num == float("inf") or num == 0.0 and num_str != "0.0":
        # skip numbers that overflow or underflow the FP precision
        return
    for kind in ("e", "f", "g"):
        # check precision either side of the size of the buffer (32 bytes)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 4 Column: 1

              # test formatting floats with large precision, that it doesn't overflow the buffer


def test(num, num_str):
    if num == float("inf") or num == 0.0 and num_str != "0.0":
        # skip numbers that overflow or underflow the FP precision
        return
    for kind in ("e", "f", "g"):
        # check precision either side of the size of the buffer (32 bytes)

            

Reported by Pylint.

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

Line: 12 Column: 13

                      # check precision either side of the size of the buffer (32 bytes)
        for prec in range(23, 36, 2):
            fmt = "%." + "%d" % prec + kind
            s = fmt % num
            check = abs(float(s) - num)
            if num > 1:
                check /= num
            if check > 1e-6:
                print("FAIL", num_str, fmt, s, len(s), check)

            

Reported by Pylint.

tests/import/pkg3/mod1.py
4 issues
Attempted relative import beyond top-level package
Error

Line: 2 Column: 1

              print("mod1 __name__:", __name__)
from . import mod2

            

Reported by Pylint.

Unused import mod2
Error

Line: 2 Column: 1

              print("mod1 __name__:", __name__)
from . import mod2

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              print("mod1 __name__:", __name__)
from . import mod2

            

Reported by Pylint.

Import "from . import mod2" should be placed at the top of the module
Error

Line: 2 Column: 1

              print("mod1 __name__:", __name__)
from . import mod2

            

Reported by Pylint.

tests/import/pkg3/subpkg1/mod1.py
4 issues
Attempted relative import beyond top-level package
Error

Line: 2 Column: 1

              print("subpkg1.mod1 __name__:", __name__)
from ..mod2 import foo

            

Reported by Pylint.

Unused foo imported from mod2
Error

Line: 2 Column: 1

              print("subpkg1.mod1 __name__:", __name__)
from ..mod2 import foo

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              print("subpkg1.mod1 __name__:", __name__)
from ..mod2 import foo

            

Reported by Pylint.

Import "from ..mod2 import foo" should be placed at the top of the module
Error

Line: 2 Column: 1

              print("subpkg1.mod1 __name__:", __name__)
from ..mod2 import foo

            

Reported by Pylint.

tests/import/rel_import_inv.py
4 issues
Attempted relative import beyond top-level package
Error

Line: 2 Column: 5

              try:
    from . import foo
except:
    print("Invalid relative import caught")

            

Reported by Pylint.

Unused import foo
Error

Line: 2 Column: 5

              try:
    from . import foo
except:
    print("Invalid relative import caught")

            

Reported by Pylint.

No exception type(s) specified
Error

Line: 3 Column: 1

              try:
    from . import foo
except:
    print("Invalid relative import caught")

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              try:
    from . import foo
except:
    print("Invalid relative import caught")

            

Reported by Pylint.

examples/accel_i2c.py
4 issues
Unable to import 'machine'
Error

Line: 7 Column: 1

              # example. For the latter, using pyb.Accel class is
# much easier.

from machine import Pin
from machine import I2C
import time

# Accelerometer needs to be powered on first. Even
# though signal is called "AVDD", and there's separate

            

Reported by Pylint.

Unable to import 'machine'
Error

Line: 8 Column: 1

              # much easier.

from machine import Pin
from machine import I2C
import time

# Accelerometer needs to be powered on first. Even
# though signal is called "AVDD", and there's separate
# "DVDD", without AVDD, it won't event talk on I2C bus.

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # This is an example on how to access accelerometer on
# PyBoard directly using I2C bus. As such, it's more
# intended to be an I2C example, rather than accelerometer
# example. For the latter, using pyb.Accel class is
# much easier.

from machine import Pin
from machine import I2C
import time

            

Reported by Pylint.

standard import "import time" should be placed before "from machine import Pin"
Error

Line: 9 Column: 1

              
from machine import Pin
from machine import I2C
import time

# Accelerometer needs to be powered on first. Even
# though signal is called "AVDD", and there's separate
# "DVDD", without AVDD, it won't event talk on I2C bus.
accel_pwr = Pin("MMA_AVDD")

            

Reported by Pylint.

ports/rp2/boards/manifest.py
4 issues
Undefined variable 'freeze'
Error

Line: 1 Column: 1

              freeze("$(PORT_DIR)/modules")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")

            

Reported by Pylint.

Undefined variable 'freeze'
Error

Line: 2 Column: 1

              freeze("$(PORT_DIR)/modules")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")

            

Reported by Pylint.

Undefined variable 'include'
Error

Line: 3 Column: 1

              freeze("$(PORT_DIR)/modules")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              freeze("$(PORT_DIR)/modules")
freeze("$(MPY_DIR)/drivers/onewire")
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")

            

Reported by Pylint.