GenomicMedLab / software-templates

Cookiecutter templates for lab software projects
MIT License
0 stars 0 forks source link

Consider adding `too-many-statements` ruff rule #25

Open korikuzma opened 5 months ago

korikuzma commented 5 months ago

After this comment, I think we should consider adding this rule

https://docs.astral.sh/ruff/rules/too-many-statements/

too-many-statements (PLR0915)#

Derived from the Pylint linter. What it does#

Checks for functions or methods with too many statements.

By default, this rule allows up to 50 statements, as configured by the lint.pylint.max-statements option. Why is this bad?#

Functions or methods with many statements are harder to understand and maintain.

Instead, consider refactoring the function or method into smaller functions or methods, or identifying generalizable patterns and replacing them with generic logic or abstractions.

github-actions[bot] commented 4 months ago

This issue is stale because it has been open 45 days with no activity. Please make a comment for triaging or closing the issue.

korikuzma commented 4 months ago

I'd still like this. @jsstevenson what do you think?

jsstevenson commented 4 months ago

don't personally feel too strongly about this? I'd say it's better to leave room for some subjectivity, so I'd propose a pretty lax limit (something in the range of 60 or 70?)