feat(commit): add retry_after_failure config option and --no-retry flag#1027
feat(commit): add retry_after_failure config option and --no-retry flag#1027Lee-W merged 12 commits intocommitizen-tools:masterfrom crai0:retry-after-failure
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1027 +/- ##
==========================================
+ Coverage 97.33% 97.48% +0.15%
==========================================
Files 42 55 +13
Lines 2104 2429 +325
==========================================
+ Hits 2048 2368 +320
- Misses 56 61 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…root returns None
…e for other retry test cases
noirbizarre
left a comment
There was a problem hiding this comment.
Great ! Thanks (I was going to take a loook at this, so perfect timing 👌🏼)
commitizen/commands/commit.py
Outdated
| self.temp_file: str = get_backup_file_path() | ||
|
|
||
| def read_backup_message(self) -> str: | ||
| def read_backup_message(self) -> Optional[str]: |
There was a problem hiding this comment.
| def read_backup_message(self) -> Optional[str]: | |
| def read_backup_message(self) -> str | None: |
commitizen/commands/commit.py
Outdated
| import os | ||
| import tempfile | ||
|
|
||
| from typing import Optional |
There was a problem hiding this comment.
| from typing import Optional |
hooks/post-commit.py
Outdated
| print("could not import commitizen:") | ||
| print(error) |
There was a problem hiding this comment.
| print("could not import commitizen:") | |
| print(error) | |
| print(f"could not import commitizen:\n{error}") |
commitizen/cz/utils.py
Outdated
| return os.path.join( | ||
| tempfile.gettempdir(), | ||
| "cz.commit%{user}%{project}.backup".format( | ||
| user=os.environ.get("USER", ""), | ||
| project=project, | ||
| ), | ||
| ) |
There was a problem hiding this comment.
| return os.path.join( | |
| tempfile.gettempdir(), | |
| "cz.commit%{user}%{project}.backup".format( | |
| user=os.environ.get("USER", ""), | |
| project=project, | |
| ), | |
| ) | |
| user = os.environ.get("USER", "") | |
| return os.path.join( | |
| tempfile.gettempdir(), | |
| f"cz.commit%{user}%{project}.backup" | |
| ) |
|
Thanks so much for finishing this feature! I just fixed a few style-related nitpicks. Will merge this one once CI passes. |
|
Closes: #732 |
|
@Lee-W awesome, thanks a lot. |
Description
This pull request resolves #732 by implementing the requested feature.
Checklist
./scripts/formatand./scripts/testlocally to ensure this change passes linter check and testExpected behavior
See #732 (comment).
Steps to Test This Pull Request
retry_after_failureAdditional context