mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-29 04:18:33 -06:00
Add duration to verbose run
This commit is contained in:
@@ -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$
|
||||
|
||||
7
testing/resources/arbitrary_bytes_repo/hook.sh
Executable file
7
testing/resources/arbitrary_bytes_repo/hook.sh
Executable 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
|
||||
@@ -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
|
||||
@@ -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']},
|
||||
)
|
||||
Reference in New Issue
Block a user