FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pre-commit/pre_commit/yaml.py at main · pre-commit/pre-commit · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
pre-commit
/
pre-commit
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
1k
Star
15.5k
Code
Issues
18
Pull requests
8
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
pre-commit
/
pre_commit
/
yaml.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
19 lines (14 loc) · 561 Bytes
Breadcrumbs
pre-commit
/
pre_commit
/
yaml.py
Copy path
File metadata and controls
19 lines (14 loc) · 561 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from
__future__
import
annotations
import
functools
from
typing
import
Any
import
yaml
Loader
=
getattr
(
yaml
,
'CSafeLoader'
,
yaml
.
SafeLoader
)
yaml_compose
=
functools
.
partial
(
yaml
.
compose
,
Loader
=
Loader
)
yaml_load
=
functools
.
partial
(
yaml
.
load
,
Loader
=
Loader
)
Dumper
=
getattr
(
yaml
,
'CSafeDumper'
,
yaml
.
SafeDumper
)
def
yaml_dump
(
o
:
Any
,
**
kwargs
:
Any
)
->
str
:
# when python/mypy#1484 is solved, this can be `functools.partial`
return
yaml
.
dump
(
o
,
Dumper
=
Dumper
,
default_flow_style
=
False
,
indent
=
4
,
sort_keys
=
False
,
**
kwargs
,
)
Back
|
FazBrowse Home
|
New Git URL