Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error messages for invalid version = literal: ... in config #84

Closed
rudyardrichter opened this issue Feb 10, 2023 · 2 comments
Closed

Error messages for invalid version = literal: ... in config #84

rudyardrichter opened this issue Feb 10, 2023 · 2 comments

Comments

@rudyardrichter
Copy link

It's a very minor issue but an invalid version config field causes error messages that (imo) could be more specific/informative. If it would be welcome, I would happily add a PR to have an error suggest the correct format.

Missing variable name

As an example this configuration

version = literal: myproj/__init__.py

produces this error:

ValueError: not enough values to unpack (expected 3, got 2)

File available, but missing variable name

For example this configuration:

version = literal: myproj/__init__.py:

leads to this error:

scriv.exceptions.ScrivException: Couldn't find literal: 'literal: src/template_python/__init__.py:'
nedbat pushed a commit that referenced this issue Feb 18, 2023
nedbat pushed a commit that referenced this issue Feb 18, 2023
@nedbat
Copy link
Owner

nedbat commented Feb 18, 2023

Good idea!

Now (as of commit bf5d9cf) both of these errors will produce: ScrivException: Couldn't read 'version' configuration: Missing value name: 'literal: myproj/__init__.py'. I also added more detail to other kinds of failures reading literals.

@nedbat nedbat closed this as completed Feb 18, 2023
@nedbat
Copy link
Owner

nedbat commented Feb 19, 2023

This is now released as part of scriv 1.2.1.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants