Skip to content
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

Use Cli.Validate.regexWithMessage when validating module name #576

Merged
merged 2 commits into from
Dec 19, 2021

Conversation

ZeldaIV
Copy link
Contributor

@ZeldaIV ZeldaIV commented Dec 7, 2021

Display validation message with an additional "I expected this to be" so the output becomes:

Validation errors:

Invalid `--scalar-codecs` option.
I expected this to be matching "^[A-Z][A-Za-z_]*(\.[A-Z][A-Za-z_]*)*$", but got 'src/CustomScalarCodecs'

Display validation message with an additional "I expected this to be" so the output becomes:

´´´
Validation errors:

Invalid `--scalar-codecs` option.
I expected this to be matching "^[A-Z][A-Za-z_]*(\.[A-Z][A-Za-z_]*)*$", but got 'src/CustomScalarCodecs'
´´´
@dillonkearns
Copy link
Owner

Hello @ZeldaIV, thanks so much for the PRs! I made a suggestion to tweak the message a little, what do you think? I was thinking mentioning that it's expecting an "Elm module name" explicitly could give a clearer hint of what that Regex means. If you agree, you can accept the suggestion and it will commit it. Thank you!

Co-authored-by: Dillon Kearns <dillon@incrementalelm.com>
@ZeldaIV
Copy link
Contributor Author

ZeldaIV commented Dec 19, 2021

Sure, nice to be of assistance. I accepted your suggestion.

@ZeldaIV ZeldaIV closed this Dec 19, 2021
@ZeldaIV ZeldaIV reopened this Dec 19, 2021
@dillonkearns dillonkearns merged commit 2c8fa32 into dillonkearns:master Dec 19, 2021
@dillonkearns
Copy link
Owner

This is now live in version 4.2.3 of the NPM package 👍

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.

2 participants