Repository: wemake-services/wemake-python-styleguide

Issue:
WPS503 on for ... else
### What's wrong

wps reports a useless `else` clause after a `for`, but I don't think the clause is useless: I don't see any way to remove it without writing *more* code:

```python
for search_path in self.environment.loader.searchpath:
    template_relative_path = Path(search_path) / relative_path
    if template_relative_path.exists():
        break
else:
    raise UserMessageError(
        f"Could not resolve path to local extension module '{relative_path}'\n"
        "Please report this issue to the template maintainers."
    )
```

This code will raise an exception if the relative file path does not exist in any of the search paths.
Doing this without the `else` clause of the `for` would require using an additional variable and condition.
Note that there are *no returns* in the `for` loop itself.

### How it should be

I think the `for ... else` clause is perfectly valid and should not be reported as a violation.

### Flake8 version and plugins

```json
{
  "dependencies": [],
  "platform": {
    "python_implementation": "CPython",
    "python_version": "3.6.9",
    "system": "Linux"
  },
  "plugins": [
    {
      "is_local": false,
      "plugin": "black",
      "version": "0.2.1"
    },
    {
      "is_local": false,
      "plugin": "flake8-bandit",
      "version": "2.1.2"
    },
    {
      "is_local": false,
      "plugin": "flake8-bugbear",
      "version": "20.11.1"
    },
    {
      "is_local": false,
      "plugin": "flake8-comprehensions",
      "version": "3.4.0"
    },
    {
      "is_local": false,
      "plugin": "flake8-darglint",
      "version": "1.7.0"
    },
    {
      "is_local": false,
      "plugin": "flake8-docstrings",
      "version": "1.6.0, pydocstyle: 6.0.0"
    },
    {
      "is_local": false,
      "plugin": "flake8-pytest-style",
      "version": "1.4.0"
    },
    {
      "is_local": false,
      "plugin": "flake8-string-format",
      "version": "0.3.0"
    },
    {
      "is_local": false,
      "plugin": "flake8-tidy-imports",
      "version": "4.2.1"
    },
    {
      "is_local": false,
      "plugin": "flake8-variables-names",
      "version": "0.0.4"
    },
    {
      "is_local": false,
      "plugin": "flake8_builtins",
      "version": "1.5.2"
    },
    {
      "is_local": false,
      "plugin": "mccabe",
      "version": "0.6.1"
    },
    {
      "is_local": false,
      "plugin": "naming",
      "version": "0.11.1"
    },
    {
      "is_local": false,
      "plugin": "pycodestyle",
      "version": "2.7.0"
    },
    {
      "is_local": false,
      "plugin": "pyflakes",
      "version": "2.3.1"
    },
    {
      "is_local": false,
      "plugin": "wps-light",
      "version": "0.15.2"
    }
  ],
  "version": "3.9.0"
}
```

### pip information

pip 21.0.1 from /home/pawamoy/.cache/pypoetry/virtualenvs/copier-templates-extensions-eR47xb6w-py3.6/lib/python3.6/site-packages/pip (python 3.6)
ansimarkup @ file:///home/pawamoy/.cache/pypoetry/artifacts/b8/57/40/8dd2b8cdf0d3d9259868d01860e431454fc119372c561ccaa6cab2ddcf/ansimarkup-1.5.0-py2.py3-none-any.whl
apipkg @ file:///home/pawamoy/.cache/pypoetry/artifacts/36/4e/81/1bd4510c7b52c12bed07a7b7ce498b7ec64afc120b0048f3778964a9d4/apipkg-1.5-py2.py3-none-any.whl
appdirs @ file:///home/pawamoy/.cache/pypoetry/artifacts/57/41/e9/f66a435327d5fae67195294adc93c04a47aee7ca7a5fd0f6ac6995d5a9/appdirs-1.4.4-py2.py3-none-any.whl
astor @ file:///home/pawamoy/.cache/pypoetry/artifacts/4a/94/1e/315d7e6e78fa859aa3f6ea783d2aced7c8f49bdb36e2f5928ce785c093/astor-0.8.1-py2.py3-none-any.whl
astunparse @ file:///home/pawamoy/.cache/pypoetry/artifacts/bd/b7/c0/c487cb1f024f9da3d67e7423e69f725954059a015c3d08a612b181e7b5/astunparse-1.6.3-py2.py3-none-any.whl
attrs @ file:///home/pawamoy/.cache/pypoetry/artifacts/cd/4f/13/dd03ddc656d8c1c51460f9ad945dd8085a650826293ac3ad8eb41e78e2/attrs-20.3.0-py2.py3-none-any.whl
autoflake @ file:///home/pawamoy/.cache/pypoetry/artifacts/b5/97/ad/a27ac8f2e6c6105598c1b7658a3ae4b543ccc1026fd4ac4689ff69250a/autoflake-1.4.tar.gz
bandit @ file:///home/pawamoy/.cache/pypoetry/artifacts/60/b5/37/5cf7ea015d3508f20e169714dd7944e7d3b64c744a73d9402be6121040/bandit-1.7.0-py3-none-any.whl
black @ file:///home/pawamoy/.cache/pypoetry/artifacts/d1/de/6a/69291535033efdd5d7ca9a5c2b9953e861cbb85cba6fde4022f12dbdbc/black-20.8b1.tar.gz
cached-property @ file:///home/pawamoy/.cache/pypoetry/artifacts/c5/93/9d/a6fd079a569cd8d68ca4aa66838c80a6a3f447eb35b77443ce7b4f9fe4/cached_property-1.5.2-py2.py3-none-any.whl
certifi @ file:///home/pawamoy/.cache/pypoetry/artifacts/c1/ee/ce/d7e3d78c6ee31f6da8986cc82d0380013f399486c1785022e7fc85df13/certifi-2020.12.5-py2.py3-none-any.whl
click @ file:///home/pawamoy/.cache/pypoetry/artifacts/f6/9e/81/c319b417053621afaecb63253ae721cd637b4b8c3cd68c634b71426041/click-7.1.2-py2.py3-none-any.whl
colorama @ file:///home/pawamoy/.cache/pypoetry/artifacts/21/30/c4/069a1ecb39563eea2aff3e6f1a5a40b83efde813a9b472b05ea510e238/colorama-0.4.4-py2.py3-none-any.whl
contextvars @ file:///home/pawamoy/.cache/pypoetry/artifacts/71/53/c1/1b93be751a01130d32f7cc67148ce12b4563e0d1a712ad690f99a79e45/contextvars-2.4.tar.gz
copier-templates-extensions==0.1.0
coverage @ file:///home/pawamoy/.cache/pypoetry/artifacts/81/f6/75/49795f5e553c9c765c3c9c8a48f50e51b76979b3069112748faf386d38/coverage-5.5-cp36-cp36m-manylinux2010_x86_64.whl
darglint @ file:///home/pawamoy/.cache/pypoetry/artifacts/62/98/96/037f7239bb6c53f36811a98cadcf4cc50b83f5a1d787a1914f0b870edc/darglint-1.7.0-py3-none-any.whl
dataclasses @ file:///home/pawamoy/.cache/pypoetry/artifacts/de/03/21/4db39c261e0b2bee2705329ad1ba06f2c4accb9c45b6f26c63dab23507/dataclasses-0.8-py3-none-any.whl
duty @ file:///home/pawamoy/.cache/pypoetry/artifacts/4c/37/4a/726bd48588ca6c959e093ecb4400c1d30d4a6b1801fedf9069bfee1fce/duty-0.6.0-py3-none-any.whl
execnet @ file:///home/pawamoy/.cache/pypoetry/artifacts/5f/d8/e7/cc589411c7292f09c637d63c593ca46a3d0e45d7c0dd1456e4a4c49500/execnet-1.8.0-py2.py3-none-any.whl
failprint @ file:///home/pawamoy/.cache/pypoetry/artifacts/a4/54/70/115161e1653ca71c01a2319abd83852cfcb674c8cb85164cc0c2707878/failprint-0.6.2-py3-none-any.whl
flake8 @ file:///home/pawamoy/.cache/pypoetry/artifacts/10/dd/ae/2d8655df22ea6bbf557048820943ab6377fbc713edceac441134eb2485/flake8-3.9.0-py2.py3-none-any.whl
flake8-bandit @ file:///home/pawamoy/.cache/pypoetry/artifacts/0a/c7/c1/7064520701235199bd20ede2480d03bd17d63502964474879c77311562/flake8_bandit-2.1.2.tar.gz
flake8-black @ file:///home/pawamoy/.cache/pypoetry/artifacts/24/31/85/c9d8a41d13b0cc0a4c4a590d6e635d6bc70ef4c1a57530d29902ec9f71/flake8-black-0.2.1.tar.gz
flake8-bugbear @ file:///home/pawamoy/.cache/pypoetry/artifacts/a4/4b/03/814821cf9397ebab6ec8b119e807dc61198fbec24bc8b3321d59d02e4c/flake8_bugbear-20.11.1-py36.py37.py38-none-any.whl
flake8-builtins @ file:///home/pawamoy/.cache/pypoetry/artifacts/41/f9/a0/5173a37c6c28b1bfae7248eebff3902a2de3be23ce563bacf45c6cce74/flake8_builtins-1.5.3-py2.py3-none-any.whl
flake8-comprehensions @ file:///home/pawamoy/.cache/pypoetry/artifacts/eb/93/1d/f9d38e402139689b3295da08ac30ccdb24f3dfb16e16baa9855b749b01/flake8_comprehensions-3.4.0-py3-none-any.whl
flake8-docstrings @ file:///home/pawamoy/.cache/pypoetry/artifacts/54/fe/91/622141e137ec5a99f1a0e2990c3fbea4c0f1bedbc0a08af766f5298371/flake8_docstrings-1.6.0-py2.py3-none-any.whl
flake8-plugin-utils @ file:///home/pawamoy/.cache/pypoetry/artifacts/07/03/e5/f7c0249c05eee375710ba0c0519ff608a61e25909296946d71c0a9dd56/flake8_plugin_utils-1.3.1-py3-none-any.whl
flake8-polyfill @ file:///home/pawamoy/.cache/pypoetry/artifacts/66/e7/9d/d3a96b1eb36faa6334aa11d8b265b6ee32b1f02f6ea016e1ad49a0fb45/flake8_polyfill-1.0.2-py2.py3-none-any.whl
flake8-pytest-style @ file:///home/pawamoy/.cache/pypoetry/artifacts/37/d1/73/0b9833ee421ea75be02450688cf7dc4040aa68cf30c2afcb61bee4b6ee/flake8_pytest_style-1.4.0-py3-none-any.whl
flake8-string-format @ file:///home/pawamoy/.cache/pypoetry/artifacts/84/d5/5b/eaf5d3d2f87ebb2914eb470a32d0fa8dda8004bdb8b6d73d7781237455/flake8_string_format-0.3.0-py2.py3-none-any.whl
flake8-tidy-imports @ file:///home/pawamoy/.cache/pypoetry/artifacts/3f/72/a0/79a73abc83942dbf48a9351a042976ce77f2e41804f37180ddda7b5e2f/flake8_tidy_imports-4.2.1-py3-none-any.whl
flake8-variables-names @ file:///home/pawamoy/.cache/pypoetry/artifacts/2e/c9/cc/72af77883e05edee3f10e3cbe68b283a1dbdfe59dc2b925ddfc2de9b34/flake8_variables_names-0.0.4.tar.gz
future @ file:///home/pawamoy/.cache/pypoetry/artifacts/8c/84/e9/16e2a01bd1155e53b60e1d54b8c9ce342b354a58f7559e889d5089239d/future-0.18.2.tar.gz
git-changelog @ file:///home/pawamoy/.cache/pypoetry/artifacts/2a/d3/2d/00e480fe1243e21be49fcb6fd381d2d826f23e5bf6718197c93adcba1b/git_changelog-0.4.2-py3-none-any.whl
gitdb @ file:///home/pawamoy/.cache/pypoetry/artifacts/89/bc/c0/ec519fe6e3ed55ee02e8c404323a57ab380b67d6bf5461443786ed7007/gitdb-4.0.7-py3-none-any.whl
GitPython @ file:///home/pawamoy/.cache/pypoetry/artifacts/4b/43/13/cb907785463a86c6cf8c4adc333eba9ff18a3ffd277d8e2039cb51c866/GitPython-3.1.14-py3-none-any.whl
h11 @ file:///home/pawamoy/.cache/pypoetry/artifacts/28/b8/cc/0fca838f03096c18d7c9bfddedcb7d6549af3fbe0230582548b5505275/h11-0.12.0-py3-none-any.whl
httpcore @ file:///home/pawamoy/.cache/pypoetry/artifacts/38/57/bb/b2e226ce4db3026d1f049f99c7f7fdce5c6d63aedf17ad52afdc2cf689/httpcore-0.12.3-py3-none-any.whl
httpx @ file:///home/pawamoy/.cache/pypoetry/artifacts/28/19/34/f15ef88b0c47874bb3b8884838b3f0410871f2673443b1944f04a27547/httpx-0.16.1-py3-none-any.whl
idna @ file:///home/pawamoy/.cache/pypoetry/artifacts/fa/25/f4/ca6c7c49ad3eef3f739401531b428f02f0e3e76696e327230dfe1dbfd7/idna-3.1-py3-none-any.whl
immutables @ file:///home/pawamoy/.cache/pypoetry/artifacts/c5/21/ea/415cdc4377f9429d6806012ad4eccf345425aca126150159ce50df2615/immutables-0.15-cp36-cp36m-manylinux1_x86_64.whl
importlib-metadata @ file:///home/pawamoy/.cache/pypoetry/artifacts/68/c5/f3/3041eb830ecade84c6bf19e6961c5f4f76d8f0035d1cfde36eb9911ef0/importlib_metadata-3.8.0-py3-none-any.whl
iniconfig @ file:///home/pawamoy/.cache/pypoetry/artifacts/14/aa/92/4a06112109b9953fe3ff5a04253f10ee5a92b9224c80b53d287400906b/iniconfig-1.1.1-py2.py3-none-any.whl
isort @ file:///home/pawamoy/.cache/pypoetry/artifacts/83/cb/04/5d44f66100d50e3a913f2c719821bf9abda277001cdaa1d997181f1151/isort-5.8.0-py3-none-any.whl
Jinja2 @ file:///home/pawamoy/.cache/pypoetry/artifacts/8a/4b/85/47c1e9cf8f99cae07aa657adae1e54f4e18d4b2e30871ac3fc57f83439/Jinja2-2.11.3-py2.py3-none-any.whl
jinja2-cli @ file:///home/pawamoy/.cache/pypoetry/artifacts/1a/76/2a/c55d9619d38ddfb9a09e2116797e8e42b342b4918dfc6c0c1a943d69a9/jinja2_cli-0.7.0-py2.py3-none-any.whl
joblib @ file:///home/pawamoy/.cache/pypoetry/artifacts/46/d5/b6/50093df38c1b9177a0f30fa9672ae49805c1e9bf4451133e2b0522532f/joblib-1.0.1-py3-none-any.whl
livereload @ file:///home/pawamoy/.cache/pypoetry/artifacts/81/8f/91/611dee09ee35601b701353a63a87879381547c3ab0670601b1dcfb2d55/livereload-2.6.3.tar.gz
lunr @ file:///home/pawamoy/.cache/pypoetry/artifacts/e0/c8/e1/4cc3da5c3efbc4c28b28434781fd5b4414c71857aea657fb30c24bbb53/lunr-0.5.8-py2.py3-none-any.whl
Markdown @ file:///home/pawamoy/.cache/pypoetry/artifacts/13/77/d2/2e3b841bb7f7bd83011d9457847a35f80df289ac2a3cf325e38d6f7d62/Markdown-3.3.4-py3-none-any.whl
MarkupSafe @ file:///home/pawamoy/.cache/pypoetry/artifacts/b0/54/79/7b535a2c5dedbf6cb1b269d321c1de0ab4bbb2d9d4e46537151005f65c/MarkupSafe-1.1.1-cp36-cp36m-manylinux2010_x86_64.whl
mccabe @ file:///home/pawamoy/.cache/pypoetry/artifacts/1e/5b/32/e78ec93754c8a551ba3672cd8324dfb4f298d5b0d2c111f7633a018b81/mccabe-0.6.1-py2.py3-none-any.whl
mkdocs @ file:///home/pawamoy/.cache/pypoetry/artifacts/83/a7/d8/a68672b2a3fe794650c4c783f1fe6e671a28e3e85353285e462328af32/mkdocs-1.1.2-py3-none-any.whl
mkdocs-autorefs @ file:///home/pawamoy/.cache/pypoetry/artifacts/ab/4e/8c/1c291e7c185d6f080980e0b88addd0a3d71b5bf429e0d19c2d9ee60c6d/mkdocs_autorefs-0.1.1-py3-none-any.whl
mkdocs-coverage @ file:///home/pawamoy/.cache/pypoetry/artifacts/25/ee/a5/872e22a28d77130721730b6a9ebe56d435801f0b4922fc11bb6f6f89e1/mkdocs_coverage-0.2.1-py3-none-any.whl
mkdocs-macros-plugin @ file:///home/pawamoy/.cache/pypoetry/artifacts/7c/e2/ab/7735dfff0f6de1b61d00bc8c06f4150658ac9a16a9309fb97ccee7afc4/mkdocs_macros_plugin-0.5.5-py3-none-any.whl
mkdocs-material @ file:///home/pawamoy/.cache/pypoetry/artifacts/41/91/ba/7090c00373a2175f75683b15a6fe128e12e676e712e495ac3b1efd1af0/mkdocs_material-6.2.8-py2.py3-none-any.whl
mkdocs-material-extensions @ file:///home/pawamoy/.cache/pypoetry/artifacts/bd/b7/bf/5fe277a16493c2ab9fcc8e0a726d1b426afbcea46befd0d7b4b48ed5db/mkdocs_material_extensions-1.0.1-py3-none-any.whl
mkdocstrings @ file:///home/pawamoy/.cache/pypoetry/artifacts/63/2d/6b/e417c126db4f3c1184d258d1443b82c985e012cfd778e4acbb78ea242e/mkdocstrings-0.15.0-py3-none-any.whl
mypy @ file:///home/pawamoy/.cache/pypoetry/artifacts/c3/5a/a7/34c3b358a1a06912d7896e7dd541c012ff191237db4fb5c5734f12b353/mypy-0.812-cp36-cp36m-manylinux2010_x86_64.whl
mypy-extensions @ file:///home/pawamoy/.cache/pypoetry/artifacts/95/d1/f7/27a186204e28c343803d003d5d6e3060731a2dabcfaa566a81411fc5e8/mypy_extensions-0.4.3-py2.py3-none-any.whl
nltk @ file:///home/pawamoy/.cache/pypoetry/artifacts/12/1f/58/edfea63324f0a8b8286043568f8d2edd7005ceffdf90cbd78e5cfea267/nltk-3.5.zip
packaging @ file:///home/pawamoy/.cache/pypoetry/artifacts/ab/a2/2b/5dee5a887dfb1893f5c9aceff75b20064001cfb16e17ecb2f4f93f581f/packaging-20.9-py2.py3-none-any.whl
pathspec @ file:///home/pawamoy/.cache/pypoetry/artifacts/93/c5/fc/e6d12908507863699c831c5eea3f4c7f3d1f4f662ff051110f3600972e/pathspec-0.8.1-py2.py3-none-any.whl
pbr @ file:///home/pawamoy/.cache/pypoetry/artifacts/c8/3f/8f/f9101f1682cb557e7113053d52c1a37315e9480f8e827cc3e4fba38aec/pbr-5.5.1-py2.py3-none-any.whl
pep8-naming @ file:///home/pawamoy/.cache/pypoetry/artifacts/b6/a2/0b/7b7ee692566feb1f379beab7788d9405f8228afecccfcedd0ad3307b72/pep8_naming-0.11.1-py2.py3-none-any.whl
pluggy @ file:///home/pawamoy/.cache/pypoetry/artifacts/d0/77/28/c8787d0072d280cd291983bd208e34d0893c619dd226179ccb5d1b67a1/pluggy-0.13.1-py2.py3-none-any.whl
ptyprocess @ file:///home/pawamoy/.cache/pypoetry/artifacts/4d/96/ab/4b8576d0ca7a2de600b185f0277625b47eb85b99b506b644206c74117e/ptyprocess-0.6.0-py2.py3-none-any.whl
py @ file:///home/pawamoy/.cache/pypoetry/artifacts/f0/fc/2a/7ed4946040058f015f583874fbda55e789c81f512855f850654b0a8d58/py-1.10.0-py2.py3-none-any.whl
pycodestyle @ file:///home/pawamoy/.cache/pypoetry/artifacts/1f/82/dd/3d79aaeade274c383aa05fd97b3d326f6ca2bafd4204809cfcf3d73efd/pycodestyle-2.7.0-py2.py3-none-any.whl
pydocstyle @ file:///home/pawamoy/.cache/pypoetry/artifacts/ed/fa/55/294243aff1e70161b41b2b66829b28ece6c1ec55d1a9e60f1e963696fa/pydocstyle-6.0.0-py3-none-any.whl
pyflakes @ file:///home/pawamoy/.cache/pypoetry/artifacts/24/f4/8d/99367d74b5110daf3587f53d8f574f164857b6d1517cbf6b0dbf25aebc/pyflakes-2.3.1-py2.py3-none-any.whl
Pygments @ file:///home/pawamoy/.cache/pypoetry/artifacts/16/5c/ae/0b44642afc1f3cdc1d195bd017753aa19e4d5540648654aff7c251ffc9/Pygments-2.8.1-py3-none-any.whl
pymdown-extensions @ file:///home/pawamoy/.cache/pypoetry/artifacts/d9/4e/3d/72b9d0e25599679bca07613c0cb6cc1d90dd22cc26f6a60f7d7c2b9106/pymdown_extensions-8.1.1-py3-none-any.whl
pyparsing @ file:///home/pawamoy/.cache/pypoetry/artifacts/d6/f5/d4/a3ac87f4cf557a0560e3be043de055641989812cc680588a262d0e093c/pyparsing-2.4.7-py2.py3-none-any.whl
pytest @ file:///home/pawamoy/.cache/pypoetry/artifacts/90/d0/38/dc8aeed03f75dca3b6369863b307c539fcbb347588f5e1b22e3cfe4d63/pytest-6.2.2-py3-none-any.whl
pytest-cov @ file:///home/pawamoy/.cache/pypoetry/artifacts/bd/e9/bb/1a8d5bfe8fd99e6ad03f6e25d2d4829bf505d088b5fb6c060cc958c337/pytest_cov-2.11.1-py2.py3-none-any.whl
pytest-forked @ file:///home/pawamoy/.cache/pypoetry/artifacts/3c/8a/6a/169b4098794c6a21614f846f60ee1a495905ef9185b07cdb2bde77a157/pytest_forked-1.3.0-py2.py3-none-any.whl
pytest-randomly @ file:///home/pawamoy/.cache/pypoetry/artifacts/18/3e/14/d6885f589aad936495fdf5d667de89859ebb8c2ca16f8312e0611bffc0/pytest_randomly-3.5.0-py3-none-any.whl
pytest-sugar @ file:///home/pawamoy/.cache/pypoetry/artifacts/24/41/0c/a125a171acb3b5b1b7f899836e5dc5150a606271d54d36e21921a20fbb/pytest-sugar-0.9.4.tar.gz
pytest-xdist @ file:///home/pawamoy/.cache/pypoetry/artifacts/50/fb/58/e775a73820036a2e3c5675c0766b84248a702afdd3adf8c3ee9e3bc5b0/pytest_xdist-2.2.1-py3-none-any.whl
python-dateutil @ file:///home/pawamoy/.cache/pypoetry/artifacts/21/0f/2e/d0431e5b008e4e2b8cccfe0df2ffdc8f88c56dc4dd32fadc23a0602017/python_dateutil-2.8.1-py2.py3-none-any.whl
pytkdocs @ file:///home/pawamoy/.cache/pypoetry/artifacts/75/a0/1c/ce6ab025cde4e62e1dae20c3c4c81655595197fa49c204a7db590af2fc/pytkdocs-0.11.0-py3-none-any.whl
PyYAML @ file:///home/pawamoy/.cache/pypoetry/artifacts/e2/40/65/f5293f417f28bd955b8dfef34e3c8e02bb12c425b77b331384e88c2225/PyYAML-5.4.1-cp36-cp36m-manylinux1_x86_64.whl
regex @ file:///home/pawamoy/.cache/pypoetry/artifacts/43/ed/32/4bebe6d9324c8f4022782ba6000bfde60d619be693d20ac786512e13f2/regex-2021.3.17-cp36-cp36m-manylinux2014_x86_64.whl
rfc3986 @ file:///home/pawamoy/.cache/pypoetry/artifacts/25/dc/7e/bf48dffdf2c5f37c65c3485ca4c5c84a9ac33797ea50ddced7d7895b60/rfc3986-1.4.0-py2.py3-none-any.whl
six @ file:///home/pawamoy/.cache/pypoetry/artifacts/8f/ad/07/430874bae6abec03a479f691b997b77007c7bc86b26ab26d01f981a83e/six-1.15.0-py2.py3-none-any.whl
smmap @ file:///home/pawamoy/.cache/pypoetry/artifacts/80/6b/b8/ad6620f5603c4ffcc8df30face1e50ec9bd7ca6aaad25bb7a5285c516b/smmap-4.0.0-py2.py3-none-any.whl
sniffio @ file:///home/pawamoy/.cache/pypoetry/artifacts/1c/94/cf/54e944a43c21e5b78fda9604e2cc0534eae826de0f8f94412a48ed1a40/sniffio-1.2.0-py3-none-any.whl
snowballstemmer @ file:///home/pawamoy/.cache/pypoetry/artifacts/ee/73/e2/94ddb1687ed48f9eacd5ced21c870d37251a3be365fe00fa006f491792/snowballstemmer-2.1.0-py2.py3-none-any.whl
stevedore @ file:///home/pawamoy/.cache/pypoetry/artifacts/e3/5e/fa/8b2e49609c7fdb9cbb8624fe98cd5a62fae43fb5d4cb9a4bd1aaa68571/stevedore-3.3.0-py3-none-any.whl
termcolor @ file:///home/pawamoy/.cache/pypoetry/artifacts/7b/e3/82/40172608a125710e65f96265c4ca9b189050ecce8ab4c8ff21c84ccd5b/termcolor-1.1.0.tar.gz
toml @ file:///home/pawamoy/.cache/pypoetry/artifacts/50/3b/bb/1cf141af105ed104d8777d0b7bffc440955814ce7fe477c0f43b34a631/toml-0.10.2-py2.py3-none-any.whl
tornado @ file:///home/pawamoy/.cache/pypoetry/artifacts/a3/d1/6b/31dcae0e2a6ea584fd91aad457da93d83e1c6407e6a8f4d3024e1400d6/tornado-6.1-cp36-cp36m-manylinux2010_x86_64.whl
tqdm @ file:///home/pawamoy/.cache/pypoetry/artifacts/d1/96/ef/7c67f40b93d2d823525a12d1528f58aac6c3573086fc288138c8bf8988/tqdm-4.59.0-py2.py3-none-any.whl
typed-ast @ file:///home/pawamoy/.cache/pypoetry/artifacts/fc/de/cd/a25342641533770d373a39527e42fb2f7d328839d9db11676a14d68e66/typed_ast-1.4.2-cp36-cp36m-manylinux1_x86_64.whl
typing-extensions @ file:///home/pawamoy/.cache/pypoetry/artifacts/79/42/43/00910585e2acfd888433c7b8e20484450bac83c008b557b25a8b5de8d7/typing_extensions-3.7.4.3-py3-none-any.whl
wps-light @ file:///home/pawamoy/.cache/pypoetry/artifacts/66/0c/fc/b5f1c6b46135ef5d4dc0fd8f6584fe7ff322e366c37217df8d4a03fa0b/wps_light-0.15.2-py3-none-any.whl
zipp @ file:///home/pawamoy/.cache/pypoetry/artifacts/2d/7d/93/1d15ad2280ef22a5d638c717b63dd3f0ec0bbb450ee20ce3cacff45ab1/zipp-3.4.1-py3-none-any.whl


### OS information

Linux 5.11.9-arch1-1




Discussion:
Yes, we should exclude `ast.Break` from this boolean check: https://github.com/wemake-services/wemake-python-styleguide/blob/1f94c390491374ef88a483de66e88228c3104bac/wemake_python_styleguide/visitors/ast/conditions.py#L204-L207

Maybe not only `Break`?
Hello @sobolevn , I would like to take this issue up as a first contributor. Could you please assign this to me? :)

Thanks a lot, @cyber1998!

Resolving patch:
diff --git a/wemake_python_styleguide/visitors/ast/conditions.py b/wemake_python_styleguide/visitors/ast/conditions.py
--- a/wemake_python_styleguide/visitors/ast/conditions.py
+++ b/wemake_python_styleguide/visitors/ast/conditions.py
@@ -200,9 +200,11 @@ def _check_useless_try_else(self, node: ast.Try) -> None:
     def _check_useless_loop_else(self, node: AnyLoop) -> None:
         if not node.orelse:
             return
-
+        # An else statement makes sense if we
+        # want to execute something after breaking
+        # out of the loop without writing more code
         body_returning = any(
-            walk.is_contained(sub, self._returning_nodes)
+            walk.is_contained(sub, self._returning_nodes[1:])
             for sub in node.body
         )
         else_returning = any(


Test patch:
diff --git a/tests/test_visitors/test_ast/test_conditions/test_useless_else/test_useless_loop_else.py b/tests/test_visitors/test_ast/test_conditions/test_useless_else/test_useless_loop_else.py
--- a/tests/test_visitors/test_ast/test_conditions/test_useless_else/test_useless_loop_else.py
+++ b/tests/test_visitors/test_ast/test_conditions/test_useless_else/test_useless_loop_else.py
@@ -146,11 +146,15 @@ def test_else_that_can_be_removed(
 ):
     """Testing that extra ``else`` blocks can be removed."""
     tree = parse_ast_tree(mode(template.format(code1, code2)))
-
     visitor = UselessElseVisitor(default_options, tree=tree)
     visitor.run()
-
-    assert_errors(visitor, [UselessReturningElseViolation])
+    overrides = ['break']  # regression1958
+    if code1 in overrides:
+        # We might want to have an else statement
+        # if the loop contains a break statement
+        assert_errors(visitor, [])
+    else:
+        assert_errors(visitor, [UselessReturningElseViolation])
 
 
 @pytest.mark.parametrize('template', [