Skip to content

Conversation

jordanSu
Copy link
Contributor

@jordanSu jordanSu commented Aug 30, 2020

Description

As mentioned in #200 , this PR make cz check can read a string input as an argument with "--message"

Checklist

  • Add test cases to all the changes you introduce
  • Run ./script/format and ./script/test locally to ensure this change passes linter check and test
  • Test the changes on the local machine manually
  • Update the documentation for the changes

Expected behavior

With "-m" or "--message", cz check checks string input as commit message.

Steps to Test This Pull Request

  1. cz check -m COMMIT_MESSAGE
  2. cz check --message COMMIT_MESSAGE

Additional context

Refer to issue #200

@codecov
Copy link

codecov bot commented Aug 30, 2020

Codecov Report

Merging #254 into master will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #254      +/-   ##
==========================================
+ Coverage   96.58%   96.61%   +0.02%     
==========================================
  Files          33       33              
  Lines         908      915       +7     
==========================================
+ Hits          877      884       +7     
  Misses         31       31              
Flag Coverage Δ
#unittests 96.61% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
commitizen/cli.py 97.36% <ø> (ø)
commitizen/commands/bump.py 90.58% <ø> (ø)
commitizen/git.py 95.55% <ø> (+0.04%) ⬆️
commitizen/__version__.py 100.00% <100.00%> (ø)
commitizen/commands/check.py 100.00% <100.00%> (ø)
commitizen/cz/base.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 750213c...65ae829. Read the comment docs.

@woile woile requested a review from Lee-W August 30, 2020 19:58
Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HI @jordanSu Thanks for contributing! I have one small suggestion for your pull request.

assert all([msg in str(excinfo.value) for msg in ill_formated_commits_msgs])


@pytest.mark.parametrize("args", [{"message": "fix(scope): some commit message"}])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need parametrize here unless we add more test input.

success_mock.assert_called_once()


@pytest.mark.parametrize("args", [{"message": "bad commit"}])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Member

@Lee-W Lee-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the update!

@Lee-W Lee-W merged commit 01520eb into commitizen-tools:master Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants