Skip to content

all: Enable ruff E401,E402 import lints. #858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions micropython/bluetooth/aioble/examples/l2cap_file_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import sys

# ruff: noqa: E402
sys.path.append("")

from micropython import const
Expand Down
1 change: 1 addition & 0 deletions micropython/bluetooth/aioble/examples/l2cap_file_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import sys

# ruff: noqa: E402
sys.path.append("")

from micropython import const
Expand Down
1 change: 1 addition & 0 deletions micropython/bluetooth/aioble/examples/temp_client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys

# ruff: noqa: E402
sys.path.append("")

from micropython import const
Expand Down
1 change: 1 addition & 0 deletions micropython/bluetooth/aioble/examples/temp_sensor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys

# ruff: noqa: E402
sys.path.append("")

from micropython import const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import sys

# ruff: noqa: E402
sys.path.append("")

from micropython import const
import time, machine
import machine
import time

import uasyncio as asyncio
import aioble
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import sys

# ruff: noqa: E402
sys.path.append("")

from micropython import const
import time, machine
import machine
import time

import uasyncio as asyncio
import aioble
Expand Down
4 changes: 3 additions & 1 deletion micropython/bluetooth/aioble/multitests/ble_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import sys

# ruff: noqa: E402
sys.path.append("")

from micropython import const
import time, machine
import machine
import time

import uasyncio as asyncio
import aioble
Expand Down
4 changes: 3 additions & 1 deletion micropython/bluetooth/aioble/multitests/ble_notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import sys

# ruff: noqa: E402
sys.path.append("")

from micropython import const
import time, machine
import machine
import time

import uasyncio as asyncio
import aioble
Expand Down
4 changes: 3 additions & 1 deletion micropython/bluetooth/aioble/multitests/ble_shutdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import sys

# ruff: noqa: E402
sys.path.append("")

from micropython import const
import time, machine
import machine
import time

import uasyncio as asyncio
import aioble
Expand Down
4 changes: 3 additions & 1 deletion micropython/bluetooth/aioble/multitests/ble_write_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import sys

# ruff: noqa: E402
sys.path.append("")

from micropython import const
import time, machine
import machine
import time

import uasyncio as asyncio
import aioble
Expand Down
4 changes: 3 additions & 1 deletion micropython/bluetooth/aioble/multitests/ble_write_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import sys

# ruff: noqa: E402
sys.path.append("")

from micropython import const
import time, machine
import machine
import time

import uasyncio as asyncio
import aioble
Expand Down
4 changes: 3 additions & 1 deletion micropython/bluetooth/aioble/multitests/perf_gatt_notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import sys

# ruff: noqa: E402
sys.path.append("")

from micropython import const
import time, machine
import machine
import time

import uasyncio as asyncio
import aioble
Expand Down
4 changes: 3 additions & 1 deletion micropython/bluetooth/aioble/multitests/perf_l2cap.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import sys

# ruff: noqa: E402
sys.path.append("")

from micropython import const
import time, machine
import machine
import time

import uasyncio as asyncio
import aioble
Expand Down
3 changes: 2 additions & 1 deletion micropython/drivers/display/lcd160cr/lcd160cr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
# MIT license; Copyright (c) 2017 Damien P. George

from micropython import const
import machine
from utime import sleep_ms
from ustruct import calcsize, pack_into
import uerrno, machine
import uerrno

# for set_orient
PORTRAIT = const(0)
Expand Down
5 changes: 4 additions & 1 deletion micropython/drivers/display/lcd160cr/lcd160cr_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Driver test for official MicroPython LCD160CR display
# MIT license; Copyright (c) 2017 Damien P. George

import time, math, framebuf, lcd160cr
import framebuf
import lcd160cr
import math
import time


def get_lcd(lcd):
Expand Down
4 changes: 3 additions & 1 deletion micropython/drivers/storage/sdcard/sdtest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Test for sdcard block protocol
# Peter hinch 30th Jan 2016
import os, sdcard, machine
import machine
import os
import sdcard


def sdtest():
Expand Down
8 changes: 3 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,12 @@ select = [
# "UP", # pyupgrade
]
ignore = [
"E401",
"E402",
"E722",
"E741",
"E741", # 'l' is currently widely used
"F401",
"F403",
"F405",
"E501",
"E501", # line length, recommended to disable
"ISC001",
"ISC003", # micropython does not support implicit concatenation of f-strings
"PIE810", # micropython does not support passing tuples to .startswith or .endswith
Expand All @@ -74,7 +72,7 @@ ignore = [
"PLW2901",
"RUF012",
"RUF100",
"W191",
"W191", # tab-indent, redundant when using formatter
]
line-length = 99
target-version = "py37"
Expand Down
3 changes: 2 additions & 1 deletion python-ecosys/aiohttp/aiohttp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def _decode(self, data):
c_encoding = self.headers.get("Content-Encoding")
if c_encoding in ("gzip", "deflate", "gzip,deflate"):
try:
import deflate, io
import deflate
import io

if c_encoding == "deflate":
with deflate.DeflateIO(io.BytesIO(data), deflate.ZLIB) as d:
Expand Down
1 change: 1 addition & 0 deletions python-ecosys/aiohttp/examples/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys

# ruff: noqa: E402
sys.path.insert(0, ".")
import aiohttp
import asyncio
Expand Down
1 change: 1 addition & 0 deletions python-ecosys/aiohttp/examples/compression.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys

# ruff: noqa: E402
sys.path.insert(0, ".")
import aiohttp
import asyncio
Expand Down
1 change: 1 addition & 0 deletions python-ecosys/aiohttp/examples/get.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys

# ruff: noqa: E402
sys.path.insert(0, ".")
import aiohttp
import asyncio
Expand Down
1 change: 1 addition & 0 deletions python-ecosys/aiohttp/examples/headers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys

# ruff: noqa: E402
sys.path.insert(0, ".")
import aiohttp
import asyncio
Expand Down
1 change: 1 addition & 0 deletions python-ecosys/aiohttp/examples/methods.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys

# ruff: noqa: E402
sys.path.insert(0, ".")
import aiohttp
import asyncio
Expand Down
1 change: 1 addition & 0 deletions python-ecosys/aiohttp/examples/params.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys

# ruff: noqa: E402
sys.path.insert(0, ".")
import aiohttp
import asyncio
Expand Down
1 change: 1 addition & 0 deletions python-ecosys/aiohttp/examples/ws.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys

# ruff: noqa: E402
sys.path.insert(0, ".")
import aiohttp
import asyncio
Expand Down
1 change: 1 addition & 0 deletions python-ecosys/aiohttp/examples/ws_repl_echo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys

# ruff: noqa: E402
sys.path.insert(0, ".")
import aiohttp
import asyncio
Expand Down
7 changes: 5 additions & 2 deletions python-ecosys/iperf3/iperf3.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
iperf3.client('192.168.1.5', udp=True, reverse=True)
"""

import sys, struct
import time, select, socket
import json
import select
import socket
import struct
import sys
import time

# Provide a urandom() function, supporting devices without os.urandom().
try:
Expand Down
Loading