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

Make validator messages language-independent and get rid of i18n #103

Open
vergeev opened this issue Apr 10, 2018 · 0 comments
Open

Make validator messages language-independent and get rid of i18n #103

vergeev opened this issue Apr 10, 2018 · 0 comments

Comments

@vergeev
Copy link
Contributor

vergeev commented Apr 10, 2018

I propose making validator error messages serve one purpose: indicating where the problem is. In other words, they should contain file and variable names, line numbers, error counts, but should not contain explicit error descriptions.

More explicit error descriptions belong to the documentation and, when needed, can be restored from the error slug by the client.

So for example the message "%s class is too broad; use a more specific exception type" can be restored by the client himself by looking at the error slug.

And messages like "for example, line number %s should be replaced by language-independent constructions like "filename:line_number".

So the output

    >>> from fiasko_bro import validate
    >>> validate('/path/to/folder/')
    [('camel_case_vars', 'for example, rename the following: WorkBook'), ('file_too_long', 'coursera.py')]

will turn into

    >>> from fiasko_bro import validate
    >>> validate('/path/to/folder/')
    [('camel_case_vars', 'WorkBook'), ('file_too_long', 'coursera.py')]
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

No branches or pull requests

1 participant