pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/pre-commit/pre-commit.com/commit/3bc1c31ce770c25b8d211b6dd20fc27b8b267b56

onymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-7a1ad343bd40328c.css" /> Remove unnecessary aspy.yaml · pre-commit/pre-commit.com@3bc1c31 · GitHub
Skip to content

Commit 3bc1c31

Browse files
committed
Remove unnecessary aspy.yaml
1 parent e1f46b1 commit 3bc1c31

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

make_all_hooks.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import collections
1+
import functools
22
import json
33
import multiprocessing
44
import os.path
@@ -8,9 +8,12 @@
88
from typing import Dict
99
from typing import Tuple
1010

11-
import aspy.yaml
11+
import yaml
1212
from pre_commit.clientlib import load_manifest
1313

14+
Loader = getattr(yaml, 'CSafeLoader', yaml.SafeLoader)
15+
fast_load = functools.partial(yaml.load, Loader=Loader)
16+
1417

1518
def get_manifest(repo_path: str) -> Tuple[str, Dict[str, Any]]:
1619
print(f'*** {repo_path}')
@@ -21,13 +24,16 @@ def get_manifest(repo_path: str) -> Tuple[str, Dict[str, Any]]:
2124
manifest_path = os.path.join(repo_dir, '.pre-commit-hooks.yaml')
2225
# Validate the manifest just to make sure it's ok.
2326
load_manifest(manifest_path)
24-
return (repo_path, aspy.yaml.ordered_load(open(manifest_path)))
27+
with open(manifest_path) as f:
28+
return repo_path, fast_load(f)
2529

2630

2731
def main() -> int:
28-
repos = aspy.yaml.ordered_load(open('all-repos.yaml'))
32+
with open('all-repos.yaml') as f:
33+
repos = fast_load(f)
34+
2935
pool = multiprocessing.Pool(4)
30-
hooks_json = collections.OrderedDict(pool.map(get_manifest, repos))
36+
hooks_json = dict(pool.map(get_manifest, repos))
3137

3238
with open('all-hooks.json', 'w') as hooks_json_file:
3339
json.dump(hooks_json, hooks_json_file, indent=4)

requirements-dev.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
aspy.yaml
21
mako
32
libsass
43
markdown-code-blocks

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy