Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: allow files-only to set config version and create changelog #299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Lee-W merged 3 commits into commitizen-tools:master from marcossantiago:write_config_when_filesonly
Nov 15, 2020
Merged

feat: allow files-only to set config version and create changelog #299

Lee-W merged 3 commits into commitizen-tools:master from marcossantiago:write_config_when_filesonly
Nov 15, 2020

Conversation

Copy link
Contributor

@marcossantiago marcossantiago commented Nov 11, 2020
edited
Loading

Description

This PR allows the command bump with the flag --files-only to update the version in the configuration file and to create the changelog if the flag was passed.

The current behavior exits the program before those 2 actions happen.

Checklist

  • NA 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

The version in the configuration file will be updated and the changelog will be created (if flag passed) when using bump --files-only, changing the current behavior.

Steps to Test This Pull Request

  1. run cz bump --files-only --changelog
  2. check if the version was updated file pyproject.toml or .cz.toml.
  3. check if the changelog was actually created.

Additional context

Related issue: #298

Copy link

codecov bot commented Nov 11, 2020
edited
Loading

Codecov Report

Merging #299 (ae174a3) into master (720befe) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@ Coverage Diff @@
## master #299 +/- ##
=======================================
 Coverage 96.96% 96.96% 
=======================================
 Files 33 33 
 Lines 924 924 
=======================================
 Hits 896 896 
 Misses 28 28 
Flag Coverage Δ
unittests 96.96% <100.00%> (ø)

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

Impacted Files Coverage Δ
commitizen/__version__.py 100.00% <100.00%> (ø)
commitizen/commands/bump.py 94.31% <100.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 de44a0a...ae174a3. Read the comment docs.

Copy link
Member

woile commented Nov 11, 2020

First, thanks for contributing, highly appreciated! I think this is a breaking change. I'll take a look tomorrow.

marcossantiago reacted with thumbs up emoji

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.

Thanks for your contribution! It looks good to me. Could you please modify this test case to test this functionality?

Copy link
Contributor Author

@Lee-W done!

Lee-W reacted with thumbs up emoji

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.

Thanks for your contribution! It looks good to me. @woile Could you please check again?

Copy link
Member

woile commented Nov 14, 2020

Hey sorry for taking too long. I'm trying to find the original use case for files-only.
I recall it was to be able to generate the changelog with a different tool before doing the actual bump, there was like a chicken and egg situation, so this feature was introduced.

I hope my lack of memory doesn't break the intention of this feature, but I think this PR can be merged.

Just so my mistake doesn't happen again, I'll ask you to add documentation about this flag: use case and examples 😅

Copy link
Contributor Author

@woile Added a simple explanation for the --files-only. The only use case it makes sense it's to avoid creating the commit and tag, which is how I use it. Let me know if you think we could add more details.

In time, thanks for maintaining this project!

Copy link
Member

Lee-W commented Nov 15, 2020

Let's merge it 🎉

@Lee-W Lee-W merged commit 71f34f7 into commitizen-tools:master Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@Lee-W Lee-W Lee-W approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /