Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 32 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ Commit Check
============

.. image:: https://img.shields.io/pypi/v/commit-check?logo=python&logoColor=white
:alt: PyPI
:target: https://pypi.org/project/commit-check/
:alt: PyPI

.. image:: https://github.com/commit-check/commit-check/actions/workflows/main.yml/badge.svg
:alt: CI
:target: https://github.com/commit-check/commit-check/actions/workflows/main.yml
:alt: CI

.. image:: https://sonarcloud.io/api/project_badges/measure?project=commit-check_commit-check&metric=alert_status
:alt: Quality Gate Status
:target: https://sonarcloud.io/summary/new_code?id=commit-check_commit-check

.. image:: https://results.pre-commit.ci/badge/github/commit-check/commit-check/main.svg
:alt: pre-commit.ci status
:target: https://results.pre-commit.ci/latest/github/commit-check/commit-check/main
:alt: Quality Gate Status

.. image:: https://codecov.io/gh/commit-check/commit-check/branch/main/graph/badge.svg?token=GC2U5V5ZRT
:alt: CodeCov
:target: https://codecov.io/gh/commit-check/commit-check
:alt: CodeCov

.. image:: https://img.shields.io/badge/commit--check-enabled-brightgreen?logo=Git&logoColor=white
:target: https://github.com/commit-check/commit-check
:alt: commit-check

Overview
--------
Expand Down Expand Up @@ -164,6 +164,30 @@ Check branch naming failed
Suggest to run => git checkout -b type/branch_name


Badging your repository
-----------------------

You can add a badge to your repository to show your contributors / users that you use commit-check!

.. image:: https://img.shields.io/badge/commit--check-enabled-brightgreen?logo=Git&logoColor=white
:target: https://github.com/commit-check/commit-check
:alt: commit-check

Markdown

.. code-block:: text

[![commit-check](https://img.shields.io/badge/commit--check-enabled-brightgreen?logo=Git&logoColor=white)](https://github.com/commit-check/commit-check)

reStructuredText

.. code-block:: text

.. image:: https://img.shields.io/badge/commit--check-enabled-brightgreen?logo=Git&logoColor=white
:target: https://github.com/commit-check/commit-check
:alt: commit-check


Versioning
----------

Expand Down
7 changes: 5 additions & 2 deletions commit_check/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ def check_git_config(checks: list, check_type: str) -> int:
check['check'], check['regex'],
check['error'], config_value,
)
if check['suggest']:
print_suggestion(check['suggest'])
try:
if check['suggest']:
print_suggestion(check['suggest'])
except KeyError:
pass
return FAIL
return PASS