FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
RainingKeysPython/.github/scripts/syntax_check.py at master · Thedoczek/RainingKeysPython · GitHub
Thedoczek
/
RainingKeysPython
Public
forked from
Ian-bug/RainingKeysPython
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
RainingKeysPython
/
.github
/
scripts
/
syntax_check.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (32 loc) · 1.01 KB
Breadcrumbs
RainingKeysPython
/
.github
/
scripts
/
syntax_check.py
Copy path
File metadata and controls
37 lines (32 loc) · 1.01 KB
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
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
"""Python syntax check script for GitHub Actions CI."""
import
os
import
py_compile
import
sys
def
check_directory
(
directory
):
"""Check all Python files in a directory."""
for
root
,
_
,
files
in
os
.
walk
(
directory
):
for
file
in
files
:
if
file
.
endswith
(
'.py'
):
filepath
=
os
.
path
.
join
(
root
,
file
)
try
:
py_compile
.
compile
(
filepath
,
doraise
=
True
)
print
(
f"[OK]
{
filepath
}
"
)
except
py_compile
.
PyCompileError
as
e
:
print
(
f"[FAILED]
{
filepath
}
:
{
e
}
"
)
return
False
return
True
# Check main.py
try
:
py_compile
.
compile
(
'main.py'
,
doraise
=
True
)
print
(
"[OK] main.py"
)
except
py_compile
.
PyCompileError
as
e
:
print
(
f"[FAILED] main.py:
{
e
}
"
)
sys
.
exit
(
1
)
# Check core/ directory
if
not
check_directory
(
'core'
):
sys
.
exit
(
1
)
# Check core/ui/ directory
if
not
check_directory
(
'core/ui'
):
sys
.
exit
(
1
)
print
(
"
\n
All files compiled successfully!"
)
Back
|
FazBrowse Home
|
New Git URL