fix(ci): error messages are displayed as warnings
Description
The commit 0ef40506 refactored sheldon's printing system, log levels are now represented as an enumeration. However, LogLevel.WARNING and LogLevel.ERROR are both assigned the value of 3, which means that when calling _sheldon_print
with LogLevel.ERROR (typically via common.error
), it will be displayed as a warning (that is, it will look like * [Warning] some text *
instead of *** [ERROR] some text ***
). Since error messages are associated with situations which will make sheldon fails, it's harder to diagnose why sheldon failed when there is a lot of messages. I'm not sure whether it's a regression or not, but if it isn't, I wouldn't see the rationale behind this change.
Steps to reproduce
- Do anything which could cause an sheldon fail, for example, call it with a wrong uncrustify path, eg
sheldon --with-uncrustify=crustify
- sheldon will complain because it can't launch uncrustify, this is an error and should be displayed as
*** [ERROR] Failed to launch uncrustify. ***
but is actually instead displayed as* [Warning] Failed to launch uncrustify. *
.
- sheldon will complain because it can't launch uncrustify, this is an error and should be displayed as
Proposal
Use enum.auto
for the LogLevel enumeration values, to avoid any typos of this kind.