File: spellcheck

package info (click to toggle)
cvc4 1.8-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 69,876 kB
  • sloc: cpp: 274,686; sh: 5,833; python: 1,893; java: 929; lisp: 763; ansic: 275; perl: 214; makefile: 22; awk: 2
file content (22 lines) | stat: -rwxr-xr-x 659 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

dir="$(dirname "$0")"

find src \( -name '*.cpp' -o -name '*.h' \) \! -path 'src/prop/minisat/*' \! -path 'src/prop/bvminisat/*' \! -path 'src/parser/*/generated/*' |
  while read f; do
    misspelled_words=`
    $dir/extract-strings-and-comments $f |
      ispell -a -W 3 2>/dev/null |
      tail -n +2 |
        while read s; do
          case "$s" in
            \**|\+*|-*) ;;
            \&*|\#*|\?*) echo "$s" | awk '{print$2}';;
#           *) test -n "$s" && echo "UNKNOWN : $s";;
          esac
        done | sort -fu | sed 's,^,  ,'`
    if [ -n "$misspelled_words" ]; then
      echo "$f"
      echo "$misspelled_words"
    fi
  done