Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
0926c192
Commit
0926c192
authored
Mar 31, 2020
by
Rémi Verschelde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Style: Add black format to fix_style.sh
Also ignore new Android build artifact.
parent
ece425ac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
.gitignore
.gitignore
+1
-0
fix_style.sh
misc/scripts/fix_style.sh
+19
-1
No files found.
.gitignore
View file @
0926c192
...
...
@@ -18,6 +18,7 @@ local.properties
.idea
.gradletasknamecache
project.properties
platform/android/java/lib/.cxx/
platform/android/java/libs/*
platform/android/java/app/libs/*
...
...
misc/scripts/fix_style.sh
View file @
0926c192
#!/usr/bin/env bash
# Command line arguments
run_black
=
false
run_clang_format
=
false
run_fix_headers
=
false
usage
=
"Invalid argument. Usage:
\n
$0
<option>
\n\t
--clang-format|-c
\n\t
--headers|-h
\n\t
--all|-a"
usage
=
"Invalid argument. Usage:
\n
$0
<option>
\n\t
--
black|-b
\n\t
--
clang-format|-c
\n\t
--headers|-h
\n\t
--all|-a"
if
[
-z
"
$1
"
]
;
then
echo
-e
$usage
...
...
@@ -12,6 +13,9 @@ fi
while
[
$#
-gt
0
]
;
do
case
"
$1
"
in
--black
|
-b
)
run_black
=
true
;;
--clang-format
|
-c
)
run_clang_format
=
true
;;
...
...
@@ -19,6 +23,7 @@ while [ $# -gt 0 ]; do
run_fix_headers
=
true
;;
--all
|
-a
)
run_black
=
true
run_clang_format
=
true
run_fix_headers
=
true
;;
...
...
@@ -32,6 +37,19 @@ done
echo
"Removing generated files, some have binary data and make clang-format freeze."
find
-name
"*.gen.*"
-delete
# Apply black
if
$run_black
;
then
echo
-e
"Formatting Python files..."
PY_FILES
=
$(
find
\(
-path
"./.git"
\
-o
-path
"./thirdparty"
\
\)
-prune
\
-o
\(
-name
"SConstruct"
\
-o
-name
"SCsub"
\
-o
-name
"*.py"
\
\)
-print
)
black
-l
120
$PY_FILES
fi
# Apply clang-format
if
$run_clang_format
;
then
# Sync list with pre-commit hook
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment