-
Notifications
You must be signed in to change notification settings - Fork 1.3k
.werft/build: Cleaning code #8636
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #8636 +/- ##
==========================================
- Coverage 14.87% 11.17% -3.70%
==========================================
Files 52 18 -34
Lines 4963 993 -3970
==========================================
- Hits 738 111 -627
+ Misses 4153 880 -3273
+ Partials 72 2 -70
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A tiny change request, otherwise I agree that the check fits better there
|
||
async function preCommitCheck(werft: Werft) { | ||
werft.log("pre-commit checks", "Running pre-commit hooks.") | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you're re-throwing the error I would suggest removing the try/catch logic here all-together
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah nice catch...
I think we could follow this pattern on other areas too:
- One public function that is directly called by build.ts
- The public function would call private functions on a try-catch block
- Private functions would throw errors instead of running
werft.fail
Keep built.ts clean by removing branch lenght check from it Add branch length check to validation phase, while making logic clearer with better error handling Signed-off-by: ArthurSens <[email protected]>
Description
Keep built.ts cleaner by removing branch length check from it
Add branch length check to validation phase, as it seems more appropriate, while making logic clearer with better error handling
Release Notes