node-markdown-spellcheck
node-markdown-spellcheck copied to clipboard
maintain words in `.spelling` sorted alphabetically
Feature request:
Can the CLI keeps the words in .spelling
sorted alphabetically?
It would be easier to read.
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.
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