From 36b2c00228f34211d511025915381ceba7345b27 Mon Sep 17 00:00:00 2001 From: kaido Date: Tue, 21 Jul 2015 07:52:23 -0700 Subject: [PATCH 1/4] Add Codeclimate and Codacy badge placeholders --- README.rst | 14 ++++++++++++++ cookiecutter.json | 2 ++ {{cookiecutter.repo_name}}/README.rst | 12 ++++++++++++ 3 files changed, 28 insertions(+) diff --git a/README.rst b/README.rst index 47db63cc..88a3947a 100644 --- a/README.rst +++ b/README.rst @@ -158,6 +158,18 @@ You will be asked for these fields: "no" - Add a Scrutinizer_ badge in ``README.rst``. + * - ``cookiecutter.codacy`` + - .. code:: python + + "no" + - Add a Codacy_ badge in ``README.rst``. + + * - ``cookiecutter.codeclimate`` + - .. code:: python + + "no" + - Add a CodeClimate_ badge in ``README.rst``. + * - ``sphinx_theme`` - .. code:: python @@ -299,3 +311,5 @@ If you have criticism or suggestions please open up an Issue or Pull Request. .. _Codecov: http://codecov.io/ .. _Landscape: https://landscape.io/ .. _Scrutinizer: https://scrutinizer-ci.com/ +.. _Codacy: https://codacy.com/ +.. _CodeClimate: https://codeclimate.com/ diff --git a/cookiecutter.json b/cookiecutter.json index 18f35230..ee6eee0f 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -20,5 +20,7 @@ "codecov": "yes", "landscape": "no", "scrutinizer": "no", + "codacy" : "no", + "codeclimate" : "no", "sphinx_theme": "readthedocs" } diff --git a/{{cookiecutter.repo_name}}/README.rst b/{{cookiecutter.repo_name}}/README.rst index c9a0e63b..01d77f0d 100644 --- a/{{cookiecutter.repo_name}}/README.rst +++ b/{{cookiecutter.repo_name}}/README.rst @@ -13,6 +13,8 @@ {%- if cookiecutter.codecov|lower == 'yes' %} |codecov|{% endif -%} {%- if cookiecutter.landscape|lower == 'yes' %} |landscape|{% endif -%} {%- if cookiecutter.scrutinizer|lower == 'yes' %} |scrutinizer|{% endif -%} + {%- if cookiecutter.codacy|lower == 'yes' %} |codacy|{% endif -%} + {%- if cookiecutter.codeclimate|lower == 'yes' %} |codeclimate|{% endif -%} {{ '' }} * - package - |version| |downloads| @@ -43,6 +45,16 @@ :target: https://landscape.io/github/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }}/master :alt: Code Quality Status {% endif %} +{% if cookiecutter.codacy|lower == 'yes' %} +.. |codacy| image:: https://www.codacy.com/project/badge/REPLACE_WITH_PROJECT_ID + :target: https://www.codacy.com/app/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }} + :alt: Codacy Code Quality Status +{% endif %} +{% if cookiecutter.codeclimate|lower == 'yes' %} +.. |codeclimate| image:: https://codeclimate.com/repos/REPLACE_WITH_PROJECT_ID/gpa.svg + :target: https://codeclimate.com/repos/REPLACE_WITH_PROJECT_ID/feed + :alt: CodeClimate Quality Status +{% endif %} .. |version| image:: http://img.shields.io/pypi/v/{{ cookiecutter.distribution_name }}.svg?style=flat :alt: PyPI Package latest release :target: https://pypi.python.org/pypi/{{ cookiecutter.distribution_name }} From 894f23b8d36b4cf5604aa6e8d6ee33e36593ff84 Mon Sep 17 00:00:00 2001 From: kaido Date: Tue, 21 Jul 2015 08:00:33 -0700 Subject: [PATCH 2/4] Fix up badge svg style to align with the rest --- {{cookiecutter.repo_name}}/README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.repo_name}}/README.rst b/{{cookiecutter.repo_name}}/README.rst index 01d77f0d..0b42d43f 100644 --- a/{{cookiecutter.repo_name}}/README.rst +++ b/{{cookiecutter.repo_name}}/README.rst @@ -46,13 +46,13 @@ :alt: Code Quality Status {% endif %} {% if cookiecutter.codacy|lower == 'yes' %} -.. |codacy| image:: https://www.codacy.com/project/badge/REPLACE_WITH_PROJECT_ID +.. |codacy| image:: https://img.shields.io/codacy/REPLACE_WITH_PROJECT_ID.svg?style=flat&label=Codacy :target: https://www.codacy.com/app/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }} :alt: Codacy Code Quality Status {% endif %} {% if cookiecutter.codeclimate|lower == 'yes' %} -.. |codeclimate| image:: https://codeclimate.com/repos/REPLACE_WITH_PROJECT_ID/gpa.svg - :target: https://codeclimate.com/repos/REPLACE_WITH_PROJECT_ID/feed +.. |codeclimate| image:: https://img.shields.io/codeclimate/github/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }}.svg?style=flat&label=CodeClimate + :target: https://codeclimate.com/github/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }} :alt: CodeClimate Quality Status {% endif %} .. |version| image:: http://img.shields.io/pypi/v/{{ cookiecutter.distribution_name }}.svg?style=flat From 95d3c19ad91db4eeb462014728dd2eb7bdcdd1b9 Mon Sep 17 00:00:00 2001 From: kaido Date: Tue, 21 Jul 2015 08:21:22 -0700 Subject: [PATCH 3/4] Add note about fixing up Codacy badge after importing --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index 88a3947a..ed297217 100644 --- a/README.rst +++ b/README.rst @@ -164,6 +164,8 @@ You will be asked for these fields: "no" - Add a Codacy_ badge in ``README.rst``. + **Note:** After importing the project in Codacy, find the hexadecimal project ID from settings and replace it in badge URL + * - ``cookiecutter.codeclimate`` - .. code:: python From a44454337dfc074bcd8e803b67b2d23b9221802a Mon Sep 17 00:00:00 2001 From: kaido Date: Tue, 21 Jul 2015 08:25:53 -0700 Subject: [PATCH 4/4] Fix tabs/spaces --- cookiecutter.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index ee6eee0f..7c6d7c8b 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -20,7 +20,7 @@ "codecov": "yes", "landscape": "no", "scrutinizer": "no", - "codacy" : "no", - "codeclimate" : "no", + "codacy" : "no", + "codeclimate" : "no", "sphinx_theme": "readthedocs" }