diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-02-07 08:32:47 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-02-07 09:08:22 -0800 |
commit | 4c3db9273fc8e92c2c23d4455a6ab178472be06d (patch) | |
tree | cdfc8d65ebd56c0a571f8b46854465dd434489de /Makefile | |
parent | 6cd77d4c638012be63d66882403804aa28feb6ed (diff) | |
download | pandoc-4c3db9273fc8e92c2c23d4455a6ab178472be06d.tar.gz |
Apply linter suggestions. Add fix_spacing to lint target in Makefile.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -1,6 +1,6 @@ version?=$(shell grep '^[Vv]ersion:' pandoc.cabal | awk '{print $$2;}') pandoc=$(shell find dist -name pandoc -type f -exec ls -t {} \; | head -1) -SOURCEFILES?=$(shell find pandoc.hs src test -name '*.hs') +SOURCEFILES?=$(shell git ls-tree -r master --name-only | grep "\.hs$$") BRANCH?=master RESOLVER?=lts-13 GHCOPTS=-fdiagnostics-color=always @@ -45,8 +45,14 @@ weigh: reformat: for f in $(SOURCEFILES); do echo $$f; stylish-haskell -i $$f ; done -lint: - for f in $(SOURCEFILES); do echo $$f; hlint --verbose --refactor --refactor-options='-i -s' $$f; done +lint: hlint fix_spacing + +hlint: + for f in $(SOURCEFILES); do echo $$f; hlint --verbose --refactor --refactor-options='-s -o -' $$f; done + +fix_spacing: + # Fix trailing newlines and spaces at ends of lines + for f in $(SOURCEFILES); do printf '%s\n' "`cat $$f`" | sed -e 's/ *$$//' > $$f.tmp; mv $$f.tmp $$f; done changes_github: pandoc --filter tools/extract-changes.hs changelog.md -t gfm --wrap=none | sed -e 's/\\#/#/g' | pbcopy @@ -142,4 +148,4 @@ update-website: clean: stack clean -.PHONY: deps quick full haddock install clean test bench changes_github macospkg dist prof download_stats reformat lint weigh doc/lua-filters.md packages pandoc-templates trypandoc update-website debpkg macospkg winpkg checkdocs ghcid ghci +.PHONY: deps quick full haddock install clean test bench changes_github macospkg dist prof download_stats reformat lint weigh doc/lua-filters.md packages pandoc-templates trypandoc update-website debpkg macospkg winpkg checkdocs ghcid ghci fix_spacing hlint |