"Fossies" - the Fresh Open Source Software Archive

Member "codespell-2.0.0/Makefile" (23 Nov 2020, 1835 Bytes) of package /linux/misc/codespell-2.0.0.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.17.1_vs_2.0.0.

    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 check-manifest check-distutils flake8 pytest pypi clean
    6 
    7 all: check-dictionaries codespell.1
    8 
    9 check: check-dictionaries check-manifest check-distutils flake8 pytest
   10 
   11 check-dictionary: check-dictionaries
   12 sort-dictionary: sort-dictionaries
   13 trim-dictionary: trim-dictionaries
   14 
   15 codespell.1: codespell.1.include bin/codespell Makefile
   16 	PYTHONPATH=. help2man ./bin/codespell --include codespell.1.include --no-info --output codespell.1
   17 	sed -i '/\.SS \"Usage/,+2d' codespell.1
   18 
   19 check-dictionaries:
   20 	@for dictionary in ${DICTIONARIES}; do \
   21 		if ! LC_ALL=C sort ${SORT_ARGS} -c $$dictionary; then \
   22 			echo "Dictionary $$dictionary not sorted. Sort with 'make sort-dictionaries'"; \
   23 			exit 1; \
   24 		fi; \
   25 		if egrep -n "^\s*$$|\s$$|^\s" $$dictionary; then \
   26 			echo "Dictionary $$dictionary contains leading/trailing whitespace and/or blank lines.  Trim with 'make trim-dictionaries'"; \
   27 			exit 1; \
   28 		fi; \
   29 	done
   30 	@if command -v pytest > /dev/null; then \
   31 		pytest codespell_lib/tests/test_dictionary.py; \
   32 	else \
   33 		echo "Test dependencies not present, install using 'pip install -e \".[dev]\"'"; \
   34 		exit 1; \
   35 	fi
   36 
   37 sort-dictionaries:
   38 	@for dictionary in ${DICTIONARIES}; do \
   39 		LC_ALL=C sort ${SORT_ARGS} -u -o $$dictionary $$dictionary; \
   40 	done
   41 
   42 trim-dictionaries:
   43 	@for dictionary in ${DICTIONARIES}; do \
   44 		sed -E -i.bak -e 's/^[[:space:]]+//; s/[[:space:]]+$$//; /^$$/d' $$dictionary && rm $$dictionary.bak; \
   45 	done
   46 
   47 check-manifest:
   48 	check-manifest
   49 
   50 check-distutils:
   51 	python setup.py check --restructuredtext --strict
   52 
   53 flake8:
   54 	flake8
   55 
   56 pytest:
   57 	pytest codespell_lib
   58 
   59 pypi:
   60 	python setup.py sdist register upload
   61 
   62 clean:
   63 	rm -rf codespell.1