Core: Add a ruff.toml to the root directory (#5259)
* Add a ruff.toml to the root directory * spell out C901 * Add target version * Add some more of the suggested rules * ignore PLC0415 * TC is bad * ignore B0011 * ignore N818 * Ignore some more rules * Add PLC1802 to ignore list * Update ruff.toml Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com> * oops * R to RET and RSC * oops * Py311 * Update ruff.toml --------- Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
This commit is contained in:
16
ruff.toml
Normal file
16
ruff.toml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
line-length = 120
|
||||||
|
indent-width = 4
|
||||||
|
target-version = "py311"
|
||||||
|
|
||||||
|
[lint]
|
||||||
|
select = ["B", "C", "E", "F", "W", "I", "N", "Q", "UP", "RET", "RSE", "RUF", "ISC", "PLC", "PLE", "PLW", "T20", "PERF"]
|
||||||
|
ignore = [
|
||||||
|
"B011", # In AP, the use of assert False is essential because we optimise out these statements for release builds.
|
||||||
|
"C901", # Author disagrees with limiting branch complexity
|
||||||
|
"N818", # Author agrees with this rule, but Core AP violates this and changing it would be a hassle.
|
||||||
|
"PLC0415", # In AP, we consider local imports totally fine & necessary
|
||||||
|
"PLC1802", # Author agrees with this rule, but it literally changes the functionality of the code, which is unsafe.
|
||||||
|
"PLC1901", # This is just not equivalent
|
||||||
|
"PLE1141", # Gives false positives when the dict keys are tuples, but does not mention this in the suggested fix.
|
||||||
|
"UP015", # Explicit is better than implicit, so we'd prefer to keep "r" in open() calls.
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user