check-method-procs.tcl


Procedures in this file

Detailed information

_xowiki__web_callable_methods_doc (private)

 _xowiki__web_callable_methods_doc

Partial Call Graph (max 5 caller/called nodes):
%3 aa_log aa_log (public) aa_log_result aa_log_result (public) aa_true aa_true (public) _xowiki__web_callable_methods_doc _xowiki__web_callable_methods_doc _xowiki__web_callable_methods_doc->aa_log _xowiki__web_callable_methods_doc->aa_log_result _xowiki__web_callable_methods_doc->aa_true

Testcases:
No testcase defined.

_xowiki__web_callable_methods_naming (private)

 _xowiki__web_callable_methods_naming

Partial Call Graph (max 5 caller/called nodes):
%3 aa_false aa_false (public) aa_log aa_log (public) aa_log_result aa_log_result (public) _xowiki__web_callable_methods_naming _xowiki__web_callable_methods_naming _xowiki__web_callable_methods_naming->aa_false _xowiki__web_callable_methods_naming->aa_log _xowiki__web_callable_methods_naming->aa_log_result

Testcases:
No testcase defined.
[ hide source ] | [ make this the default ]

Content File Source

aa_register_case -cats {smoke production_safe} web_callable_methods_naming {
    checks naming conventions of web callable methods

    @author Gustaf Neumann
} {
    set count 0
    foreach cl [concat \
                    [::xowiki::Page info subclass -closure] \
                    [::xowiki::Package info subclass -closure] \
                    ] {
        foreach m [lsort [$cl info instprocs www-*]] {
            incr count
            regexp {www[-](.*)$} $m . suffix
            set wrong [regexp {[^a-z0-9-]} $suffix]
            aa_false "web callable method '$cl instproc $m' does not follow naming guidelines (just lowercase, digit and dash)" $wrong
        }
    }
    aa_log "Checked $count web callable methods"
}

aa_register_case \
    -cats {smoke production_safe} \
    -error_level warning \
    web_callable_methods_doc {
        Checks if documentation exists for web callable methods

        @author Gustaf Neumann
} {
    set count 0
    foreach cl [concat \
                    [::xowiki::Page info subclass -closure] \
                    [::xowiki::Package info subclass -closure] \
                    ] {
        foreach m [lsort [$cl info instprocs www-*]] {
            incr count
            set exists [nsv_exists api_proc_doc "[string trimleft $cl :] instproc $m"]
            aa_true "documentation for web callable method '$cl instproc $m'" $exists
        }
    }
    aa_log "Checked $count web callable methods"
}

#
# Local variables:
#    mode: tcl
#    tcl-indent-level: 4
#    indent-tabs-mode: nil
# End: