ci: static check: spellcheck: check all docs#2228
ci: static check: spellcheck: check all docs#2228GabyCT merged 1 commit intokata-containers:masterfrom
Conversation
|
@jodh-intel @chavafg - can we stare hard at this bash - it is slightly tricky, and I can't easily test it locally, and I think the CI won't really test it - so we might need some 👀 all over it.. |
.ci/static-checks.sh
Outdated
| "$cmd" check "$doc" || { info "spell check failed for document $doc" && docs_failed=1; } | ||
| done | ||
|
|
||
| [ $docs_failed -ne 0 ] || die "spell check failed, See https://github.com/kata-containers/documentation/blob/master/Documentation-Requirements.md#spelling for more information." |
There was a problem hiding this comment.
should this be && instead of ||
or
use -eq instead of -ne
There was a problem hiding this comment.
ah, yup, I think you are right. that is a copy/paste/do-not-engage-brain moment :-)
Rather than fail the spell check on the first failure, continue to check all the changed documents, and report the global fail at the end. This may help reduce CI/review cycle time if/when multiple docs are submitted in a single PR. Also spit out a URL link to the documentation repo docs in the case of failure, to help direct authors to guidance docs. Fixes: kata-containers#2227 Signed-off-by: Graham Whaley <graham.whaley@intel.com>
7b719c4 to
c4a2919
Compare
| for doc in $docs | ||
| do | ||
| "$cmd" check "$doc" || die "spell check failed for document $doc" | ||
| "$cmd" check "$doc" || { info "spell check failed for document $doc" && docs_failed=1; } |
There was a problem hiding this comment.
we could increment the variable value if we want to tell the user how many errors he got, but if not, I think this way is fine.
There was a problem hiding this comment.
I did originally think of increment, but then ran away from the idea of adding any bc or (( )) code into a single line expression, so went with the simple =1 option. We could also collect up the names of the $docs that failed, and list them at the end.
I can add those improvements if we want. I think as it is, all the necessary info should appear in the logs fairly grouped together.
Somebody just shout if they want the improvements adding.
|
/test-ubuntu |
During the merge of kata-containers#2228 the final check in the spell check got inverted - fix with a `|| true`. Fixes: kata-containers#2239 Signed-off-by: Graham Whaley <graham.whaley@intel.com>
During the merge of kata-containers#2228 the final check in the spell check got inverted - fix with a nice test inversion. Fixes: kata-containers#2239 Signed-off-by: Graham Whaley <graham.whaley@intel.com>
Rather than fail the spell check on the first failure, continue to
check all the changed documents, and report the global fail at the
end. This may help reduce CI/review cycle time if/when multiple docs
are submitted in a single PR.
Also spit out a URL link to the documentation repo docs in the case
of failure, to help direct authors to guidance docs.
Fixes: #2227
Signed-off-by: Graham Whaley graham.whaley@intel.com