summaryrefslogtreecommitdiffstats
path: root/pre_commit/commands
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2020-11-03 06:17:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2020-11-03 06:17:33 +0000
commit22b6d3abcec9046e294d08c741aa7b6338984e84 (patch)
treea0a9c823a7d82771ffb8a8b39f7143d5ba2f6b30 /pre_commit/commands
parentAdding upstream version 2.7.1. (diff)
downloadpre-commit-22b6d3abcec9046e294d08c741aa7b6338984e84.tar.xz
pre-commit-22b6d3abcec9046e294d08c741aa7b6338984e84.zip
Adding upstream version 2.8.2.upstream/2.8.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/commands')
-rw-r--r--pre_commit/commands/install_uninstall.py2
-rw-r--r--pre_commit/commands/run.py8
-rw-r--r--pre_commit/commands/sample_config.py2
3 files changed, 6 insertions, 6 deletions
diff --git a/pre_commit/commands/install_uninstall.py b/pre_commit/commands/install_uninstall.py
index 85fa53c..684b598 100644
--- a/pre_commit/commands/install_uninstall.py
+++ b/pre_commit/commands/install_uninstall.py
@@ -55,7 +55,7 @@ def is_our_script(filename: str) -> bool:
def shebang() -> str:
if sys.platform == 'win32':
- py = SYS_EXE
+ py, _ = os.path.splitext(SYS_EXE)
else:
exe_choices = [
f'python{sys.version_info[0]}.{sys.version_info[1]}',
diff --git a/pre_commit/commands/run.py b/pre_commit/commands/run.py
index 1f28c8c..0d335e2 100644
--- a/pre_commit/commands/run.py
+++ b/pre_commit/commands/run.py
@@ -11,6 +11,7 @@ from typing import Any
from typing import Collection
from typing import Dict
from typing import List
+from typing import MutableMapping
from typing import Sequence
from typing import Set
from typing import Tuple
@@ -28,7 +29,6 @@ from pre_commit.repository import install_hook_envs
from pre_commit.staged_files_only import staged_files_only
from pre_commit.store import Store
from pre_commit.util import cmd_output_b
-from pre_commit.util import EnvironT
logger = logging.getLogger('pre_commit')
@@ -116,7 +116,7 @@ class Classifier:
return Classifier(filenames)
-def _get_skips(environ: EnvironT) -> Set[str]:
+def _get_skips(environ: MutableMapping[str, str]) -> Set[str]:
skips = environ.get('SKIP', '')
return {skip.strip() for skip in skips.split(',') if skip.strip()}
@@ -258,7 +258,7 @@ def _run_hooks(
config: Dict[str, Any],
hooks: Sequence[Hook],
args: argparse.Namespace,
- environ: EnvironT,
+ environ: MutableMapping[str, str],
) -> int:
"""Actually run the hooks."""
skips = _get_skips(environ)
@@ -315,7 +315,7 @@ def run(
config_file: str,
store: Store,
args: argparse.Namespace,
- environ: EnvironT = os.environ,
+ environ: MutableMapping[str, str] = os.environ,
) -> int:
stash = not args.all_files and not args.files
diff --git a/pre_commit/commands/sample_config.py b/pre_commit/commands/sample_config.py
index d435faa..64617c3 100644
--- a/pre_commit/commands/sample_config.py
+++ b/pre_commit/commands/sample_config.py
@@ -7,7 +7,7 @@ SAMPLE_CONFIG = '''\
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v2.4.0
+ rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer