Skip to content

Improve EOF error messages on schema validation#35

Open
ehennestad wants to merge 2 commits intomainfrom
codex-improve-eof-error-messages
Open

Improve EOF error messages on schema validation#35
ehennestad wants to merge 2 commits intomainfrom
codex-improve-eof-error-messages

Conversation

@ehennestad
Copy link
Copy Markdown
Contributor

What changed

Improved the end-of-file validation messages in openMINDS_validation/utils.py by:

  • short file check so files under 2 bytes fail with a more accurate message
  • added a clearer message for files that do not end with a closing } followed by a single newline

Why

The previous EOF check could report misleading errors for some invalid file endings. For example, when validating a file with 2 newline characters at the end of the file, the error would state: No newline at end of file

Impact

Schema validation failures caused by invalid file endings should now be easier to understand and fix.

Validation

  • parsed openMINDS_validation/utils.py successfully with ast.parse
  • did not run the full validator flow

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.

1 participant