Add duration to verbose run

This commit is contained in:
Anthony Sottile
2019-12-28 17:58:04 -08:00
parent 1074b39988
commit 0c0427bfbd
7 changed files with 74 additions and 55 deletions

View File

@@ -1,6 +1,5 @@
- id: python3-hook
name: Python 3 Hook
entry: python3-hook
language: python
language_version: python3
- id: hook
name: hook
entry: ./hook.sh
language: script
files: \.py$

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Intentionally write mixed encoding to the output. This should not crash
# pre-commit and should write bytes to the output.
# '☃'.encode('UTF-8') + '²'.encode('latin1')
echo -e '\xe2\x98\x83\xb2'
# exit 1 to trigger printing
exit 1

View File

@@ -1,13 +0,0 @@
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
import sys
def main():
# Intentionally write mixed encoding to the output. This should not crash
# pre-commit and should write bytes to the output.
sys.stdout.buffer.write(''.encode('UTF-8') + '²'.encode('latin1') + b'\n')
# Return 1 to trigger printing
return 1

View File

@@ -1,8 +0,0 @@
from setuptools import setup
setup(
name='python3_hook',
version='0.0.0',
py_modules=['python3_hook'],
entry_points={'console_scripts': ['python3-hook=python3_hook:main']},
)