node-markdown-spellcheck icon indicating copy to clipboard operation
node-markdown-spellcheck copied to clipboard

maintain words in `.spelling` sorted alphabetically

Open andyli opened this issue 7 years ago • 2 comments

Feature request: Can the CLI keeps the words in .spelling sorted alphabetically? It would be easier to read.

andyli avatar Oct 31 '16 03:10 andyli

Maybe this is useful. We have a Makefile target like this:

format-spelling:
        sort < .spelling | sort | uniq | tee .spelling.tmp > /dev/null && mv .spelling.tmp .spelling

A bit hacky, but works.

dreh23 avatar Jun 12 '20 11:06 dreh23

Some other workaround scripts from https://github.com/argoproj/argo-workflows/pull/12521:

Simple version:

cat .spelling | sort | uniq | tee .spelling > /dev/null

More complex skipping a few comments at the top of the file:

# alphabetize spelling file -- ignore first 5 lines (comments), then sort the rest case-sensitive and remove duplicates
cat .spelling | awk 'NR<6{ print $0; next } { print $0 | "sort" }' | uniq | tee .spelling > /dev/null

agilgur5 avatar Jan 15 '24 02:01 agilgur5