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

use error_code to do "is_signed_tag" check to avoid language issue #543

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
woile merged 1 commit into master from 542
Aug 7, 2022

Conversation

Copy link
Member

@Lee-W Lee-W commented Aug 2, 2022

Description

as title

Checklist

  • Add test cases to all the changes you introduce
  • Run ./scripts/format and ./scripts/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

pass all the test cases even when LC_ALL is set to non-English

Steps to Test This Pull Request

  1. export LC_ALL=zh_TW.UTF-8
  2. ./script/test

Additional context

#542

@Lee-W Lee-W requested a review from woile August 2, 2022 15:36
Copy link

codecov bot commented Aug 2, 2022
edited
Loading

Codecov Report

Merging #543 (ae5a98e) into master (37505ef) will increase coverage by 0.05%.
The diff coverage is 100.00%.

@@ Coverage Diff @@
## master #543 +/- ##
==========================================
+ Coverage 98.26% 98.32% +0.05% 
==========================================
 Files 39 39 
 Lines 1556 1551 -5 
==========================================
- Hits 1529 1525 -4 
+ Misses 27 26 -1 
Flag Coverage Δ
unittests 98.32% <100.00%> (+0.05%) ⬆️

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/git.py 100.00% <100.00%> (ø)
commitizen/changelog.py 100.00% <0.00%> (+0.56%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

woile commented Aug 2, 2022

I wonder if there's a language agnostic way of doing this, instead of forcing english into the equation 🤔

Lee-W reacted with eyes emoji

Copy link
Contributor

bhelgs commented Aug 2, 2022
edited
Loading

@woile

I wonder if there's a language agnostic way of doing this, instead of forcing english into the equation 🤔

  • git tag -a testtag
  • git tag -v testtag || echo $?

The above exit code is 1... so it appears the exit code is 1 for annotated tag and 0 for signed tag.

Copy link
Contributor

bhelgs commented Aug 3, 2022

side note, tmp_commitizen_project_with_gpg is creating a key every time the unit tests run. I wonder if there is a way to make them temporary.

@Lee-W Lee-W mentioned this pull request Aug 3, 2022
4 tasks
Copy link
Member Author

Lee-W commented Aug 3, 2022
edited
Loading

side note, tmp_commitizen_project_with_gpg is creating a key every time the unit tests run. I wonder if there is a way to make them temporary.

Maybe we could use a context manager to remove the created key after running testing?

Copy link
Contributor

gpongelli commented Aug 5, 2022
edited
Loading

@woile

I wonder if there's a language agnostic way of doing this, instead of forcing english into the equation 🤔

* `git tag -a testtag`
* `git tag -v testtag || echo $?`

The above exit code is 1... so it appears the exit code is 1 for annotated tag and 0 for signed tag.

or also link git verify-tag <tagname> (that also print things to stdout) and then echo $? :

  • 0 means signed tag
  • 1 means not signed

Sorry but I did not investigate further when I created that branch.

Copy link
Member Author

Lee-W commented Aug 7, 2022

Thanks @bhelgs and @gpongelli ! Let me update the code with the methods you provided!

bhelgs and gpongelli reacted with thumbs up emoji

Copy link
Member Author

Lee-W commented Aug 7, 2022

@woile I think this one is now ready to be reviewed 🎉

gpongelli reacted with rocket emoji

@Lee-W Lee-W changed the title (削除) set LC_ALL to en_US.UTF-8 before checking signed tag (削除ここまで) (追記) use error_code to do "is_signed_tag" check to avoid language issue (追記ここまで) Aug 7, 2022
Copy link
Contributor

side note, tmp_commitizen_project_with_gpg is creating a key every time the unit tests run. I wonder if there is a way to make them temporary.

Maybe we could use a context manager to remove the created key after running testing?

PR #547 handles this ;-)

Lee-W reacted with thumbs up emoji

@woile woile merged commit 78f3472 into master Aug 7, 2022
@woile woile deleted the 542 branch August 7, 2022 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@woile woile Awaiting requested review from woile woile is a code owner

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

Successfully merging this pull request may close these issues.

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