Skip to content

Enforce doc coverage rules #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 15, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions travis/script/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ function rspec_support_compatible {
fi
}

function documentation_enforced {
if [ -x ./bin/yard ]; then
return 0
else
return 1
fi
}

function clone_repo {
if [ ! -d $1 ]; then # don't clone if the dir is already there
Expand Down Expand Up @@ -118,3 +125,17 @@ function run_spec_suite_for {
popd
fi;
}

function check_documentation_coverage {
bin/yard stats --list-undoc | ruby -e "
while line = gets
coverage ||= line[/([\d\.]+)% documented/, 1]
puts line
end

unless Float(coverage) == 100
puts \"\n\nMissing documentation coverage (currently at #{coverage}%)\"
exit(1)
end
"
}
4 changes: 4 additions & 0 deletions travis/script/run_build
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ source script/functions.sh
run_specs_and_record_done
run_cukes

if documentation_enforced; then
check_documentation_coverage
fi

if is_mri; then
run_specs_one_by_one
run_spec_suite_for "rspec-core"
Expand Down