Repository: wemake-services/wemake-python-styleguide

Issue:
Detect constant conditions in `match`
This `match` condition does not report any violations right now:

```python
match 1:
    case SomeClass(field): ...
```

However, this does report a violation:

```python
if 1: ...
```

```
  1:4      WPS314 Found conditional that always evaluates the same
  if 1: ...
     ^
```

What needs to be done?
- Change docs here: https://github.com/wemake-services/wemake-python-styleguide/blob/e878f3a0cd17c612ad1bc4b442bdcd1c005d20c2/wemake_python_styleguide/violations/consistency.py#L664
- Add new `visit_Match` to https://github.com/wemake-services/wemake-python-styleguide/blob/e878f3a0cd17c612ad1bc4b442bdcd1c005d20c2/wemake_python_styleguide/visitors/ast/compares.py#L169

with something like:

```python
    def visit_Match(self, node: ast.Match) -> None:
        self._check_constant_condition(node.subject)
        self.generic_visit(node)
```
- Add tests to https://github.com/wemake-services/wemake-python-styleguide/blob/master/tests/test_visitors/test_ast/test_compares/test_conditionals.py
- Update `CHANGELOG.md`

Discussion:
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/wemake-services/wemake-python-styleguide/pull/3212?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wemake-services) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 100.00%. Comparing base [(`a7399d5`)](https://app.codecov.io/gh/wemake-services/wemake-python-styleguide/commit/a7399d577bf3fd08d6ebe3b03fb0a0fddbcca89b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wemake-services) to head [(`7c41755`)](https://app.codecov.io/gh/wemake-services/wemake-python-styleguide/commit/7c41755abaf8508d771c4152d2032fd0b42efb67?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wemake-services).

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff            @@
##            master     #3212   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          365       365           
  Lines        12295     12252   -43     
  Branches       858       851    -7     
=========================================
- Hits         12295     12252   -43     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/wemake-services/wemake-python-styleguide/pull/3212?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wemake-services).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=wemake-services).


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1bd2cbb4..91bdc341 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -132,6 +132,7 @@ Semantic versioning in our case means:
 - Fixes several bugs in `WPS322` with multiline strings detection
 - Fixes several violations not been detected in `case:` statements
 - Fixes `WPS434` not detecting reassignments in `:=` case
+- Fixes `WPS314` not detecting `match` statements
 
 ### Misc
 
diff --git a/wemake_python_styleguide/violations/consistency.py b/wemake_python_styleguide/violations/consistency.py
index 0a1b78ed..32eee4d6 100644
--- a/wemake_python_styleguide/violations/consistency.py
+++ b/wemake_python_styleguide/violations/consistency.py
@@ -661,7 +661,7 @@ class MissingSpaceBetweenKeywordAndParenViolation(TokenizeViolation):
 @final
 class ConstantConditionViolation(ASTViolation):
     """
-    Forbid using ``if`` statements that use invalid conditionals.
+    Forbid using ``if`` or ``match`` statements that use invalid conditionals.
 
     Reasoning:
         When invalid conditional arguments are used
@@ -675,9 +675,14 @@ class ConstantConditionViolation(ASTViolation):
 
         # Correct:
         if value is True: ...
+        match value:
+            case True:
+                ...
 
         # Wrong:
         if True: ...
+        match True:
+            case True: ...
 
     .. versionadded:: 0.3.0
 
diff --git a/wemake_python_styleguide/visitors/ast/compares.py b/wemake_python_styleguide/visitors/ast/compares.py
index a0a7c220..48113740 100644
--- a/wemake_python_styleguide/visitors/ast/compares.py
+++ b/wemake_python_styleguide/visitors/ast/compares.py
@@ -200,6 +200,11 @@ class WrongConditionalVisitor(BaseNodeVisitor):
             self._check_constant_condition(expr)
         self.generic_visit(node)
 
+    def visit_Match(self, node: ast.Match) -> None:
+        """Ensures that ``match`` nodes are using valid conditionals."""
+        self._check_constant_condition(node.subject)
+        self.generic_visit(node)
+
     def _check_constant_condition(self, node: ast.AST) -> None:
         if isinstance(node, ast.BoolOp):
             for condition in node.values:


Test patch:
diff --git a/tests/test_visitors/test_ast/test_compares/test_conditionals.py b/tests/test_visitors/test_ast/test_compares/test_conditionals.py
index 61a5f765..e828c929 100644
--- a/tests/test_visitors/test_ast/test_compares/test_conditionals.py
+++ b/tests/test_visitors/test_ast/test_compares/test_conditionals.py
@@ -43,6 +43,11 @@ def container():
     (x for x in [1, 2, 3] if {0})
 """
 
+match_statement = """
+match {0}:
+    case SomeClassName(FirstParentClass): ...
+"""
+
 
 @pytest.mark.parametrize(
     'code',
@@ -53,6 +58,7 @@ def container():
         set_comprehension,
         dict_comprehension,
         gen_comprehension,
+        match_statement,
     ],
 )
 @pytest.mark.parametrize(
@@ -96,6 +102,7 @@ def test_valid_conditional(
         set_comprehension,
         dict_comprehension,
         gen_comprehension,
+        match_statement,
     ],
 )
 @pytest.mark.parametrize(