From 66600aab81d826fc5503a002d68a8f73d5aea98e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Thu, 8 Feb 2018 10:37:48 +0100 Subject: [PATCH] Add Codacy code quality badge to README --- README.md | 2 +- pre-commit | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 61b8a1d1..a2981fb3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ It uses the Arduino Core for ESP8266 framework and a number of 3rd party librari [![version](https://img.shields.io/badge/version-1.12.4a-brightgreen.svg)](CHANGELOG.md) ![branch](https://img.shields.io/badge/branch-dev-orange.svg) [![travis](https://travis-ci.org/xoseperez/espurna.svg?branch=dev)](https://travis-ci.org/xoseperez/espurna) -[![license](https://img.shields.io/github/license/xoseperez/espurna.svg)](LICENSE) +[![codacy](https://img.shields.io/codacy/grade/c9496e25cf07434cba786b462cb15f49/dev.svg)](https://www.codacy.com/app/xoseperez/espurna/dashboard)[![license](https://img.shields.io/github/license/xoseperez/espurna.svg)](LICENSE) [![donate](https://img.shields.io/badge/donate-PayPal-blue.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=xose%2eperez%40gmail%2ecom&lc=US&no_note=0¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHostedGuest) [![twitter](https://img.shields.io/twitter/follow/xoseperez.svg?style=social)](https://twitter.com/intent/follow?screen_name=xoseperez) diff --git a/pre-commit b/pre-commit index e29fd5f6..4ff6354f 100755 --- a/pre-commit +++ b/pre-commit @@ -52,6 +52,14 @@ travis = "[![travis](https://travis-ci.org/{USER}/{REPO}.svg?branch={BRANCH})]" BRANCH = BRANCH ) +codacy = "[![codacy](https://img.shields.io/codacy/grade/{HASH}/{BRANCH}.svg)]" \ + "(https://www.codacy.com/app/{USER}/{REPO}/dashboard)".format( + HASH = "c9496e25cf07434cba786b462cb15f49", + USER = USER, + REPO = REPO, + BRANCH = BRANCH +) + lines = open(README).readlines() with open(README, "w") as fh: for line in lines: @@ -61,6 +69,8 @@ with open(README, "w") as fh: fh.write(version) elif "![branch]" in line: fh.write(branch) + elif "![codacy]" in line: + fh.write(codacy) else: fh.write(line)