FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
pre-commit/pre_commit/prefix.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
/
prefix.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
18 lines (12 loc) · 495 Bytes
Breadcrumbs
pre-commit
/
pre_commit
/
prefix.py
Copy path
File metadata and controls
18 lines (12 loc) · 495 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
from
__future__
import
annotations
import
os
.
path
from
typing
import
NamedTuple
class
Prefix
(
NamedTuple
):
prefix_dir
:
str
def
path
(
self
,
*
parts
:
str
)
->
str
:
return
os
.
path
.
normpath
(
os
.
path
.
join
(
self
.
prefix_dir
,
*
parts
))
def
exists
(
self
,
*
parts
:
str
)
->
bool
:
return
os
.
path
.
exists
(
self
.
path
(
*
parts
))
def
star
(
self
,
end
:
str
)
->
tuple
[
str
, ...]:
paths
=
os
.
listdir
(
self
.
prefix_dir
)
return
tuple
(
path
for
path
in
paths
if
path
.
endswith
(
end
))
Back
|
FazBrowse Home
|
New Git URL