61 lines
1.6 KiB
TOML
61 lines
1.6 KiB
TOML
# SPDX-FileCopyrightText: 2024 Scott Shawcroft for Adafruit Industries
|
|
#
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
[tool.setuptools_scm]
|
|
# can be empty if no extra settings are needed, presence enables setuptools-scm
|
|
|
|
# Ruff settings copied from MicroPython
|
|
|
|
[tool.ruff]
|
|
target-version = "py37"
|
|
|
|
line-length = 99
|
|
# Exclude third-party code from linting and formatting. Ruff doesn't know how to ignore submodules.
|
|
# Exclude the following tests:
|
|
# repl_: not real python files
|
|
# viper_args: uses f(*)
|
|
extend-exclude = [
|
|
"extmod/ulab",
|
|
"frozen",
|
|
"lib",
|
|
"ports/analog/msdk",
|
|
"ports/atmel-samd/asf4",
|
|
"ports/broadcom/peripherals",
|
|
"ports/espressif/esp-idf",
|
|
"ports/espressif/esp-protocols",
|
|
"ports/raspberrypi/sdk",
|
|
"ports/silabs/gecko_sdk",
|
|
"ports/silabs/tools/slc_cli_linux",
|
|
"ports/stm/st_driver",
|
|
"tests/*/repl_*.py",
|
|
"tests/micropython/viper_args.py",
|
|
"tools/adabot",
|
|
"tools/bitmap_font",
|
|
"tools/cc1",
|
|
"tools/huffman",
|
|
"tools/msgfmt.py",
|
|
"tools/python-semver",
|
|
"tools/uf2",
|
|
]
|
|
# Exclude third-party code, and exclude the following tests:
|
|
# basics: needs careful attention before applying automatic formatting
|
|
format.exclude = [ "tests/basics/*.py" ]
|
|
lint.extend-select = [ "C9", "PLC" ]
|
|
lint.ignore = [
|
|
"E401",
|
|
"E402",
|
|
"E722",
|
|
"E731",
|
|
"E741",
|
|
"F401",
|
|
"F403",
|
|
"F405",
|
|
"PLC1901",
|
|
]
|
|
# manifest.py files are evaluated with some global names pre-defined
|
|
lint.per-file-ignores."**/manifest.py" = [ "F821" ]
|
|
lint.per-file-ignores."ports/**/boards/**/manifest_*.py" = [ "F821" ]
|
|
# Exclude all tests from linting (does not apply to formatting).
|
|
lint.per-file-ignores."tests/**/*.py" = [ "ALL" ]
|
|
lint.mccabe.max-complexity = 40
|