forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathpyproject.toml
More file actions
91 lines (90 loc) · 2.96 KB
/
pyproject.toml
File metadata and controls
91 lines (90 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# can be empty if no extra settings are needed, presence enables setuptools-scm
[tool.ruff]
target-version = "py312"
line-length = 99
# Include Python source files that don't end with .py
extend-include = [ "tools/cc1" ]
# Exclude third-party code from linting and formatting
extend-exclude = [
# CIRCUITPY-CHANGES
"extmod/ulab",
"frozen",
"lib",
"ports/analog/msdk",
"ports/atmel-samd/asf4",
"ports/broadcom/peripherals",
"ports/espress/tools",
"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/cpydiff/syntax_assign_expr.py", # intentionally incorrect CPython code
"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
# repl_: not real python files
# viper_args: uses f(*)
format.exclude = [
"tests/*/repl_*.py",
"tests/basics/*.py",
"tests/cmdline/cmd_compile_only_error.py",
"tests/micropython/test_normalize_newlines.py",
"tests/micropython/viper_args.py",
]
lint.extend-select = [ "C9", "PLC" ]
lint.exclude = [
# Ruff finds Python SyntaxError in these files
"tests/cmdline/cmd_compile_only_error.py",
"tests/cmdline/repl_autocomplete.py",
"tests/cmdline/repl_autocomplete_underscore.py",
"tests/cmdline/repl_autoindent.py",
"tests/cmdline/repl_basic.py",
"tests/cmdline/repl_cont.py",
"tests/cmdline/repl_emacs_keys.py",
"tests/cmdline/repl_paste.py",
"tests/cmdline/repl_words_move.py",
"tests/feature_check/repl_emacs_check.py",
"tests/feature_check/repl_words_move_check.py",
"tests/micropython/viper_args.py",
]
lint.extend-ignore = [
"E401",
"E402",
"E722",
"E731",
"E741",
"F401",
"F403",
"F405",
"PLC0206",
"PLC0415", # conditional imports are common in MicroPython
]
# 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" ]
lint.per-file-ignores."ports/cc3200/tools/uniflash.py" = [ "E711" ]
# Exclude all tests from linting.
lint.per-file-ignores."tests/**/*.py" = [ "ALL" ]
# Uses assignment expressions.
lint.per-file-ignores."tests/cpydiff/syntax_assign_expr.py" = [ "F821" ]
lint.mccabe.max-complexity = 40
[tool.codespell]
count = ""
ignore-regex = "\\b[A-Z]{3}\\b"
# CIRCUITPY-CHANGE: aranges
ignore-words-list = "ans,aranges,asend,deques,dout,emac,extint,hsi,iput,mis,notin,numer,ser,shft,synopsys,technic,ure,curren"
quiet-level = 3
skip = """\
*/build*,./.git,./drivers/cc3100,./lib,./ports/cc3200/FreeRTOS,./ports/cc3200/bootmgr/sl,./ports/cc3200/hal,./ports/c\
c3200/simplelink,./ports/cc3200/telnet,./ports/esp32/managed_components,./ports/nrf/drivers/bluetooth/s1*,./ports/stm\
32/usbhost,./tests,ACKNOWLEDGEMENTS,\
"""