From e3e766227edbec03928520a561786725215bdfd1 Mon Sep 17 00:00:00 2001 From: nodiscc Date: Sat, 27 Feb 2016 23:25:53 +0100 Subject: add Makefile with tests and helpers, update/simplify #Contributing * make noexternallink: chekc for Lines with no source/demo/other link * make missinglicenselanguage: check Lines with only 1 or no language/license entry * make contrib: print list of contributors * make add: helper to add a new software entry * add TODOs * remove link to form since it is unmaintained and outputs wrongly formatted entries https://github.com/Kickball/awesome-selfhosted/issues/282#issuecomment-185423033 * add BEGIN/END SOFTWARE LIST markers to restrict processing to software list only (HTML comments, not rendered to markdown) * link to README.md editor, issues, pull requests * Requirements for Makefile: make, bash. Available in Linux distribution repositories, in XCode on Mac, in GOW on Windows. * Fixes #461 --- Makefile | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..132ab243 --- /dev/null +++ b/Makefile @@ -0,0 +1,45 @@ +#!/usr/bin/make -f +SHELL = /bin/bash +all: checks + +checks: missinglicenselanguage + +noexternallink: + @echo "Lines with no source/demo/other link:" + @sed -n -e '/BEGIN SOFTWARE LIST/,/END SOFTWARE LIST/ p' README.md | egrep '^ *\* ' | egrep --color=always '[a-z\.] `' + +missinglicenselanguage: + @echo "Lines with only 1 or no language/license entry:" + @sed -n -e '/BEGIN SOFTWARE LIST/,/END SOFTWARE LIST/ p' README.md | egrep '^ *\* ' | egrep -v '` `' + +contrib: + @git shortlog -sne + +add: + @#add a new entry + @printf 'Software name: ' ;\ + read Name; if [ -z "$$Name" ]; then printf 'Missing software name!\n'; exit 1 ; fi ;\ + printf 'Homepage URL: ' ;\ + read Url; if [ -z "$$Url" ]; then printf 'Missing main project URL!\n'; exit 1 ; fi ;\ + printf 'Description (max 250 char): ' ;\ + read Description; if [ -z "$$Description" ]; then printf 'Missing description!\n'; exit 1 ; fi ;\ + printf 'License: ' ;\ + read License; if [ -z "$$License" ]; then printf 'Missing license!\n'; exit 1 ; fi ;\ + printf 'Main server-side language/platform/requirement: ' ;\ + read Language; if [ -z "$$Language" ]; then printf 'Missing language!\n'; exit 1 ; fi ;\ + printf 'Demo URL (if any): ' ;\ + read Demo; if [ -z "$$Demo" ]; then CDemo="" ; else CDemo="[Demo]($$Demo)" ; fi ;\ + printf 'Source code URL (if different from Homepage): ' ;\ + read Source; if [ -z "$$Source" ]; then CSource="" ; else CSource="[Source Code]($$Source)" ; fi ;\ + if [[ "$$CSource" == "" && "$$Demo" == "" ]]; \ + then Moreinfo="";\ printf "debug" ;\ + else Moreinfo=$$(echo "($$CSource$$CDemo)" | sed 's|)\[|\], [|g') ;\ + fi ;\ + echo -e "Copy this entry to your clipboard, paste it in the appropriate category:\n\n" ;\ + echo " * [$$Name]($$Url) - $${Description}. $$Moreinfo \`$$License\` \`$$Language\`" + + +#TODO ask for category and insert item accordingly +#TODO check for unsorted entries +#TODO automatically sort entries/sections +#TODO autoupdate contributors list \ No newline at end of file -- cgit v1.2.3 From b337f4f6711be1c2ddb5e376662081cd4a555bfe Mon Sep 17 00:00:00 2001 From: nodiscc Date: Sat, 27 Feb 2016 23:58:17 +0100 Subject: Makefile: check for lines without a full stop after description --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 132ab243..75dff78a 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ SHELL = /bin/bash all: checks -checks: missinglicenselanguage +checks: missinglicenselanguage nofullstop noexternallink: @echo "Lines with no source/demo/other link:" @@ -12,6 +12,11 @@ missinglicenselanguage: @echo "Lines with only 1 or no language/license entry:" @sed -n -e '/BEGIN SOFTWARE LIST/,/END SOFTWARE LIST/ p' README.md | egrep '^ *\* ' | egrep -v '` `' +nofullstop: + @echo "Lines without a full stop after description:" + -@sed -n -e '/BEGIN SOFTWARE LIST/,/END SOFTWARE LIST/ p' README.md | egrep '[a-z] \(\[' + -@sed -n -e '/BEGIN SOFTWARE LIST/,/END SOFTWARE LIST/ p' README.md | egrep '[a-z] `' + contrib: @git shortlog -sne -- cgit v1.2.3