Skip to content

Commit eb2de73

Browse files
authored
Merge pull request #209 from jakkdl/rename_files
rename files, update references to them
2 parents 7748d40 + 6281cb3 commit eb2de73

Some content is hidden

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

82 files changed

+66
-78
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repos:
2323
hooks:
2424
- id: pyupgrade
2525
args: [--py39-plus]
26-
exclude: tests/eval_files/trio103.py
26+
exclude: tests/eval_files/async103.py
2727

2828
- repo: https://github.com/pycqa/isort
2929
rev: 5.13.2

.pre-commit-hooks.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
- id: flake8-trio
3-
name: flake8-trio
4-
entry: flake8-trio
2+
- id: flake8-async
3+
name: flake8-async
4+
entry: flake8-async
55
language: python
66
types: [python]

CONTRIBUTING.md

+3-3

flake8_trio/__init__.py flake8_async/__init__.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import libcst as cst
2525

2626
from .base import Options, error_has_subidentifier
27-
from .runner import Flake8TrioRunner, Flake8TrioRunner_cst
27+
from .runner import Flake8AsyncRunner, Flake8AsyncRunner_cst
2828
from .visitors import ERROR_CLASSES, ERROR_CLASSES_CST, default_disabled_error_codes
2929

3030
if TYPE_CHECKING:
@@ -75,7 +75,7 @@ def cst_parse_module_native(source: str) -> cst.Module:
7575

7676

7777
def main() -> int:
78-
parser = ArgumentParser(prog="flake8-trio")
78+
parser = ArgumentParser(prog="flake8-async")
7979
Plugin.add_options(parser)
8080
args = parser.parse_args()
8181
Plugin.parse_options(args)
@@ -156,11 +156,11 @@ def run(self) -> Iterable[Error]:
156156
if not self.standalone:
157157
self.options.disable_noqa = True
158158

159-
cst_runner = Flake8TrioRunner_cst(self.options, self.module)
159+
cst_runner = Flake8AsyncRunner_cst(self.options, self.module)
160160
# any noqa'd errors are suppressed upon being generated
161161
yield from cst_runner.run()
162162

163-
problems_ast = Flake8TrioRunner.run(self._tree, self.options)
163+
problems_ast = Flake8AsyncRunner.run(self._tree, self.options)
164164
if self.options.disable_noqa:
165165
yield from problems_ast
166166
return
File renamed without changes.
File renamed without changes.

flake8_trio/runner.py flake8_async/runner.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Contains Flake8TrioRunner.
1+
"""Contains Flake8AsyncRunner.
22
33
The runner is what's run by the Plugin, and handles traversing
44
the AST and letting all registered ERROR_CLASSES do their visit'ing on them.
@@ -26,7 +26,7 @@
2626
from libcst import Module
2727

2828
from .base import Error, Options
29-
from .visitors.flake8triovisitor import Flake8AsyncVisitor, Flake8AsyncVisitor_cst
29+
from .visitors.flake8asyncvisitor import Flake8AsyncVisitor, Flake8AsyncVisitor_cst
3030

3131

3232
@dataclass
@@ -53,7 +53,7 @@ def selected(self, error_codes: Mapping[str, str]) -> bool:
5353
return bool(set(error_codes) & enabled_or_autofix)
5454

5555

56-
class Flake8TrioRunner(ast.NodeVisitor, __CommonRunner):
56+
class Flake8AsyncRunner(ast.NodeVisitor, __CommonRunner):
5757
def __init__(self, options: Options):
5858
super().__init__(options)
5959
# utility visitors that need to run before the error-checking visitors
@@ -110,7 +110,7 @@ def visit(self, node: ast.AST):
110110
subclass.set_state(subclass.outer.pop(node, {}))
111111

112112

113-
class Flake8TrioRunner_cst(__CommonRunner):
113+
class Flake8AsyncRunner_cst(__CommonRunner):
114114
def __init__(self, options: Options, module: Module):
115115
super().__init__(options)
116116
self.options = options

flake8_trio/visitors/__init__.py flake8_async/visitors/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from typing import TYPE_CHECKING
1111

1212
if TYPE_CHECKING:
13-
from .flake8triovisitor import Flake8AsyncVisitor, Flake8AsyncVisitor_cst
13+
from .flake8asyncvisitor import Flake8AsyncVisitor, Flake8AsyncVisitor_cst
1414

1515
__all__ = [
1616
"ERROR_CLASSES",

flake8_trio/visitors/helpers.py flake8_async/visitors/helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
if TYPE_CHECKING:
2626
from collections.abc import Iterable, Iterator, Sequence
2727

28-
from .flake8triovisitor import (
28+
from .flake8asyncvisitor import (
2929
Flake8AsyncVisitor,
3030
Flake8AsyncVisitor_cst,
3131
HasLineCol,

flake8_trio/visitors/visitor100.py flake8_async/visitors/visitor100.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import libcst as cst
1414
import libcst.matchers as m
1515

16-
from .flake8triovisitor import Flake8AsyncVisitor_cst
16+
from .flake8asyncvisitor import Flake8AsyncVisitor_cst
1717
from .helpers import (
1818
AttributeCall,
1919
error_class_cst,

flake8_trio/visitors/visitor101.py flake8_async/visitors/visitor101.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from typing import TYPE_CHECKING, Any
1010

11-
from .flake8triovisitor import Flake8AsyncVisitor_cst
11+
from .flake8asyncvisitor import Flake8AsyncVisitor_cst
1212
from .helpers import (
1313
cancel_scope_names,
1414
error_class_cst,

flake8_trio/visitors/visitor102.py flake8_async/visitors/visitor102.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from typing import TYPE_CHECKING, Any
1010

1111
from ..base import Statement
12-
from .flake8triovisitor import Flake8AsyncVisitor
12+
from .flake8asyncvisitor import Flake8AsyncVisitor
1313
from .helpers import cancel_scope_names, critical_except, error_class, get_matching_call
1414

1515
if TYPE_CHECKING:

flake8_trio/visitors/visitor103_104.py flake8_async/visitors/visitor103_104.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import ast
1212
from typing import TYPE_CHECKING, Any
1313

14-
from .flake8triovisitor import Flake8AsyncVisitor
14+
from .flake8asyncvisitor import Flake8AsyncVisitor
1515
from .helpers import critical_except, error_class, iter_guaranteed_once
1616

1717
if TYPE_CHECKING:

flake8_trio/visitors/visitor105.py flake8_async/visitors/visitor105.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import ast
66
from typing import TYPE_CHECKING, Any
77

8-
from .flake8triovisitor import Flake8AsyncVisitor
8+
from .flake8asyncvisitor import Flake8AsyncVisitor
99
from .helpers import error_class
1010

1111
if TYPE_CHECKING:

flake8_trio/visitors/visitor111.py flake8_async/visitors/visitor111.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import ast
66
from typing import TYPE_CHECKING, Any, NamedTuple
77

8-
from .flake8triovisitor import Flake8AsyncVisitor
8+
from .flake8asyncvisitor import Flake8AsyncVisitor
99
from .helpers import error_class, get_matching_call
1010

1111
if TYPE_CHECKING:

flake8_trio/visitors/visitor118.py flake8_async/visitors/visitor118.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import re
1111
from typing import TYPE_CHECKING
1212

13-
from .flake8triovisitor import Flake8AsyncVisitor
13+
from .flake8asyncvisitor import Flake8AsyncVisitor
1414
from .helpers import error_class
1515

1616
if TYPE_CHECKING:

flake8_trio/visitors/visitor2xx.py flake8_async/visitors/visitor2xx.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import re
1515
from typing import TYPE_CHECKING, Any
1616

17-
from .flake8triovisitor import Flake8AsyncVisitor
17+
from .flake8asyncvisitor import Flake8AsyncVisitor
1818
from .helpers import error_class, fnmatch_qualified_name, get_matching_call
1919

2020
if TYPE_CHECKING:

flake8_trio/visitors/visitor91x.py flake8_async/visitors/visitor91x.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from libcst.metadata import PositionProvider
1717

1818
from ..base import Statement
19-
from .flake8triovisitor import Flake8AsyncVisitor_cst
19+
from .flake8asyncvisitor import Flake8AsyncVisitor_cst
2020
from .helpers import (
2121
disabled_by_default,
2222
error_class_cst,

flake8_trio/visitors/visitor_utility.py flake8_async/visitors/visitor_utility.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import libcst.matchers as m
1111
from libcst.metadata import PositionProvider
1212

13-
from .flake8triovisitor import Flake8AsyncVisitor, Flake8AsyncVisitor_cst
13+
from .flake8asyncvisitor import Flake8AsyncVisitor, Flake8AsyncVisitor_cst
1414
from .helpers import utility_visitor, utility_visitor_cst
1515

1616
if TYPE_CHECKING:

flake8_trio/visitors/visitors.py flake8_async/visitors/visitors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import ast
66
from typing import TYPE_CHECKING, Any, cast
77

8-
from .flake8triovisitor import Flake8AsyncVisitor
8+
from .flake8asyncvisitor import Flake8AsyncVisitor
99
from .helpers import disabled_by_default, error_class, get_matching_call, has_decorator
1010

1111
if TYPE_CHECKING:

pyproject.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ reportUninitializedInstanceVariable = true
3838
# can't enable until https://github.com/python/mypy/issues/12358
3939
reportUnnecessaryTypeIgnoreComment = false
4040
reportUnusedCallResult = false
41-
strict = ["*.py", "tests/*.py", "flake8_trio/**/*.py"]
41+
strict = ["*.py", "tests/*.py", "flake8_async/**/*.py"]
4242

4343
[tool.ruff]
4444
extend-exclude = [
@@ -104,10 +104,10 @@ select = ["ALL"]
104104
# docstrings, and arguments we can't modify
105105
"*.pyi" = ["D", 'FBT001', 'PLR0913', "PIE790", "PYI048"]
106106
# imports
107-
"flake8_trio/visitors/__init__.py" = [
107+
"flake8_async/visitors/__init__.py" = [
108108
"F401",
109109
"E402"
110110
]
111111
# visitor_utility contains comments specifying how it parses noqa comments, which get
112112
# parsed as noqa comments
113-
"flake8_trio/visitors/visitor_utility.py" = ["RUF100", "PGH004"]
113+
"flake8_async/visitors/visitor_utility.py" = ["RUF100", "PGH004"]

setup.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def local_file(name: str) -> Path:
1010
return Path(__file__).parent / name
1111

1212

13-
with open(Path(__file__).parent / "flake8_trio" / "__init__.py") as o:
13+
with open(Path(__file__).parent / "flake8_async" / "__init__.py") as o:
1414
for line in o:
1515
if line.startswith("__version__"):
1616
_, __version__, _ = line.split('"')
@@ -24,7 +24,7 @@ def local_file(name: str) -> Path:
2424
version=__version__,
2525
author="Zac Hatfield-Dodds, John Litborn, and Contributors",
2626
author_email="[email protected]",
27-
packages=find_packages(include=["flake8_trio", "flake8_trio.*"]),
27+
packages=find_packages(include=["flake8_async", "flake8_async.*"]),
2828
url="https://github.com/python-trio/flake8-trio",
2929
license="MIT",
3030
description="A highly opinionated flake8 plugin for Trio-related problems.",
@@ -54,7 +54,7 @@ def local_file(name: str) -> Path:
5454
# You're not allowed to register error codes longer than 3 characters. But flake8
5555
# doesn't enforce anything about the characters trailing the code, so we can say
5656
# the code is ASY and then just always happen to print NCxxx directly after it.
57-
"flake8.extension": ["ASY = flake8_trio:Plugin"],
58-
"console_scripts": ["flake8-async=flake8_trio:main"],
57+
"flake8.extension": ["ASY = flake8_async:Plugin"],
58+
"console_scripts": ["flake8-async=flake8_async:main"],
5959
},
6060
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/test_all_visitors_imported.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Check that all visitors are imported.
22
3-
Checks that all flake8_trio/visitor*.py files are imported in flake8_trio/visitor/__init__
4-
so their decorators are run.
3+
Checks that all flake8_async/visitor*.py files are imported in
4+
flake8_async/visitor/__init__.py so their decorators are run.
55
"""
66

77
from __future__ import annotations
@@ -11,7 +11,7 @@
1111

1212

1313
def test_all_visitors_imported():
14-
visitor_dir = Path(__file__).parent.parent / "flake8_trio" / "visitors"
14+
visitor_dir = Path(__file__).parent.parent / "flake8_async" / "visitors"
1515
visitor_files = {
1616
f.stem for f in visitor_dir.iterdir() if f.stem.startswith("visitor")
1717
}

tests/test_changelog_and_version.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
ROOT_PATH = Path(__file__).parent.parent
1515
CHANGELOG = ROOT_PATH / "CHANGELOG.md"
1616
README = ROOT_PATH / "README.md"
17-
INIT_FILE = ROOT_PATH / "flake8_trio" / "__init__.py"
17+
INIT_FILE = ROOT_PATH / "flake8_async" / "__init__.py"
1818

1919
T = TypeVar("T", bound="Version")
2020

@@ -86,7 +86,7 @@ def update_version() -> None:
8686
# If we've added a new version to the changelog, update __version__ to match
8787
last_version = next(iter(get_releases()))
8888
if last_version != VERSION:
89-
INIT_FILE = ROOT_PATH / "flake8_trio" / "__init__.py"
89+
INIT_FILE = ROOT_PATH / "flake8_async" / "__init__.py"
9090
subs = (f'__version__ = "{VERSION}"', f'__version__ = "{last_version}"')
9191
INIT_FILE.write_text(INIT_FILE.read_text().replace(*subs))
9292

tests/test_config_and_args.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
import pytest
1111

12-
from flake8_trio import Plugin, main
12+
from flake8_async import Plugin, main
1313

14-
from .test_flake8_trio import initialize_options
14+
from .test_flake8_async import initialize_options
1515

1616
EXAMPLE_PY_TEXT = """import trio
1717
with trio.move_on_after(10):
@@ -47,7 +47,7 @@ def monkeypatch_argv(
4747
monkeypatch.setattr(sys, "argv", argv)
4848

4949

50-
def test_run_flake8_trio(tmp_path: Path):
50+
def test_run_flake8_async(tmp_path: Path):
5151
write_examplepy(tmp_path)
5252
res = subprocess.run(
5353
[
@@ -71,7 +71,7 @@ def test_systemexit_0(
7171
tmp_path.joinpath("example.py").write_text("")
7272

7373
with pytest.raises(SystemExit) as exc_info:
74-
from flake8_trio import __main__ # noqa: F401
74+
from flake8_async import __main__ # noqa: F401
7575

7676
assert exc_info.value.code == 0
7777
out, err = capsys.readouterr()
@@ -86,7 +86,7 @@ def test_systemexit_1(
8686
monkeypatch_argv(monkeypatch, tmp_path)
8787

8888
with pytest.raises(SystemExit) as exc_info:
89-
from flake8_trio import __main__ # noqa: F401
89+
from flake8_async import __main__ # noqa: F401
9090

9191
assert exc_info.value.code == 1
9292
out, err = capsys.readouterr()
@@ -168,7 +168,7 @@ def test_anyio_from_config(tmp_path: Path, capsys: pytest.CaptureFixture[str]):
168168
"""
169169
)
170170

171-
from flake8_trio.visitors.visitor2xx import Visitor22X
171+
from flake8_async.visitors.visitor2xx import Visitor22X
172172

173173
err_msg = Visitor22X.error_codes["ASYNC220"].format(
174174
"subprocess.Popen",

tests/test_decorator.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
from flake8.main.application import Application
1010

11-
from flake8_trio.base import Statement
12-
from flake8_trio.visitors.helpers import fnmatch_qualified_name
13-
from flake8_trio.visitors.visitor91x import Visitor91X
11+
from flake8_async.base import Statement
12+
from flake8_async.visitors.helpers import fnmatch_qualified_name
13+
from flake8_async.visitors.visitor91x import Visitor91X
1414

1515
if TYPE_CHECKING:
1616
import pytest

tests/test_exception_on_invalid_code.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import libcst as cst
66
import pytest
77

8-
from flake8_trio.visitors.helpers import iter_guaranteed_once, iter_guaranteed_once_cst
8+
from flake8_async.visitors.helpers import iter_guaranteed_once, iter_guaranteed_once_cst
99

1010

1111
def _raises_on_code_cst(source: str):

0 commit comments

Comments
 (0)