Skip to content

Commit e95cbac

Browse files
authored
Merge pull request #450 from aaronfranke/travis
Add a formatting script for local checking and for Travis CI
2 parents eab59a6 + 7e09d2f commit e95cbac

File tree

6 files changed

+154
-97
lines changed

6 files changed

+154
-97
lines changed

.travis.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
dist: bionic
2+
3+
stages:
4+
- build
5+
6+
matrix:
7+
include:
8+
- name: Static checks (format.sh)
9+
stage: build
10+
os: linux
11+
addons:
12+
apt:
13+
packages:
14+
- dos2unix
15+
- recode
16+
17+
script:
18+
- bash ./format.sh
Lines changed: 94 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,94 @@
1-
Copyright 2011-2016 Severin Meyer <[email protected]>,
2-
with Reserved Font Name Xolonium.
3-
4-
This Font Software is licensed under the SIL Open Font License,
5-
Version 1.1. This license is copied below, and is also available
6-
with a FAQ at <http://scripts.sil.org/OFL>
7-
8-
9-
-----------------------------------------------------------
10-
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
11-
-----------------------------------------------------------
12-
13-
PREAMBLE
14-
The goals of the Open Font License (OFL) are to stimulate worldwide
15-
development of collaborative font projects, to support the font creation
16-
efforts of academic and linguistic communities, and to provide a free and
17-
open framework in which fonts may be shared and improved in partnership
18-
with others.
19-
20-
The OFL allows the licensed fonts to be used, studied, modified and
21-
redistributed freely as long as they are not sold by themselves. The
22-
fonts, including any derivative works, can be bundled, embedded,
23-
redistributed and/or sold with any software provided that any reserved
24-
names are not used by derivative works. The fonts and derivatives,
25-
however, cannot be released under any other type of license. The
26-
requirement for fonts to remain under this license does not apply
27-
to any document created using the fonts or their derivatives.
28-
29-
DEFINITIONS
30-
"Font Software" refers to the set of files released by the Copyright
31-
Holder(s) under this license and clearly marked as such. This may
32-
include source files, build scripts and documentation.
33-
34-
"Reserved Font Name" refers to any names specified as such after the
35-
copyright statement(s).
36-
37-
"Original Version" refers to the collection of Font Software components as
38-
distributed by the Copyright Holder(s).
39-
40-
"Modified Version" refers to any derivative made by adding to, deleting,
41-
or substituting -- in part or in whole -- any of the components of the
42-
Original Version, by changing formats or by porting the Font Software to a
43-
new environment.
44-
45-
"Author" refers to any designer, engineer, programmer, technical
46-
writer or other person who contributed to the Font Software.
47-
48-
PERMISSION & CONDITIONS
49-
Permission is hereby granted, free of charge, to any person obtaining
50-
a copy of the Font Software, to use, study, copy, merge, embed, modify,
51-
redistribute, and sell modified and unmodified copies of the Font
52-
Software, subject to the following conditions:
53-
54-
1) Neither the Font Software nor any of its individual components,
55-
in Original or Modified Versions, may be sold by itself.
56-
57-
2) Original or Modified Versions of the Font Software may be bundled,
58-
redistributed and/or sold with any software, provided that each copy
59-
contains the above copyright notice and this license. These can be
60-
included either as stand-alone text files, human-readable headers or
61-
in the appropriate machine-readable metadata fields within text or
62-
binary files as long as those fields can be easily viewed by the user.
63-
64-
3) No Modified Version of the Font Software may use the Reserved Font
65-
Name(s) unless explicit written permission is granted by the corresponding
66-
Copyright Holder. This restriction only applies to the primary font name as
67-
presented to the users.
68-
69-
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
70-
Software shall not be used to promote, endorse or advertise any
71-
Modified Version, except to acknowledge the contribution(s) of the
72-
Copyright Holder(s) and the Author(s) or with their explicit written
73-
permission.
74-
75-
5) The Font Software, modified or unmodified, in part or in whole,
76-
must be distributed entirely under this license, and must not be
77-
distributed under any other license. The requirement for fonts to
78-
remain under this license does not apply to any document created
79-
using the Font Software.
80-
81-
TERMINATION
82-
This license becomes null and void if any of the above conditions are
83-
not met.
84-
85-
DISCLAIMER
86-
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
87-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
88-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
89-
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
90-
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
91-
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
92-
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93-
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
94-
OTHER DEALINGS IN THE FONT SOFTWARE.
1+
Copyright 2011-2016 Severin Meyer <[email protected]>,
2+
with Reserved Font Name Xolonium.
3+
4+
This Font Software is licensed under the SIL Open Font License,
5+
Version 1.1. This license is copied below, and is also available
6+
with a FAQ at <http://scripts.sil.org/OFL>
7+
8+
9+
-----------------------------------------------------------
10+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
11+
-----------------------------------------------------------
12+
13+
PREAMBLE
14+
The goals of the Open Font License (OFL) are to stimulate worldwide
15+
development of collaborative font projects, to support the font creation
16+
efforts of academic and linguistic communities, and to provide a free and
17+
open framework in which fonts may be shared and improved in partnership
18+
with others.
19+
20+
The OFL allows the licensed fonts to be used, studied, modified and
21+
redistributed freely as long as they are not sold by themselves. The
22+
fonts, including any derivative works, can be bundled, embedded,
23+
redistributed and/or sold with any software provided that any reserved
24+
names are not used by derivative works. The fonts and derivatives,
25+
however, cannot be released under any other type of license. The
26+
requirement for fonts to remain under this license does not apply
27+
to any document created using the fonts or their derivatives.
28+
29+
DEFINITIONS
30+
"Font Software" refers to the set of files released by the Copyright
31+
Holder(s) under this license and clearly marked as such. This may
32+
include source files, build scripts and documentation.
33+
34+
"Reserved Font Name" refers to any names specified as such after the
35+
copyright statement(s).
36+
37+
"Original Version" refers to the collection of Font Software components as
38+
distributed by the Copyright Holder(s).
39+
40+
"Modified Version" refers to any derivative made by adding to, deleting,
41+
or substituting -- in part or in whole -- any of the components of the
42+
Original Version, by changing formats or by porting the Font Software to a
43+
new environment.
44+
45+
"Author" refers to any designer, engineer, programmer, technical
46+
writer or other person who contributed to the Font Software.
47+
48+
PERMISSION & CONDITIONS
49+
Permission is hereby granted, free of charge, to any person obtaining
50+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
51+
redistribute, and sell modified and unmodified copies of the Font
52+
Software, subject to the following conditions:
53+
54+
1) Neither the Font Software nor any of its individual components,
55+
in Original or Modified Versions, may be sold by itself.
56+
57+
2) Original or Modified Versions of the Font Software may be bundled,
58+
redistributed and/or sold with any software, provided that each copy
59+
contains the above copyright notice and this license. These can be
60+
included either as stand-alone text files, human-readable headers or
61+
in the appropriate machine-readable metadata fields within text or
62+
binary files as long as those fields can be easily viewed by the user.
63+
64+
3) No Modified Version of the Font Software may use the Reserved Font
65+
Name(s) unless explicit written permission is granted by the corresponding
66+
Copyright Holder. This restriction only applies to the primary font name as
67+
presented to the users.
68+
69+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
70+
Software shall not be used to promote, endorse or advertise any
71+
Modified Version, except to acknowledge the contribution(s) of the
72+
Copyright Holder(s) and the Author(s) or with their explicit written
73+
permission.
74+
75+
5) The Font Software, modified or unmodified, in part or in whole,
76+
must be distributed entirely under this license, and must not be
77+
distributed under any other license. The requirement for fonts to
78+
remain under this license does not apply to any document created
79+
using the Font Software.
80+
81+
TERMINATION
82+
This license becomes null and void if any of the above conditions are
83+
not met.
84+
85+
DISCLAIMER
86+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
87+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
88+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
89+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
90+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
91+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
92+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
94+
OTHER DEALINGS IN THE FONT SOFTWARE.

format.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
# Loops through all text files tracked by Git.
4+
git grep -zIl '' |
5+
while IFS= read -rd '' f; do
6+
# Exclude csproj and hdr files.
7+
if [[ $f == *"csproj" ]]; then
8+
continue
9+
elif [[ $f == *"hdr" ]]; then
10+
continue
11+
fi
12+
# Ensures that files are UTF-8 formatted.
13+
recode UTF-8 $f 2> /dev/null
14+
# Ensures that files have LF line endings.
15+
dos2unix $f 2> /dev/null
16+
# Ensures that files do not contain a BOM.
17+
sed -i '1s/^\xEF\xBB\xBF//' "$f"
18+
# Ensures that files end with newline characters.
19+
tail -c1 < "$f" | read -r _ || echo >> "$f";
20+
done
21+
22+
git diff > patch.patch
23+
FILESIZE=$(stat -c%s patch.patch)
24+
MAXSIZE=5
25+
26+
# If no patch has been generated all is OK, clean up, and exit.
27+
if (( FILESIZE < MAXSIZE )); then
28+
printf "Files in this commit comply with the formatting rules.\n"
29+
rm -f patch.patch
30+
exit 0
31+
fi
32+
33+
# A patch has been created, notify the user, clean up, and exit.
34+
printf "\n*** The following differences were found between the code "
35+
printf "and the formatting rules:\n\n"
36+
cat patch.patch
37+
printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
38+
rm -f patch.patch
39+
exit 1

gui/rich_text_bbcode/SIL Open Font License.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,4 @@ TERMINATION
152152
This license becomes null and void if any of the above conditions are not met.
153153

154154
DISCLAIMER
155-
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
155+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.

gui/translation/text.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
,en,es,ja
22
KEY_HELLO,Hello!,Hola!,こんにちは
3-
KEY_PUSH,Push Me!,Aprétame!,押す
3+
KEY_PUSH,Push Me!,Aprétame!,押す

networking/webrtc_minimal/Signaling.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ func send_session(path, type, sdp):
2525
func send_candidate(path, mid, index, sdp):
2626
var other = _find_other(path)
2727
assert(other != "")
28-
get_node(other).peer.add_ice_candidate(mid, index, sdp)
28+
get_node(other).peer.add_ice_candidate(mid, index, sdp)

0 commit comments

Comments
 (0)