Created
September 20, 2020 17:42
-
-
Save MartinThoma/cc5865fe57a3a403774fc68f9f676444 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Core Library | |
import ast | |
from typing import Set | |
# First party | |
from flake8_simplify import Plugin | |
def _results(code: str) -> Set[str]: | |
"""Apply the plugin to the given code.""" | |
tree = ast.parse(code) | |
plugin = Plugin(tree) | |
return {f"{line}:{col} {msg}" for line, col, msg, _ in plugin.run()} | |
def test_trivial_case(): | |
"""Check the plugins output for no code.""" | |
assert _results("") == set() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment