summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--patternutils/commands/patterncfg.py2
-rw-r--r--patternutils/commands/pmatch.py4
-rw-r--r--patternutils/commands/targs.py15
-rw-r--r--patternutils/template.py1
-rw-r--r--patternutils/utils.py4
5 files changed, 7 insertions, 19 deletions
diff --git a/patternutils/commands/patterncfg.py b/patternutils/commands/patterncfg.py
index 83168cf..fa30e01 100644
--- a/patternutils/commands/patterncfg.py
+++ b/patternutils/commands/patterncfg.py
@@ -9,7 +9,7 @@ from .. import config
try:
from pygments import highlight
from pygments.formatters import TerminalFormatter
- from pygments.lexers import Python3Lexer, DjangoLexer
+ from pygments.lexers import DjangoLexer, Python3Lexer
except ImportError:
has_pygments = False
else:
diff --git a/patternutils/commands/pmatch.py b/patternutils/commands/pmatch.py
index 6bbd349..521aa9d 100644
--- a/patternutils/commands/pmatch.py
+++ b/patternutils/commands/pmatch.py
@@ -27,9 +27,7 @@ def walk(
def apply_regex(
- walk_function: Iterator[Any],
- regex_pattern: Pattern[str],
- match_full_path: bool,
+ walk_function: Iterator[Any], regex_pattern: Pattern[str], match_full_path: bool,
) -> Tuple[List[Dict[str, str]], bool]:
matches = []
diff --git a/patternutils/commands/targs.py b/patternutils/commands/targs.py
index 04c286d..9fd0831 100644
--- a/patternutils/commands/targs.py
+++ b/patternutils/commands/targs.py
@@ -11,11 +11,7 @@ import click
from .. import config, template, utils
-def run_command(
- data: Dict[str, str],
- run: Callable[..., None],
- shell: bool,
-) -> None:
+def run_command(data: Dict[str, str], run: Callable[..., None], shell: bool,) -> None:
if not shell:
prepared_command = shlex.split(c) # type: Union[str, List[str]]
else:
@@ -124,15 +120,10 @@ def targs(
stdout = subprocess.DEVNULL if redirect_stdout else None
stderr = subprocess.DEVNULL if redirect_stderr else None
patched_subprocess = functools.partial(
- subprocess.run,
- shell=shell,
- stdout=stdout,
- stderr=stderr,
+ subprocess.run, shell=shell, stdout=stdout, stderr=stderr,
)
patched_run_command = functools.partial(
- run_command,
- run=patched_subprocess,
- shell=shell,
+ run_command, run=patched_subprocess, shell=shell,
)
if max_procs == 1:
for r in commands:
diff --git a/patternutils/template.py b/patternutils/template.py
index 53746a2..56bb0be 100644
--- a/patternutils/template.py
+++ b/patternutils/template.py
@@ -6,7 +6,6 @@ except ImportError:
jinja_feature = False
else:
import shlex
-
from datetime import datetime
jinja_feature = True
diff --git a/patternutils/utils.py b/patternutils/utils.py
index 266f3b9..a2decea 100644
--- a/patternutils/utils.py
+++ b/patternutils/utils.py
@@ -1,6 +1,6 @@
-import os
import json
-from typing import Dict, Any
+import os
+from typing import Any, Dict
import click