FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Java/.github/workflows/scripts/check_structure.py at master · TheAlgorithms/Java · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
TheAlgorithms
/
Java
Public
Notifications
You must be signed in to change notification settings
Fork
21.2k
Star
66.2k
Code
Issues
4
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
Java
/
.github
/
workflows
/
scripts
/
check_structure.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (21 loc) · 783 Bytes
Breadcrumbs
Java
/
.github
/
workflows
/
scripts
/
check_structure.py
Copy path
File metadata and controls
27 lines (21 loc) · 783 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
20
21
22
23
24
25
26
27
import
pathlib
import
sys
def
_is_java_file_properly_located
(
java_file
:
pathlib
.
Path
)
->
bool
:
main_parents
=
java_file
.
parent
.
parents
return
(
pathlib
.
Path
(
"src/main/java/com/thealgorithms/"
)
in
main_parents
or
pathlib
.
Path
(
"src/test/java/com/thealgorithms/"
)
in
main_parents
)
def
_find_misplaced_java_files
()
->
list
[
pathlib
.
Path
]:
return
[
java_file
for
java_file
in
pathlib
.
Path
(
"."
).
rglob
(
"*.java"
)
if
not
_is_java_file_properly_located
(
java_file
)
]
if
__name__
==
"__main__"
:
misplaced_files
=
_find_misplaced_java_files
()
if
misplaced_files
:
print
(
"The following java files are not located in the correct directory:"
)
for
_
in
misplaced_files
:
print
(
_
)
sys
.
exit
(
1
)
Back
|
FazBrowse Home
|
New Git URL