wemake-python-styleguide: Warn about possibly infinite `while`

Rule request

Check that while True block has raise or return.

UPD: and break too.

Thesis

It’s OK to not have them for CLI entry point, but in other cases, it can be an error. So, let’s ask users explicitly noqa such cases to be sure that they really know what they’re doing.

Reasoning

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 23 (23 by maintainers)

Most upvoted comments

@sobolevn should I create an issue where we can discuss this further? For example where the information should be added in CONTRIBUTING.md and on which level it should be described? (I mean, at this point is not really relevant for this issue)

Sure, I would be happy to answer your questions! Thanks!

break is also an option. I like this one!