Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
78900af
aioble: Add short name support to scan results.
FlantasticDan Feb 16, 2023
52fcb8e
cbor2: Add cbor2 library.
iabdalkader Nov 29, 2022
9ee0257
senml: Add SenML library.
iabdalkader Sep 27, 2022
1eb282a
tools/ci.sh: Support publishing package and index files to GitHub Pages.
projectgus Feb 20, 2023
40dfc5f
github/workflows: Attach built packages to GitHub workflow artifacts.
projectgus Feb 24, 2023
b9741f6
cbor2: Remove u-module prefix from imports.
iabdalkader Mar 2, 2023
295a9e3
senml: Remove u-module prefix from imports.
iabdalkader Mar 2, 2023
c860319
senml: Fix data record encoding to use binascii instead of base64.
iabdalkader Mar 3, 2023
ea21cb3
iperf3: Support devices without os.urandom().
dpgeorge Mar 21, 2023
f672353
unittest-discover: Print results when no tests are found/run.
pi-anl Mar 16, 2023
386ab99
python-ecosys: Add pypi= to metadata.
jimmo Apr 6, 2023
afc9d0a
micropython: Add missing metadata for packages.
jimmo Apr 6, 2023
9b5f4d7
tools/makepyproject.py: Add tool to generate PyPI package.
jimmo Mar 31, 2023
01db3da
senml: Allow publishing to PyPI as micropython-senml.
jimmo Mar 31, 2023
c113611
aioble: Fix descriptor flag handling.
jimmo Apr 11, 2023
a1b9aa9
aioespnow: Add library providing asyncio support for espnow module.
glenn20 Apr 7, 2023
7128d42
utarfile: Support creating/appending tar files.
dpwe May 14, 2023
1957f24
lora: Add lora modem drivers for SX127x and SX126x.
projectgus Jun 28, 2022
2fba6b8
lora: Workaround SX1262 bug with GetStatus.
projectgus Jan 16, 2023
da5ddfc
hashlib: Refactor, split, and optimise.
jimmo Jun 1, 2023
0a5b635
utarfile: Fix read/write handling of nulls in tar header.
dpgeorge Jul 21, 2023
fe3e0a2
cmd: Remove comments about using the string module.
jimmo Jul 21, 2023
66924d9
xmltok: Change StopIteration to EOFError due to PEP-479.
ThunderEX Feb 3, 2021
c48b17d
aiorepl/README.md: More info about globals.
jimmo Jul 21, 2023
c2b44ea
types: Add manifest file.
pi-anl Apr 19, 2023
0f768c9
bisect: Add manifest file.
pi-anl Apr 20, 2023
b95deb3
json: Add manifest file.
pi-anl Apr 20, 2023
028a369
keyword: Add manifest file.
pi-anl Apr 20, 2023
5329ef5
logging: Add full support for logging exception tracebacks.
pi-anl May 18, 2023
0e68c7d
copy: Declare dependency on types.
pi-anl Jun 13, 2023
ff84231
aiorepl: Replace f-string with str.format.
jimmo Jun 20, 2023
6103823
all: Remove __version__ from .py files.
jimmo Jun 22, 2023
e45a7f6
fnmatch: Fix compatibility with ure -> re.
pi-anl Jul 6, 2023
5004436
tarfile: Rename from utarfile.
jimmo Jul 21, 2023
8513bfb
requests: Rename urequests to requests.
jimmo Jul 21, 2023
87b4cda
aiorepl: Bump patch version.
jimmo Jul 21, 2023
97b7a30
xmltok: Bump patch version.
jimmo Jul 21, 2023
a19d2a3
copy: Bump patch version.
jimmo Jul 21, 2023
ebbb78e
logging: Bump minor version.
jimmo Jul 21, 2023
8fc9eda
all: Standardise x.y.z versioning for all packages.
jimmo Jul 21, 2023
752ce66
github/workflows: Build all example .py files as part of CI.
dpgeorge Jul 24, 2023
4da6e6f
all: Lint Python code with ruff.
cclauss May 2, 2023
36e74c1
zlib: Add zlib module.
jimmo Jun 26, 2023
2328592
tools/codeformat.py: Remove git state detection.
jimmo Jul 25, 2023
5cdfe71
top: Add pre-commit config.
jimmo Jul 25, 2023
efa0402
tools/codeformat.py: Fix ruff warnings.
jimmo Jul 25, 2023
ce3f282
github/workflows: Split ruff into its own action.
jimmo Jul 25, 2023
01ab7ba
iperf3: Add compatibility for servers pre version 3.2.
graeme-winter May 21, 2023
674e734
drivers/display/lcd160cr: Use isinstance() for type checking.
projectgus Aug 9, 2023
86050c3
bmm150: Remove broken reset function.
projectgus Aug 9, 2023
2d16f21
lsm6dsox: Add missing time import.
projectgus Aug 9, 2023
1f3002b
wm8960: Add missing self reference for sample table.
projectgus Aug 9, 2023
786c0ea
all: Add missing const imports
projectgus Aug 9, 2023
c6a72c7
cbor2: Improve decoder to pass Ruff F821 undefined-name.
projectgus Aug 9, 2023
991ac98
iperf3: Pre-declare some variables set in the loop.
projectgus Aug 9, 2023
b46306c
uaiohttpclient: Fix missing name in unreachable example code.
projectgus Aug 9, 2023
5b6fb2b
top: Enable Ruff linter to check undefined-name (F821).
projectgus Aug 9, 2023
1b557ee
lsm6dsox: Bump patch version.
dpgeorge Aug 23, 2023
dc765ad
wm8960: Bump patch version.
dpgeorge Aug 23, 2023
93bf707
lora: Remove the pin parameter from IRQ callback.
projectgus Aug 8, 2023
ed688cf
lora: Add STM32WL55 subghz LoRa modem class.
projectgus Nov 10, 2022
0bdecbc
lora: Note known issue with STM32WL5 HP antenna.
projectgus Aug 9, 2023
7fcc728
lora/sx126x: Fix busy timeout handling.
projectgus Aug 23, 2023
e6b89ea
all: Remove unnecessary start argument in range.
dpgeorge Aug 31, 2023
55d1d23
__future__: Add "annotations".
smurfix Sep 24, 2023
e5ba864
aioble/server.py: Add data arg for indicate.
jimmo Sep 14, 2023
46748d2
aioble/server.py: Allow BufferedCharacteristic to support all ops.
jimmo Sep 14, 2023
e025c84
requests: Fix detection of iterators in chunked data requests.
bwhitman May 30, 2023
0620d02
.github/workflows/ruff.yml: Pin to 0.1.0.
jimmo Oct 17, 2023
d8e163b
unix-ffi/re: Convert to PCRE2.
Ansuel Sep 28, 2023
ad0a259
tools/verifygitlog.py: Add git commit message checking.
jimmo Oct 26, 2023
cee0945
all: Replace "black" with "ruff format".
jimmo Oct 17, 2023
83f3991
lcd160cr: Remove support for options in manifest.
jimmo Nov 10, 2023
340243e
time: Add README to explain the purpose of the time extension library.
mattytrentini Sep 30, 2023
41aa257
base64: Implement custom maketrans and translate methods.
magixyu Nov 12, 2023
e051a12
aiorepl: Update import of asyncio.
pi-anl Oct 24, 2023
d41851c
aiorepl: Add support for paste mode (ctrl-e).
pi-anl Oct 24, 2023
10c9281
aiorepl: Add cursor left/right support.
pi-anl Oct 24, 2023
f672baa
aiorepl: Add support for raw mode (ctrl-a).
pi-anl Oct 24, 2023
ae8ea8d
os-path: Implement os.path.isfile().
scivision Sep 14, 2023
149226d
uaiohttpclient: Fix hard coded port 80.
bulletmark Nov 7, 2023
9d09cdd
uaiohttpclient: Make flake8 inspired improvements.
bulletmark Nov 7, 2023
05efdd0
uaiohttpclient: Update "yield from" to "await".
bulletmark Nov 7, 2023
9ceda53
uaiohttpclient: Update example client code.
bulletmark Nov 7, 2023
57ce3ba
aioble: Fix advertising variable name to use us not ms.
bhavesh-k Nov 20, 2023
7cdf708
aiohttp: Add new aiohttp package.
Carglglz Sep 5, 2023
803452a
umqtt.simple: Simplify check for user being unused.
felixdoerre Feb 1, 2024
35d41db
ssl: Restructure micropython SSL interface to a new tls module.
felixdoerre Feb 1, 2024
ddb1a27
hmac: Fix passing in a string for digestmod argument.
Pharkie Jan 20, 2024
56f514f
aiohttp: Fix binary data treatment.
Carglglz Jan 3, 2024
8058b29
tarfile-write: Fix permissions when adding to archive.
ubidefeo Feb 5, 2024
4cc6706
tools/ci.sh: Add unix-ffi library when testing unix-ffi subdirectory.
projectgus Feb 13, 2024
b712103
lora-sx126x: Fix invalid default configuration after reset.
projectgus Feb 13, 2024
ad6ab5a
lora-sync: Fix race with fast or failed send().
projectgus Feb 13, 2024
5462848
lora-sx127x: Implement missing syncword support.
projectgus Feb 13, 2024
35bb795
lora-sx126x: Fix syncword setting.
projectgus Feb 13, 2024
2242465
lora-sx126x: Clean up some struct formatting.
projectgus Feb 13, 2024
ffb07db
gzip: Fix recursion error in open() function.
dpgeorge Feb 29, 2024
23df50d
unix-ffi: Remove "unix_ffi" argument from require().
dpgeorge Mar 17, 2024
5c7e3fc
json: Move to unix-ffi.
jimmo Feb 22, 2024
8ee876d
cbor2: Deprecate decoder and encoder modules.
iabdalkader Mar 6, 2024
661efa4
senml: Use the updated cbor2 API.
iabdalkader Mar 6, 2024
744f8c4
usb: Add USB device support packages.
projectgus Mar 27, 2024
dfdedeb
The new lines 105 and 106 were necessary to ensure the proper handlin…
wzab Jun 10, 2024
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
Prev Previous commit
Next Next commit
all: Lint Python code with ruff.
Signed-off-by: Christian Clauss <[email protected]>
  • Loading branch information
cclauss committed Jul 24, 2023
commit 4da6e6f1b2791dd77da1287f355360be700d4f8c
4 changes: 2 additions & 2 deletions .github/workflows/build_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Setup environment
run: source tools/ci.sh && ci_build_packages_setup
- name: Check manifest files
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cleanup_published_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ jobs:
runs-on: ubuntu-latest
if: vars.MICROPY_PUBLISH_MIP_INDEX
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Clean up published files
run: source tools/ci.sh && ci_cleanup_package_index ${{ github.event.ref }}
6 changes: 4 additions & 2 deletions .github/workflows/code_formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions/checkout@v3
- run: pip install --user ruff
- run: ruff --format=github .
- uses: actions/setup-python@v4
- name: Install packages
run: source tools/ci.sh && ci_code_formatting_setup
- name: Run code formatting
Expand Down
6 changes: 3 additions & 3 deletions micropython/aioespnow/aioespnow.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ class AIOESPNow(espnow.ESPNow):
# Read one ESPNow message
async def arecv(self):
yield asyncio.core._io_queue.queue_read(self)
return self.recv(0) # type: ignore
return self.recv(0) # type: ignore[misc]

async def airecv(self):
yield asyncio.core._io_queue.queue_read(self)
return self.irecv(0) # type: ignore
return self.irecv(0) # type: ignore[misc]

async def asend(self, mac, msg=None, sync=None):
if msg is None:
msg, mac = mac, None # If msg is None: swap mac and msg
yield asyncio.core._io_queue.queue_write(self)
return self.send(mac, msg, sync) # type: ignore
return self.send(mac, msg, sync) # type: ignore[misc]

# "async for" support
def __aiter__(self):
Expand Down
2 changes: 1 addition & 1 deletion micropython/bluetooth/aioble/examples/l2cap_file_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ async def download(self, path, dest):

send_seq = await self._command(_COMMAND_SEND, path.encode())

with open(dest, "wb") as f:
with open(dest, "wb") as f: # noqa: ASYNC101
total = 0
buf = bytearray(self._channel.our_mtu)
mv = memoryview(buf)
Expand Down
2 changes: 1 addition & 1 deletion micropython/bluetooth/aioble/examples/l2cap_file_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async def l2cap_task(connection):

if send_file:
print("Sending:", send_file)
with open(send_file, "rb") as f:
with open(send_file, "rb") as f: # noqa: ASYNC101
buf = bytearray(channel.peer_mtu)
mv = memoryview(buf)
while n := f.readinto(buf):
Expand Down
8 changes: 4 additions & 4 deletions micropython/drivers/codec/wm8960/wm8960.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ def set_data_route(self, route):
raise ValueError("Invalid route")

def set_left_input(self, input):
if not input in self._input_config_table.keys():
if input not in self._input_config_table:
raise ValueError("Invalid input")

input = self._input_config_table[input]
Expand All @@ -595,7 +595,7 @@ def set_left_input(self, input):
regs[_LINVOL] = input[1]

def set_right_input(self, input):
if not input in self._input_config_table.keys():
if input not in self._input_config_table:
raise ValueError("Invalid input name")

input = self._input_config_table[input]
Expand Down Expand Up @@ -629,7 +629,7 @@ def config_data_format(self, sysclk, sample_rate, bits):
self.regs[_IFACE1] = (_IFACE1_WL_MASK, wl << _IFACE1_WL_SHIFT)

def volume(self, module, volume_l=None, volume_r=None):
if not module in self._volume_config_table.keys():
if module not in self._volume_config_table:
raise ValueError("Invalid module")

if volume_l is None: # get volume
Expand All @@ -644,7 +644,7 @@ def volume(self, module, volume_l=None, volume_r=None):

if not ((0 <= volume_l <= 100) and (0 <= volume_r <= 100)):
raise ValueError("Invalid value for volume")
elif not module in self._volume_config_table.keys():
elif module not in self._volume_config_table:
raise ValueError("Invalid module")

vol_max, regnum, flags = self._volume_config_table[module]
Expand Down
8 changes: 4 additions & 4 deletions micropython/drivers/imu/bmi270/bmi270.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,13 +524,13 @@ def __init__(
# Sanity checks
if not self._use_i2c:
raise ValueError("SPI mode is not supported")
if not gyro_odr in ODR:
if gyro_odr not in ODR:
raise ValueError("Invalid gyro sampling rate: %d" % gyro_odr)
if not gyro_scale in GYRO_SCALE:
if gyro_scale not in GYRO_SCALE:
raise ValueError("Invalid gyro scaling: %d" % gyro_scale)
if not accel_odr in ODR:
if accel_odr not in ODR:
raise ValueError("Invalid accelerometer sampling rate: %d" % accel_odr)
if not accel_scale in ACCEL_SCALE:
if accel_scale not in ACCEL_SCALE:
raise ValueError("Invalid accelerometer scaling: %d" % accel_scale)
if self._read_reg(_CHIP_ID) != 0x24:
raise OSError("No BMI270 device was found at address 0x%x" % (self.address))
Expand Down
2 changes: 1 addition & 1 deletion micropython/drivers/imu/bmm150/bmm150.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(
# Sanity checks
if not self._use_i2c:
raise ValueError("SPI mode is not supported")
if not magnet_odr in _ODR:
if magnet_odr not in _ODR:
raise ValueError("Invalid sampling rate: %d" % magnet_odr)

# Perform soft reset, and power on.
Expand Down
10 changes: 5 additions & 5 deletions micropython/drivers/imu/lsm6dsox/lsm6dsox.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,20 @@ def __init__(
accel_odr = round(accel_odr, 2)

# Sanity checks
if not gyro_odr in ODR:
if gyro_odr not in ODR:
raise ValueError("Invalid sampling rate: %d" % gyro_odr)
if not gyro_scale in SCALE_GYRO:
if gyro_scale not in SCALE_GYRO:
raise ValueError("invalid gyro scaling: %d" % gyro_scale)
if not accel_odr in ODR:
if accel_odr not in ODR:
raise ValueError("Invalid sampling rate: %d" % accel_odr)
if not accel_scale in SCALE_ACCEL:
if accel_scale not in SCALE_ACCEL:
raise ValueError("invalid accelerometer scaling: %d" % accel_scale)

# Soft-reset the device.
self.reset()

# Load and configure MLC if UCF file is provided
if ucf != None:
if ucf is not None:
self.load_mlc(ucf)

# Set Gyroscope datarate and scale.
Expand Down
4 changes: 2 additions & 2 deletions micropython/drivers/imu/lsm6dsox/lsm6dsox_mlc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def imu_int_handler(pin):
INT_FLAG = True


if INT_MODE == True:
if INT_MODE is True:
int_pin = Pin(24)
int_pin.irq(handler=imu_int_handler, trigger=Pin.IRQ_RISING)

Expand All @@ -44,5 +44,5 @@ def imu_int_handler(pin):
print(UCF_LABELS[lsm.mlc_output()[0]])
else:
buf = lsm.mlc_output()
if buf != None:
if buf is not None:
print(UCF_LABELS[buf[0]])
12 changes: 6 additions & 6 deletions micropython/drivers/imu/lsm9ds1/lsm9ds1.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,19 @@ def __init__(
self.address_magnet = address_magnet

# Sanity checks
if not gyro_odr in _ODR_IMU:
if gyro_odr not in _ODR_IMU:
raise ValueError("Invalid gyro sampling rate: %d" % gyro_odr)
if not gyro_scale in _GYRO_SCALE:
if gyro_scale not in _GYRO_SCALE:
raise ValueError("Invalid gyro scaling: %d" % gyro_scale)

if not accel_odr in _ODR_IMU:
if accel_odr not in _ODR_IMU:
raise ValueError("Invalid accelerometer sampling rate: %d" % accel_odr)
if not accel_scale in _ACCEL_SCALE:
if accel_scale not in _ACCEL_SCALE:
raise ValueError("Invalid accelerometer scaling: %d" % accel_scale)

if not magnet_odr in _ODR_MAGNET:
if magnet_odr not in _ODR_MAGNET:
raise ValueError("Invalid magnet sampling rate: %d" % magnet_odr)
if not magnet_scale in _MAGNET_SCALE:
if magnet_scale not in _MAGNET_SCALE:
raise ValueError("Invalid magnet scaling: %d" % magnet_scale)

if (self.magent_id() != b"=") or (self.gyro_id() != b"h"):
Expand Down
2 changes: 1 addition & 1 deletion micropython/lora/examples/simple_rxtx/simple_rxtx.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def main():
print("Receiving...")
rx = modem.recv(timeout_ms=5000)
if rx:
print(f"Received: {repr(rx)}")
print(f"Received: {rx!r}")
else:
print("Timeout!")
time.sleep(2)
Expand Down
2 changes: 1 addition & 1 deletion micropython/lora/examples/simple_rxtx/simple_rxtx_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async def recv_coro(modem):
print("Receiving...")
rx = await modem.recv(2000)
if rx:
print(f"Received: {repr(rx)}")
print(f"Received: {rx!r}")
else:
print("Receive timeout!")

Expand Down
2 changes: 1 addition & 1 deletion micropython/lora/lora-sx126x/lora/sx126x.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def calibrate_image(self):
else:
# DS says "Contact your Semtech representative for the other optimal
# calibration settings outside of the given frequency bands"
raise ValueError()
raise ValueError

self._cmd(">BH", _CMD_CALIBRATE_IMAGE, args)

Expand Down
2 changes: 1 addition & 1 deletion micropython/lora/lora/lora/modem.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def start_recv(self, timeout_ms=None, continuous=False, rx_length=0xFF):
#
# Part of common low-level modem API, see README.md for usage.
if continuous and timeout_ms is not None:
raise ValueError() # these two options are mutually exclusive
raise ValueError # these two options are mutually exclusive

if timeout_ms is not None:
self._rx = time.ticks_add(time.ticks_ms(), timeout_ms)
Expand Down
2 changes: 1 addition & 1 deletion micropython/senml/examples/custom_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, name, **kwargs):

def _check_value_type(self, value):
"""overriding the check on value type to make certain that only an array with 3 values is assigned: lat,lon/alt"""
if not value == None:
if value is not None:
if not isinstance(value, list):
raise Exception("invalid data type: array with 3 elements expected lat, lon, alt")

Expand Down
2 changes: 1 addition & 1 deletion micropython/senml/examples/gateway_actuators.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def gateway_callback(record, **kwargs):
:param kwargs: optional extra parameters (device can be found here)
:return: None
"""
if "device" in kwargs and kwargs["device"] != None:
if "device" in kwargs and kwargs["device"] is not None:
print("for device: " + kwargs["device"].name)
else:
print("for gateway: ")
Expand Down
6 changes: 3 additions & 3 deletions micropython/senml/senml/senml_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __next__(self):
self._index += 1
return res
else:
raise StopIteration()
raise StopIteration


class SenmlPack(SenmlBase):
Expand Down Expand Up @@ -156,7 +156,7 @@ def _check_value_type(self, value, field_name):
checks if the type of value is allowed for senml
:return: None, raisee exception if not ok.
"""
if not value == None:
if value is not None:
if not (isinstance(value, int) or isinstance(value, float)):
raise Exception("invalid type for " + field_name + ", only numbers allowed")

Expand Down Expand Up @@ -330,7 +330,7 @@ def add(self, item):
"""
if not (isinstance(item, SenmlBase)):
raise Exception("invalid type of param, SenmlRecord or SenmlPack expected")
if not item._parent == None:
if item._parent is not None:
raise Exception("item is already part of a pack")

self._data.append(item)
Expand Down
4 changes: 2 additions & 2 deletions micropython/senml/senml/senml_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _check_value_type(self, value):
checks if the type of value is allowed for senml
:return: None, raisee exception if not ok.
"""
if not value == None:
if value is not None:
if not (
isinstance(value, bool)
or isinstance(value, int)
Expand All @@ -96,7 +96,7 @@ def _check_number_type(self, value, field_name):
checks if the type of value is allowed for senml
:return: None, raisee exception if not ok.
"""
if not value == None:
if value is not None:
if not (isinstance(value, int) or isinstance(value, float)):
raise Exception("invalid type for " + field_name + ", only numbers allowed")

Expand Down
93 changes: 93 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
[tool.ruff]
exclude = [
"python-stdlib",
"unix-ffi",
]
select = [
"ASYNC", # flake8-comprehensions
"C4", # flake8-comprehensions
"C90", # McCabe cyclomatic complexity
"DTZ", # flake8-datetimez
"E", # pycodestyle
"EXE", # flake8-executable
"F", # Pyflakes
"G", # flake8-logging-format
"ICN", # flake8-import-conventions
"INT", # flake8-gettext
"ISC", # flake8-implicit-str-concat
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # Pylint
"PYI", # flake8-pyi
"RSE", # flake8-raise
"RUF", # Ruff-specific rules
"T10", # flake8-debugger
"TCH", # flake8-type-checking
"W", # pycodestyle
"YTT", # flake8-2020
# "A", # flake8-builtins
# "ANN", # flake8-annotations
# "ARG", # flake8-unused-arguments
# "B", # flake8-bugbear
# "BLE", # flake8-blind-except
# "COM", # flake8-commas
# "D", # pydocstyle
# "DJ", # flake8-django
# "EM", # flake8-errmsg
# "ERA", # eradicate
# "FBT", # flake8-boolean-trap
# "I", # isort
# "INP", # flake8-no-pep420
# "N", # pep8-naming
# "NPY", # NumPy-specific rules
# "PD", # pandas-vet
# "PT", # flake8-pytest-style
# "PTH", # flake8-use-pathlib
# "Q", # flake8-quotes
# "RET", # flake8-return
# "S", # flake8-bandit
# "SIM", # flake8-simplify
# "SLF", # flake8-self
# "T20", # flake8-print
# "TID", # flake8-tidy-imports
# "TRY", # tryceratops
# "UP", # pyupgrade
]
ignore = [
"E401",
"E402",
"E722",
"E741",
"F401",
"F403",
"F405",
"F541",
"F821",
"F841",
"ISC003", # micropython does not support implicit concatenation of f-strings
"PIE810", # micropython does not support passing tuples to .startswith or .endswith
"PLC1901",
"PLR1701",
"PLR1714",
"PLR5501",
"PLW0602",
"PLW0603",
"PLW2901",
"RUF012",
"RUF100",
]
line-length = 260
target-version = "py37"

[tool.ruff.mccabe]
max-complexity = 61

[tool.ruff.pylint]
allow-magic-value-types = ["bytes", "int", "str"]
max-args = 14
max-branches = 58
max-returns = 13
max-statements = 166

[tool.ruff.per-file-ignores]
"micropython/aiorepl/aiorepl.py" = ["PGH001"]
Loading