- 
                Notifications
    
You must be signed in to change notification settings  - Fork 7
 
Prettify linter output #401
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
Prettify linter output in case of schema violations in the problem yaml file. Previously, the messages were rather confusing.
          Codecov ReportAttention: Patch coverage is  
 
 Additional details and impacted files@@             Coverage Diff             @@
##           develop     #401      +/-   ##
===========================================
- Coverage    73.97%   73.80%   -0.18%     
===========================================
  Files           58       58              
  Lines         6489     6504      +15     
  Branches      1120     1122       +2     
===========================================
  Hits          4800     4800              
- Misses        1264     1279      +15     
  Partials       425      425              ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
  | 
    
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.
👍
| path = list(e.absolute_path) | ||
| path = ( | ||
| path[0] + "".join(f"[{str(p)}]" for p in path[1:]) + ": " | ||
| ) | 
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.
Is path[0] always a string, even if there is a validation error?
This would be enough for me, but fine as is.
| path = list(e.absolute_path) | |
| path = ( | |
| path[0] + "".join(f"[{str(p)}]" for p in path[1:]) + ": " | |
| ) | |
| path = "/".join(map(str, e.absolute_path)) + ": " | 
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.
Is
path[0]always a string, even if there is a validation error?
Hm, if the yaml file is really completely off, it may not be. Will add `str'.
Regarding paths, I prefer the [] notation, which feels more natural to me in the dict/yaml context.
        
          
                petab/petablint.py
              
                Outdated
          
        
      | else: | ||
| path = "" | 
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.
or path = "" before if
        
          
                petab/petablint.py
              
                Outdated
          
        
      | "Provided YAML file does not adhere to PEtab schema: " | ||
| f"{path}{e.args[0]}" | 
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.
| "Provided YAML file does not adhere to PEtab schema: " | |
| f"{path}{e.args[0]}" | |
| "Provided YAML file does not adhere to PEtab schema. At " | |
| f"{path}{e.args[0]}" | 
Prettify linter output in case of schema violations in the problem yaml file. Previously, the messages were rather confusing.
Also fix an error message and a bug in the default schema choice.
Related to #369.