Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue-1174: Remove flake8-coding #1215

Merged
merged 12 commits into from
Mar 2, 2020
Merged
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ Semantic versioning in our case means:
- Adds baseline information for all complexity violation messages: `x > baseline`
- Changes how cognitive complexity is calculated
- Adds support for positional arguments in different checks
- Forbids to use `continue` and `break` in `finally`. It is a terrible practice, because
`finally` is implicitly called and can cause damage to logic with its implicitness.
- Removes flake8-coding, all encoding strings, visitor and tests
for `EmptyLineAfterCodingViolation`

### Bugfixes

Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ flake8-quotes = "^2.0.1"
flake8-comprehensions = "^3.1.0"
flake8-docstrings = "^1.3.1"
flake8-string-format = "^0.2"
flake8-coding = "^1.3"
flake8-bugbear = "^19.3"
flake8-pep3101 = "^1.2"
flake8-debugger = "^3.1"
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ statistics = False
doctests = True

# Plugins:
accept-encodings = utf-8
max-complexity = 6
max-line-length = 80

Expand Down
1 change: 0 additions & 1 deletion styles/styleguide.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ format = "wemake"
show-source = true

# Plugins:
accept-encodings = "utf-8"
max-line-length = 80
max-complexity = 6

Expand Down
2 changes: 0 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import os
from collections import namedtuple

Expand Down
2 changes: 0 additions & 2 deletions tests/fixtures/formatter/correct.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

"""
Module level docstring.
Expand Down
1 change: 0 additions & 1 deletion tests/fixtures/noqa/noqa.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*- # noqa: WPS323
"""
This file contains all possible violations.
Expand Down
2 changes: 0 additions & 2 deletions tests/fixtures/noqa/noqa38.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

"""
This file represents AST location changes in python3.8 and above.
Expand Down
2 changes: 0 additions & 2 deletions tests/fixtures/noqa/noqa_controlled.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

"""
This file contains all violations which may be tweaked using
`i_control_code` or `i_dont_control_code` options.
Expand Down
2 changes: 0 additions & 2 deletions tests/fixtures/noqa/noqa_pre38.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

"""
This file represents how AST worked before python3.8 release.
Expand Down
2 changes: 0 additions & 2 deletions tests/plugins/ast_tree.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import ast
from textwrap import dedent

Expand Down
2 changes: 0 additions & 2 deletions tests/plugins/async_sync.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest


Expand Down
2 changes: 0 additions & 2 deletions tests/plugins/tokenize_parser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import io
import tokenize
from textwrap import dedent
Expand Down
2 changes: 0 additions & 2 deletions tests/plugins/violations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import inspect
from operator import attrgetter, itemgetter

Expand Down
2 changes: 0 additions & 2 deletions tests/test_checker/test_exception_handling.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import ast
from contextlib import suppress

Expand Down
2 changes: 0 additions & 2 deletions tests/test_checker/test_hypothesis.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

"""
Integration test that our linter does not break on different random programs.
Expand Down
2 changes: 0 additions & 2 deletions tests/test_checker/test_invalid_options.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import subprocess


Expand Down
2 changes: 0 additions & 2 deletions tests/test_checker/test_module_names.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import ast

import pytest
Expand Down
4 changes: 1 addition & 3 deletions tests/test_checker/test_noqa.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

"""
Integration tests definition.
Expand Down Expand Up @@ -130,7 +128,7 @@
'WPS320': 2,
'WPS321': 1,
'WPS322': 1,
'WPS323': 1,
'WPS323': 0, # violation is deprecated
'WPS324': 1,
'WPS325': 1,
'WPS326': 1,
Expand Down
2 changes: 0 additions & 2 deletions tests/test_checker/test_presets.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import importlib
import inspect
from importlib.machinery import SourceFileLoader
Expand Down
1 change: 0 additions & 1 deletion tests/test_formatter/snapshots/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# -*- coding: utf-8 -*-
2 changes: 0 additions & 2 deletions tests/test_formatter/test_formatter_output.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

"""
We use direct string assertiong on the formatter.
Expand Down
2 changes: 0 additions & 2 deletions tests/test_logic/test_complexity/test_cognitive/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

"""
Fixtures to make testing cognitive complexity easy.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

"""
Test to ensure that we count cognitive complexity correctly.
Expand Down
2 changes: 0 additions & 2 deletions tests/test_options/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest
from flake8.options.manager import OptionManager

Expand Down
2 changes: 0 additions & 2 deletions tests/test_options/test_option_rules.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from wemake_python_styleguide.options import config


Expand Down
2 changes: 0 additions & 2 deletions tests/test_options/test_option_values/test_i_control_code.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

"""
This is a regression test for the argument parsing issue for boolean args.
Expand Down
2 changes: 0 additions & 2 deletions tests/test_options/test_validate_domain_names_options.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.options.validation import (
Expand Down
3 changes: 0 additions & 3 deletions tests/test_plugins.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

"""
These test ensures that each plugin is enabled and working.
Expand All @@ -14,7 +12,6 @@

PLUGINS = (
'B002', # flake8-bugbear
'C101', # flake8-coding
'A001', # flake8-builtins
'C400', # flake8-comprehensions
'C819', # flake8-commas
Expand Down
2 changes: 0 additions & 2 deletions tests/test_regressions/test_regression112.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import ast

from pyflakes.checker import Checker as PyFlakesChecker
Expand Down
2 changes: 0 additions & 2 deletions tests/test_version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import subprocess

from wemake_python_styleguide.version import pkg_name, pkg_version
Expand Down
2 changes: 0 additions & 2 deletions tests/test_violations/test_codes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-


def test_all_unique_violation_codes(all_violations):
"""Ensures that all violations have unique violation codes."""
Expand Down
2 changes: 0 additions & 2 deletions tests/test_violations/test_definition_order.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import inspect
import re

Expand Down
2 changes: 0 additions & 2 deletions tests/test_violations/test_docs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from wemake_python_styleguide.options.config import Configuration


Expand Down
2 changes: 0 additions & 2 deletions tests/test_violations/test_implementation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import ast

from wemake_python_styleguide.violations.base import ASTViolation
Expand Down
2 changes: 0 additions & 2 deletions tests/test_visitors/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from typing import Optional, Sequence

import pytest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.visitors.ast.annotations import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.visitors.ast.annotations import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.oop import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.visitors.ast.attributes import (
Expand Down
2 changes: 0 additions & 2 deletions tests/test_visitors/test_ast/test_blocks/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

# Assigns:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.best_practices import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.best_practices import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.best_practices import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.best_practices import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.best_practices import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.best_practices import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.best_practices import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.best_practices import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.best_practices import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.best_practices import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.best_practices import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.best_practices import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.best_practices import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.best_practices import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.best_practices import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.best_practices import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.constants import MAGIC_NUMBERS_WHITELIST
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import string

import pytest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.consistency import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

import pytest

from wemake_python_styleguide.violations.oop import BuiltinSubclassViolation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-

from wemake_python_styleguide.violations.best_practices import (
BaseExceptionSubclassViolation,
)
Expand Down
Loading