-
-
Notifications
You must be signed in to change notification settings - Fork 17
Fix check command #55
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
Fix check command #55
Conversation
…g thrown instead of printing error message Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
…g thrown instead of printing error message Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
|
@vsoch this is the right PR. What do you think? |
Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
| valid = validate_config(f) | ||
| if valid and not args.preview: | ||
| bot.info("%s is valid." % f) | ||
| elif result: |
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.
Same question as before! What about the case when it's valid and a preview and the error says mistakenly "X is not valid?"
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.
Oops 😅 good catch. On further reflection, there is no reason why args.preview should be part of that if stmt, right?
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.
In my head, preview is only about whether we should print the deep-merged config file.
If the attempt of using it here was to make it behave like a "quiet mode" check (for scripting purposes) then the previous impl needs a different tweak as the exception thrown would not let that happen as it is, right?
Update: I found the rationale around that: #48 (comment)
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.
I updated the logic now. My brain stops working after 22ish..so if I missed anything, let me know :)
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.
haha no worries! I'm at 2am over here I really need to stop programming... 😆 ... can't... !
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.
Wow! I hope I'm not the one disturbing your sleeping pattern... this PR can wait for sure 😅
Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
|
I think this looks good! If tests are passing and you can confirm you are happy with the behavior locally, I can merge. |
|
Last local test: wrong && wrong + preview (which should have the same behavior): right: right + --preview: Seems to be in order 👍🏼 |
fix singularity check command. If validation failed then an exception was being thrown instead of printing error message
Now it's working as expected:
Sorry about the previous PR, I had switched to another branch I'm working on and got confused...