2016-02-27 23:25:53 +01:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
SHELL = /bin/bash
|
2021-04-18 18:24:35 +02:00
|
|
|
AWESOME_BOT_OPTIONS = --allow-redirect --skip-save-results --allow 202 --white-list airsonic.github.io/docs/apps,flaskbb.org
|
2016-02-27 23:25:53 +01:00
|
|
|
|
2020-09-05 15:39:14 +02:00
|
|
|
all: check_all
|
2016-02-27 23:25:53 +01:00
|
|
|
|
2020-09-05 15:39:14 +02:00
|
|
|
# run all checks
|
|
|
|
check_all: check_syntax_full awesome_bot check_github_commit_dates
|
2019-06-23 16:39:00 +02:00
|
|
|
|
2020-09-05 15:39:14 +02:00
|
|
|
# check pull requests
|
|
|
|
check_pr: check_syntax_diff
|
2016-02-27 23:25:53 +01:00
|
|
|
|
2020-09-05 15:39:14 +02:00
|
|
|
# check syntax in whole file
|
|
|
|
check_syntax_full:
|
|
|
|
node tests/test.js -r README.md
|
2016-02-27 23:25:53 +01:00
|
|
|
|
2020-09-05 15:39:14 +02: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 23:25:53 +01:00
|
|
|
|
2020-09-05 15:39:14 +02:00
|
|
|
# check dead links
|
|
|
|
# https://github.com/dkhamsing/awesome_bot
|
2019-06-23 16:42:54 +02:00
|
|
|
awesome_bot:
|
2020-09-05 15:39:14 +02:00
|
|
|
awesome_bot -f README.md $(AWESOME_BOT_OPTIONS)
|
2019-06-23 16:42:54 +02:00
|
|
|
|
2020-09-05 15:39:14 +02:00
|
|
|
# check date of last commit for github.com repository URLs
|
2019-06-23 16:38:30 +02:00
|
|
|
check_github_commit_dates:
|
2020-09-05 15:39:14 +02:00
|
|
|
pip3 install PyGithub
|
2019-06-23 16:38:30 +02:00
|
|
|
python3 tests/check-github-commit-dates.py
|
|
|
|
|
|
|
|
#################################
|
|
|
|
|
2020-09-05 15:39:14 +02: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 16:38:30 +02:00
|
|
|
|
2020-09-05 15:39:14 +02:00
|
|
|
# add a new entry
|
2016-02-27 23:25:53 +01:00
|
|
|
add:
|
2020-09-05 15:39:14 +02: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 13:30:02 +01:00
|
|
|
echo "- [$$Name]($$Url) - $${Description} $${Moreinfo} \`$$License\` \`$$Language\`"
|