Skip to content

Commit e4e67bb

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 6119795 commit e4e67bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+68
-7
lines changed

example-plugin/src/flake8_example_plugin/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module for an example Flake8 plugin."""
2+
23
from __future__ import annotations
34

45
from .off_by_default import ExampleTwo

example-plugin/src/flake8_example_plugin/off_by_default.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Our first example plugin."""
2+
23
from __future__ import annotations
34

45

example-plugin/src/flake8_example_plugin/on_by_default.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Our first example plugin."""
2+
23
from __future__ import annotations
34

45

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ classifiers =
1616
Environment :: Console
1717
Framework :: Flake8
1818
Intended Audience :: Developers
19-
License :: OSI Approved :: MIT License
2019
Programming Language :: Python
2120
Programming Language :: Python :: 3
2221
Programming Language :: Python :: 3 :: Only

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Packaging logic for Flake8."""
2+
23
from __future__ import annotations
34

45
import os

src/flake8/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
.. autofunction:: flake8.configure_logging
1010
1111
"""
12+
1213
from __future__ import annotations
1314

1415
import logging

src/flake8/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module allowing for ``python -m flake8 ...``."""
2+
23
from __future__ import annotations
34

45
from flake8.main.cli import main

src/flake8/api/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
This is the only submodule in Flake8 with a guaranteed stable API. All other
44
submodules are considered internal only and are subject to change.
55
"""
6+
67
from __future__ import annotations

src/flake8/api/legacy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Previously, users would import :func:`get_style_guide` from ``flake8.engine``.
44
In 3.0 we no longer have an "engine" module but we maintain the API from it.
55
"""
6+
67
from __future__ import annotations
78

89
import argparse

src/flake8/checker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Checker Manager and Checker classes."""
2+
23
from __future__ import annotations
34

45
import argparse

src/flake8/defaults.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Constants that define defaults."""
2+
23
from __future__ import annotations
34

45
import re

src/flake8/discover_files.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Functions related to discovering paths."""
2+
23
from __future__ import annotations
34

45
import logging

src/flake8/exceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Exception classes for all of Flake8."""
2+
23
from __future__ import annotations
34

45

src/flake8/formatting/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
"""Submodule containing the default formatters for Flake8."""
2+
23
from __future__ import annotations

src/flake8/formatting/_windows_color.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
See: https://github.com/pre-commit/pre-commit/blob/cb40e96/pre_commit/color.py
44
"""
5+
56
from __future__ import annotations
67

78
import sys

src/flake8/formatting/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""The base class and interface for all formatting plugins."""
2+
23
from __future__ import annotations
34

45
import argparse

src/flake8/formatting/default.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Default formatting class for Flake8."""
2+
23
from __future__ import annotations
34

45
from flake8.formatting import base

src/flake8/main/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
"""Module containing the logic for the Flake8 entry-points."""
2+
23
from __future__ import annotations

src/flake8/main/application.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module containing the application logic for Flake8."""
2+
23
from __future__ import annotations
34

45
import argparse

src/flake8/main/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Command-line implementation of flake8."""
2+
23
from __future__ import annotations
34

45
import sys

src/flake8/main/debug.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module containing the logic for our debugging logic."""
2+
23
from __future__ import annotations
34

45
import platform

src/flake8/main/options.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Contains the logic for all of the default options for Flake8."""
2+
23
from __future__ import annotations
34

45
import argparse

src/flake8/options/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
to aggregate configuration into one object used by plugins and Flake8.
1111
1212
"""
13+
1314
from __future__ import annotations

src/flake8/options/aggregator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This holds the logic that uses the collected and merged config files and
44
applies the user-specified command-line configuration on top of it.
55
"""
6+
67
from __future__ import annotations
78

89
import argparse

src/flake8/options/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Config handling logic for Flake8."""
2+
23
from __future__ import annotations
34

45
import configparser

src/flake8/options/manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Option handling and Option management logic."""
2+
23
from __future__ import annotations
34

45
import argparse

src/flake8/options/parse_args.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Procedure for parsing args, config, loading plugins."""
2+
23
from __future__ import annotations
34

45
import argparse

src/flake8/plugins/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
"""Submodule of built-in plugins and plugin managers."""
2+
23
from __future__ import annotations

src/flake8/plugins/finder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Functions related to finding and loading plugins."""
2+
23
from __future__ import annotations
34

45
import configparser

src/flake8/plugins/pycodestyle.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Generated using ./bin/gen-pycodestyle-plugin."""
2+
23
# fmt: off
34
from __future__ import annotations
45

src/flake8/plugins/pyflakes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Plugin built-in to Flake8 to treat pyflakes as a plugin."""
2+
23
from __future__ import annotations
34

45
import argparse

src/flake8/plugins/reporter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Functions for constructing the requested report plugin."""
2+
23
from __future__ import annotations
34

45
import argparse

src/flake8/processor.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module containing our file processor that tokenizes a file for checks."""
2+
23
from __future__ import annotations
34

45
import argparse
@@ -380,9 +381,9 @@ def strip_utf_bom(self) -> None:
380381
return
381382

382383
# If the first byte of the file is a UTF-8 BOM, strip it
383-
if self.lines[0][:1] == "\uFEFF":
384+
if self.lines[0][:1] == "\ufeff":
384385
self.lines[0] = self.lines[0][1:]
385-
elif self.lines[0][:3] == "\xEF\xBB\xBF":
386+
elif self.lines[0][:3] == "\xef\xbb\xbf":
386387
self.lines[0] = self.lines[0][3:]
387388

388389

src/flake8/statistics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Statistic collection logic for Flake8."""
2+
23
from __future__ import annotations
34

45
from collections.abc import Generator

src/flake8/style_guide.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Implementation of the StyleGuide used by Flake8."""
2+
23
from __future__ import annotations
34

45
import argparse

src/flake8/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Utility methods for flake8."""
2+
23
from __future__ import annotations
34

45
import fnmatch as _fnmatch

src/flake8/violation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Contains the Violation error class used internally."""
2+
23
from __future__ import annotations
34

45
import functools

tests/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
"""This is here because mypy doesn't understand PEP 420."""
2+
23
from __future__ import annotations

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test configuration for py.test."""
2+
23
from __future__ import annotations
34

45
import sys

tests/integration/subdir/aplugin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module that is off sys.path by default, for testing local-plugin-paths."""
2+
23
from __future__ import annotations
34

45

tests/integration/test_aggregator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test aggregation of config files and command-line options."""
2+
23
from __future__ import annotations
34

45
import os

tests/integration/test_api_legacy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Integration tests for the legacy api."""
2+
23
from __future__ import annotations
34

45
from flake8.api import legacy

tests/integration/test_checker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Integration tests for the checker submodule."""
2+
23
from __future__ import annotations
34

45
import importlib.metadata

tests/integration/test_main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Integration tests for the main entrypoint of flake8."""
2+
23
from __future__ import annotations
34

45
import json

tests/integration/test_plugins.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Integration tests for plugin loading."""
2+
23
from __future__ import annotations
34

45
import sys

tests/unit/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Shared fixtures between unit tests."""
2+
23
from __future__ import annotations
34

45
import argparse

tests/unit/test_application.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for the Application class."""
2+
23
from __future__ import annotations
34

45
import argparse

tests/unit/test_base_formatter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for the BaseFormatter object."""
2+
23
from __future__ import annotations
34

45
import argparse

tests/unit/test_checker_manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for the Manager object for FileCheckers."""
2+
23
from __future__ import annotations
34

45
import errno

tests/unit/test_decision_engine.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for the flake8.style_guide.DecisionEngine class."""
2+
23
from __future__ import annotations
34

45
import argparse

tests/unit/test_exceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for the flake8.exceptions module."""
2+
23
from __future__ import annotations
34

45
import pickle

tests/unit/test_file_checker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Unit tests for the FileChecker class."""
2+
23
from __future__ import annotations
34

45
import argparse

tests/unit/test_file_processor.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for the FileProcessor class."""
2+
23
from __future__ import annotations
34

45
import ast
@@ -52,8 +53,8 @@ def test_read_lines_unknown_encoding(tmpdir, default_options):
5253
@pytest.mark.parametrize(
5354
"first_line",
5455
[
55-
'\xEF\xBB\xBF"""Module docstring."""\n',
56-
'\uFEFF"""Module docstring."""\n',
56+
'\xef\xbb\xbf"""Module docstring."""\n',
57+
'\ufeff"""Module docstring."""\n',
5758
],
5859
)
5960
def test_strip_utf_bom(first_line, default_options):
@@ -67,8 +68,8 @@ def test_strip_utf_bom(first_line, default_options):
6768
@pytest.mark.parametrize(
6869
"lines, expected",
6970
[
70-
(['\xEF\xBB\xBF"""Module docstring."""\n'], False),
71-
(['\uFEFF"""Module docstring."""\n'], False),
71+
(['\xef\xbb\xbf"""Module docstring."""\n'], False),
72+
(['\ufeff"""Module docstring."""\n'], False),
7273
(["#!/usr/bin/python", "# flake8 is great", "a = 1"], False),
7374
(["#!/usr/bin/python", "# flake8: noqa", "a = 1"], True),
7475
(["#!/usr/bin/python", "# flake8:noqa", "a = 1"], True),

tests/unit/test_filenameonly_formatter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for the FilenameOnly formatter object."""
2+
23
from __future__ import annotations
34

45
import argparse

tests/unit/test_legacy_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for Flake8's legacy API."""
2+
23
from __future__ import annotations
34

45
from unittest import mock

tests/unit/test_nothing_formatter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for the Nothing formatter obbject."""
2+
23
from __future__ import annotations
34

45
import argparse

tests/unit/test_option.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Unit tests for flake8.options.manager.Option."""
2+
23
from __future__ import annotations
34

45
import functools

tests/unit/test_option_manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Unit tests for flake.options.manager.OptionManager."""
2+
23
from __future__ import annotations
34

45
import argparse

tests/unit/test_pyflakes_codes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests of pyflakes monkey patches."""
2+
23
from __future__ import annotations
34

45
import ast

tests/unit/test_statistics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for the statistics module in Flake8."""
2+
23
from __future__ import annotations
34

45
import pytest

0 commit comments

Comments
 (0)