vaclavsvejcar / headroom

©️ Manager for license headers in source code files.
https://doc.norcane.com/headroom/latest/
BSD 3-Clause "New" or "Revised" License
48 stars 3 forks source link

Misleading error message when YAML syntax of .headroom.yaml is invalid #87

Closed vaclavsvejcar closed 2 years ago

vaclavsvejcar commented 2 years ago

When loading .headroom.yaml file, first step is to check the version number. In order to do this, that YAML file needs to be parsed. However, if the syntax is invalid, very misleading error message appears instead:

ERROR: Cannot find 'version' key in .headroom.yaml configuration file. This field is required to check whether your current configuration is compatible with installed version of headroom. This functionality has been added in version 0.4.0.0, please see following migration guide for more details on how to proceed: 
    http://doc.norcane.com/headroom/v0.4.0.0/migration-guide

This might be very confusing and it really should be distinguish whether the YAML structure is wrong, or version field is missing. Also in general, headroom should provide better feedback on what's exactly wrong with the YAML file.