Skip to content

Conversation

@dweindl
Copy link
Member

@dweindl dweindl commented Jul 2, 2025

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.

Prettify linter output in case of schema violations in the problem yaml file.
Previously, the messages were rather confusing.
@dweindl dweindl self-assigned this Jul 2, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jul 2, 2025

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.

Project coverage is 73.80%. Comparing base (ef79523) to head (8cc793d).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
petab/petablint.py 0.00% 9 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dweindl dweindl marked this pull request as ready for review July 2, 2025 13:13
@dweindl dweindl requested a review from a team as a code owner July 2, 2025 13:13
Copy link
Member

@dilpath dilpath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines 165 to 168
path = list(e.absolute_path)
path = (
path[0] + "".join(f"[{str(p)}]" for p in path[1:]) + ": "
)
Copy link
Member

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.

Suggested change
path = list(e.absolute_path)
path = (
path[0] + "".join(f"[{str(p)}]" for p in path[1:]) + ": "
)
path = "/".join(map(str, e.absolute_path)) + ": "

Copy link
Member Author

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.

Comment on lines 169 to 170
else:
path = ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or path = "" before if

Comment on lines 172 to 173
"Provided YAML file does not adhere to PEtab schema: "
f"{path}{e.args[0]}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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]}"

@dweindl dweindl merged commit c6d4cab into PEtab-dev:develop Jul 3, 2025
7 checks passed
@dweindl dweindl deleted the lint_jsonschema_errors branch July 3, 2025 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants