add TooManyCommentsViolation
rule request
# Rule request
<!-- Thanks for coming up with a proposal! -->
## Thesis
<!-- What exactly do you propose? Please, provide code examples. -->
Nowadays, developers often use an excessive number of comments, which leads to unclear code, loss of readability, increased cognitive load, trying replace good documentation.
This rule complements [WPS 402.](https://wemake-python-styleguide.readthedocs.io/en/latest/pages/usage/violations/best_practices.html#wemake_python_styleguide.violations.best_practices.OveruseOfNoqaCommentViolation).
Let's be honest: people often write comments because their code is less readable and overly complex.
## Reasoning
The most appropriate solution is to introduce a new violation called `TooManyCommentsViolation`.
This violation would enforce a maximum of `N` comments inside functions or methods (and in the future, we could extend it to all files).
<!--
Why do you think this is a good idea?
Please, include some strong points and considerations.
-->
<!--
Love wemake-python-styleguide? ❤️
Do you want your features to be implemented faster?
Please consider supporting our collective:
👉 https://opencollective.com/wemake-python-styleguide/donate
-->
5 条评论