"Fossies" - the Fresh Open Source Software Archive

Member "codespell-1.17.1/Makefile" (22 May 2020, 1482 Bytes) of package /linux/misc/codespell-1.17.1.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "Makefile": 1.16.0_vs_1.17.1.

    1 SORT_ARGS := -f -b
    2 
    3 DICTIONARIES := codespell_lib/data/dictionary*.txt
    4 
    5 PHONY := all check check-dictionaries sort-dictionaries trim-dictionaries check-dictionary sort-dictionary trim-dictionary clean
    6 
    7 all: check-dictionaries codespell.1
    8 
    9 check-dictionary: check-dictionaries
   10 sort-dictionary: sort-dictionaries
   11 trim-dictionary: trim-dictionaries
   12 
   13 codespell.1: codespell.1.include bin/codespell
   14 	PYTHONPATH=. help2man ./bin/codespell --include codespell.1.include --no-info --output codespell.1
   15 	sed -i '/\.SS \"Usage/,+2d' codespell.1
   16 
   17 check-dictionaries:
   18 	@for dictionary in ${DICTIONARIES}; do \
   19 		if ! LC_ALL=C sort ${SORT_ARGS} -c $$dictionary; then \
   20 			echo "Dictionary $$dictionary not sorted. Sort with 'make sort-dictionaries'"; \
   21 			exit 1; \
   22 		fi; \
   23 		if egrep -n "^\s*$$|\s$$|^\s" $$dictionary; then \
   24 			echo "Dictionary $$dictionary contains leading/trailing whitespace and/or blank lines.  Trim with 'make trim-dictionaries'"; \
   25 			exit 1; \
   26 		fi; \
   27 	done
   28 	@if command -v pytest > /dev/null; then \
   29 		pytest codespell_lib/tests/test_dictionary.py; \
   30 	fi
   31 
   32 sort-dictionaries:
   33 	@for dictionary in ${DICTIONARIES}; do \
   34 		LC_ALL=C sort ${SORT_ARGS} -u -o $$dictionary $$dictionary; \
   35 	done
   36 
   37 trim-dictionaries:
   38 	@for dictionary in ${DICTIONARIES}; do \
   39 		sed -E -i.bak -e 's/^[[:space:]]+//; s/[[:space:]]+$$//; /^$$/d' $$dictionary && rm $$dictionary.bak; \
   40 	done
   41 
   42 check-manifest:
   43 	check-manifest
   44 
   45 pypi:
   46 	python setup.py sdist register upload
   47 
   48 clean:
   49 	rm -rf codespell.1