From 595edefa5920e0fc9190854ff9dd108030442a3f Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 28 Nov 2020 19:55:26 +0100 Subject: [PATCH] Report lack of badge in the README --- package_linter.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/package_linter.py b/package_linter.py index 68ae034..c1f7f82 100755 --- a/package_linter.py +++ b/package_linter.py @@ -411,6 +411,27 @@ class App(TestSuite): if has_domain_arg and not file_exists(app.path + "/scripts/change_url"): yield Warning("Consider adding a change_url script to support changing where the app is installed") + @test() + def badges_in_readme(app): + + id_ = app.manifest["id"] + + if not file_exists(app.path + "/README.md"): + return + + content = open(app.path + "/README.md").read() + + if not "dash.yunohost.org/integration/%s.svg" % id_ in content: + yield Warning( + "Please add a badge displaying the level of the app in the README. " + "At least something like :\n " + "[![Integration level](https://dash.yunohost.org/integration/%s.svg)](https://dash.yunohost.org/appci/app/%s)\n" + " (but ideally you should check example_ynh for the full set of recommendations !)" + % (id_, id_) + ) + + + ####################################### # _ _ _ # # | | | | | | #