2016-02-27 15:25:53 -07:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
SHELL = /bin/bash
|
2021-04-19 09:58:21 -06:00
|
|
|
AWESOME_BOT_OPTIONS = "--allow-redirect --skip-save-results --allow 202 --white-list airsonic.github.io/docs/apps,flaskbb.org"
|
2016-02-27 15:25:53 -07:00
|
|
|
|
2020-09-05 07:39:14 -06:00
|
|
|
all: check_all
|
2016-02-27 15:25:53 -07:00
|
|
|
|
2020-09-05 07:39:14 -06:00
|
|
|
# run all checks
|
|
|
|
check_all: check_syntax_full awesome_bot check_github_commit_dates
|
2019-06-23 08:39:00 -06:00
|
|
|
|
2020-09-05 07:39:14 -06:00
|
|
|
# check pull requests
|
|
|
|
check_pr: check_syntax_diff
|
2016-02-27 15:25:53 -07:00
|
|
|
|
2020-09-05 07:39:14 -06:00
|
|
|
# check syntax in whole file
|
|
|
|
check_syntax_full:
|
|
|
|
node tests/test.js -r README.md
|
2016-02-27 15:25:53 -07:00
|
|
|
|
2020-09-05 07:39:14 -06:00
|
|
|
# check syntax in the diff from master to current branch
|
|
|
|
check_syntax_diff:
|
|
|
|
git diff origin/master -U0 README.md | grep --perl-regexp --only-matching "(?<=^\+).*" >> temp.md && \
|
|
|
|
node tests/test.js -r README.md -d temp.md && \
|
|
|
|
awesome_bot -f temp.md $(AWESOME_BOT_OPTIONS)
|
2016-02-27 15:25:53 -07:00
|
|
|
|
2020-09-05 07:39:14 -06:00
|
|
|
# check dead links
|
|
|
|
# https://github.com/dkhamsing/awesome_bot
|
2019-06-23 08:42:54 -06:00
|
|
|
awesome_bot:
|
2020-09-05 07:39:14 -06:00
|
|
|
awesome_bot -f README.md $(AWESOME_BOT_OPTIONS)
|
2019-06-23 08:42:54 -06:00
|
|
|
|
2020-09-05 07:39:14 -06:00
|
|
|
# check date of last commit for github.com repository URLs
|
2019-06-23 08:38:30 -06:00
|
|
|
check_github_commit_dates:
|
2020-09-05 07:39:14 -06:00
|
|
|
pip3 install PyGithub
|
2019-06-23 08:38:30 -06:00
|
|
|
python3 tests/check-github-commit-dates.py
|
|
|
|
|
|
|
|
#################################
|
|
|
|
|
2020-09-05 07:39:14 -06:00
|
|
|
# update the AUTHORS.md file
|
|
|
|
contrib:
|
|
|
|
@mv .github/.mailmap . && printf "|Commits | Author |\n| :---: | --- |\n" > AUTHORS.md && git shortlog -sne | sed -r 's/^\s*([[:digit:]]*?)\s*?(.*?)/|\1|\2|/' >> AUTHORS.md && mv .mailmap .github/.mailmap
|
2019-06-23 08:38:30 -06:00
|
|
|
|
2020-09-05 07:39:14 -06:00
|
|
|
# add a new entry
|
2016-02-27 15:25:53 -07:00
|
|
|
add:
|
2020-09-05 07:39:14 -06:00
|
|
|
@read -r -p "Software name: " Name && [[ ! -z "$$Name" ]] && \
|
|
|
|
read -r -p "Homepage/URL: " Url && [[ ! -z "$$Url" ]] && \
|
|
|
|
read -r -p "Description (max 250 characters, ending with .): " Description && [[ ! -z "$$Description" ]] && \
|
|
|
|
read -r -p "License: " License && [[ ! -z "$$License" ]] && \
|
|
|
|
read -r -p "Main server-side language/platform/requirement: " Language && [[ ! -z "$$Language" ]] && \
|
|
|
|
read -r -p "Demo URL (optional,leave empty): " Demo && \
|
|
|
|
if [[ "$$Demo" == "" ]]; then CDemo=""; else CDemo="[Demo]($$Demo)"; fi; \
|
|
|
|
read -r -p "Source code URL (if different from homepage): " Source && \
|
|
|
|
if [[ "$$Source" == "" ]]; then CSource=""; else CSource="[Source Code]($$Source)"; fi; \
|
|
|
|
if [[ "$$CSource" == "" && "$$Demo" == "" ]]; then Moreinfo=""; else Moreinfo="($$CDemo $$CSource)"; fi; \
|
|
|
|
echo "Copy this entry to your clipboard, paste it in the appropriate category:" ;\
|
2017-12-28 05:30:02 -07:00
|
|
|
echo "- [$$Name]($$Url) - $${Description} $${Moreinfo} \`$$License\` \`$$Language\`"
|