File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,8 @@ install:
149149script :
150150 # fail fast
151151 - set -e
152+ # fail if the template files contains tabs
153+ - /bin/bash ./bin/utils/detect_tab_in_templates.sh
152154 # fail if the test files have changes
153155 - bin/utils/detect_test_file_changes.rb bin/utils/test_file_list.yaml
154156 # fail if templates/generators contain carriage return '\r'
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ #
3+ # Look for \t in the template folders and report errors if found
4+ # as these tabs should be replaced with 4-space instead
5+
6+ # # declare an array of folders
7+ declare -a samples=(" modules/openapi-generator/src/main/resources/kotlin-server"
8+ " modules/openapi-generator/src/main/resources/kotlin-spring"
9+ " modules/openapi-generator/src/main/resources/dart-dio"
10+ " modules/openapi-generator/src/main/resources/dart"
11+ " modules/openapi-generator/src/main/resources/dart2"
12+ " modules/openapi-generator/src/main/resources/aspnetcore"
13+ " modules/openapi-generator/src/main/resources/powershell"
14+ )
15+
16+ # # now loop through the above array
17+ for i in " ${samples[@]} "
18+ do
19+ # grep for \t in the folder
20+ RESULT=` grep -R -P " \t" $i `
21+ echo -e " $RESULT "
22+
23+ if [ " $RESULT " != " " ]; then
24+ echo " Template files contain tab '\\ t'. Please remove it or replace it with 4-space."
25+ exit 1;
26+ fi
27+ done
28+
You can’t perform that action at this time.
0 commit comments