File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,13 @@ function rspec_support_compatible {
57
57
fi
58
58
}
59
59
60
+ function documentation_enforced {
61
+ if [ -x ./bin/yard ]; then
62
+ return 0
63
+ else
64
+ return 1
65
+ fi
66
+ }
60
67
61
68
function clone_repo {
62
69
if [ ! -d $1 ]; then # don't clone if the dir is already there
@@ -118,3 +125,17 @@ function run_spec_suite_for {
118
125
popd
119
126
fi ;
120
127
}
128
+
129
+ function check_documentation_coverage {
130
+ bin/yard stats --list-undoc | ruby -e "
131
+ while line = gets
132
+ coverage ||= line[/([\d\.]+)% documented/, 1]
133
+ puts line
134
+ end
135
+
136
+ unless Float(coverage) == 100
137
+ puts \" \n\nMissing documentation coverage (currently at #{coverage}%)\"
138
+ exit(1)
139
+ end
140
+ "
141
+ }
Original file line number Diff line number Diff line change @@ -5,6 +5,10 @@ source script/functions.sh
5
5
run_specs_and_record_done
6
6
run_cukes
7
7
8
+ if documentation_enforced; then
9
+ check_documentation_coverage
10
+ fi
11
+
8
12
if is_mri; then
9
13
run_specs_one_by_one
10
14
run_spec_suite_for " rspec-core"
You can’t perform that action at this time.
0 commit comments