CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
75 lines
1.9 KiB
Tcl
Executable File
75 lines
1.9 KiB
Tcl
Executable File
#!/usr/bin/tclsh
|
|
|
|
set usage {
|
|
Usage: spellsift.tcl <source_filenames>
|
|
The named .c and .h source files comment blocks are spell-checked.
|
|
}
|
|
|
|
if {[llength $argv] == 0} {
|
|
puts stderr $usage
|
|
exit 0
|
|
}
|
|
|
|
# Want a Tcl version with 3-argument close.
|
|
package require Tcl 8.6
|
|
|
|
set ::spellchk "aspell --extra-dicts ./custom.rws list"
|
|
|
|
# Run text through aspell with custom dictionary, return finds.
|
|
proc misspelled {text} {
|
|
set spellerr [open "|$::spellchk" r+]
|
|
puts $spellerr $text
|
|
flush $spellerr
|
|
close $spellerr write
|
|
set huhq [regsub {\s*$} [read $spellerr] {}]
|
|
close $spellerr read
|
|
return [split $huhq "\n"]
|
|
}
|
|
|
|
# Eliminate some common patterns that need not be well spelled.
|
|
proc decruft {text} {
|
|
set nopp [regsub -all "\n *#\[^\n\]*\n" $text "\n\n" ]
|
|
set noticket [regsub -all {Ticket \[?[0-9a-f]+\]?} $nopp "" ]
|
|
return $noticket
|
|
}
|
|
|
|
# Sift out common variable spellings not in normal dictionaries.
|
|
proc varsift {words} {
|
|
set rv [list]
|
|
foreach w $words {
|
|
set n [string length $w]
|
|
set cr [string range $w 1 end]
|
|
if {[string tolower $cr] ne $cr} continue
|
|
lappend rv $w;
|
|
}
|
|
return $rv
|
|
}
|
|
|
|
foreach fname $argv {
|
|
set ich [open $fname r]
|
|
set dtext [decruft [read $ich]]
|
|
close $ich
|
|
set cbounds [regexp -indices -inline -all {(/\*)|(\*/)} $dtext]
|
|
set ccb -1
|
|
set cblocks [list]
|
|
foreach {ap cb ce} $cbounds {
|
|
set cib [lindex $cb 1]
|
|
set cie [lindex $ce 0]
|
|
if {$cie != -1} {
|
|
if {$ccb != -1} {
|
|
set cce [expr $cie - 1]
|
|
set destar [string map [list * " "] [string range $dtext $ccb $cce]]
|
|
lappend cblocks $destar
|
|
set ccb -1
|
|
} else continue
|
|
} elseif {$cib != -1} {
|
|
set ccb [expr $cib + 1]
|
|
}
|
|
}
|
|
set oddspells [varsift [misspelled [join $cblocks "\n"]]]
|
|
if {[llength $oddspells] > 0} {
|
|
puts "!? Misspellings from $fname:"
|
|
puts [join [lsort -nocase -unique $oddspells] "\n"]
|
|
}
|
|
}
|