File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Expand file tree Collapse file tree 3 files changed +40
-0
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 212
212
213
213
# Check lint errors.
214
214
" ${top_dir} /scripts/check_whitespace.sh"
215
+ " ${top_dir} /scripts/check_filename_spaces.sh"
215
216
" ${top_dir} /scripts/check_copyright.sh"
216
217
" ${top_dir} /scripts/check_no_module_imports.sh"
217
218
" ${top_dir} /scripts/check_test_inclusion.py"
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Copyright 2019 Google
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Fail on spaces in file names, excluding the patterns listed below.
18
+
19
+ # A sed program that removes filename patterns that are allowed to have spaces
20
+ # in them.
21
+ function remove_valid_names() {
22
+ sed '
23
+ # Xcode-generated asset files
24
+ /Assets.xcassets/ d
25
+
26
+ # Files without spaces
27
+ /^[^ ]*$/ d
28
+ '
29
+ }
30
+
31
+ count=$( git ls-files | remove_valid_names | wc -l | xargs)
32
+
33
+ if [[ ${count} != 0 ]]; then
34
+ echo ' ERROR: Spaces in filenames are not permitted in this repo. Please fix.'
35
+ echo ' '
36
+
37
+ git ls-files | remove_valid_names
38
+ exit 1
39
+ fi
You can’t perform that action at this time.
0 commit comments