ruff icon indicating copy to clipboard operation
ruff copied to clipboard

Implement pylint's `too-many-statements` rule (`PLR0915`)

Open chanman3388 opened this issue 2 years ago • 3 comments

https://pylint.pycqa.org/en/latest/user_guide/messages/refactor/too-many-statements.html

A bit of a quirky one, I made a bunch of test cases in python to see how pylint would work (tested on 2.9.3) to derive the expected behaviour.

chanman3388 avatar Feb 01 '23 17:02 chanman3388

I'm unsure how to fix the unittest as it passes for me locally:

➜  ruff git:(PLR0915) cargo test rules::pylint::tests::max_statements                    
    Finished test [unoptimized + debuginfo] target(s) in 0.84s
     Running unittests src/lib.rs (target/debug/deps/ruff-6394b47557a9e4c6)

running 1 test
test rules::pylint::tests::max_statements ... ok

chanman3388 avatar Feb 01 '23 17:02 chanman3388

Looks like it's failing due to No such file or directory. Let me see...

charliermarsh avatar Feb 01 '23 17:02 charliermarsh

Can't for the life of me figure out that failure. Going to try downgrading insta I guess?

charliermarsh avatar Feb 01 '23 18:02 charliermarsh

Can't for the life of me figure out that failure. Going to try downgrading insta I guess?

I think I figured it out, I put the wrong path inside of src/rules/pylint/mod.rs

chanman3388 avatar Feb 01 '23 18:02 chanman3388