_acs-tcl__documentation__check_typos (private)
_acs-tcl__documentation__check_typos
Defined in packages/acs-tcl/tcl/test/doc-check-procs.tcl
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set _aa_export {} set body_count 1 foreach testcase_body {{ set typo_list "[acs_package_root_dir acs-tcl]/tcl/test/doc-check-procs-common-typos.txt" set typos [dict create] # Create the typo dictionary with values from the common typos file set f [open $typo_list "r"] while {[gets $f line] >= 0} { if {[regexp {^(.*)[\|][\|](.*)$} [string tolower $line] . word replacement]} { dict set typos $word $replacement } } close $f aa_log "Created typo dictionary using data from $typo_list ([dict size $typos] typos loaded)" # Check for the typos set count 0 set good 0 set checks 0 set ignorechars { , " " ( " " ) " " < " " > " " \[ " " \] " " \{ " " \} " " < " " > " " . " " : " " ; " " ? " " ! " " = " " \r " " \" " " „ " " “ " " ” " " " " "" } foreach p [lsort -dictionary [nsv_array names api_proc_doc]] { incr count set typo_number 0 set proc_doc [nsv_get api_proc_doc $p] if {[dict exists $proc_doc main]} { set main_doc [string tolower [dict get $proc_doc main]] # # Remove extra characters from the doc. # set proc_doc_clean [string map $ignorechars $main_doc] if { [string length $proc_doc_clean] > 0} { # # Check the words of the documentation string # against the dictionary. # foreach word [lsort -unique $proc_doc_clean] { incr checks if {[dict exists $typos $word]} { # Typo found! incr typo_number aa_log_result fail "spelling error in proc $p: $word -> [dict get $typos $word]" } } } # Just count the number of procs without doc typos for summarizing if { $typo_number == 0 } { incr good } } } aa_log "Documentation seems typo free in $good of $count checked procs (total typo checks: $checks)" }} { aa_log "Running testcase body $body_count" set ::__aa_test_indent [info level] set catch_val [catch $testcase_body msg] if {$catch_val != 0 && $catch_val != 2} { aa_log_result "fail" "documentation__check_typos (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo" } incr body_count }XQL Not present: Generic, PostgreSQL, Oracle