mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 11:36:54 +00:00
Merge ad6977c2f8 into 5e4e5b3bcb
This commit is contained in:
commit
e75fbac324
1 changed files with 3 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
BLACKLIST = [
|
BLACKLIST = [
|
||||||
|
|
@ -19,6 +20,8 @@ def detect_private_key(argv=None):
|
||||||
private_key_files = []
|
private_key_files = []
|
||||||
|
|
||||||
for filename in args.filenames:
|
for filename in args.filenames:
|
||||||
|
if os.path.isdir(filename):
|
||||||
|
continue
|
||||||
with open(filename, 'rb') as f:
|
with open(filename, 'rb') as f:
|
||||||
content = f.read()
|
content = f.read()
|
||||||
if any(line in content for line in BLACKLIST):
|
if any(line in content for line in BLACKLIST):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue