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

Linter Idea: Check For Hard Coded Text #56

Open
jaimerson opened this issue May 19, 2017 · 2 comments
Open

Linter Idea: Check For Hard Coded Text #56

jaimerson opened this issue May 19, 2017 · 2 comments

Comments

@jaimerson
Copy link

I need to implement a linter that checks if there is any hard coded text (instead of i18n translations or method calls in general) for a project. So I wondered whether this project is a good place for this linter to live.

Here are some examples:

.foo
  | This is bad

.foo
  = t('.this_is_good')

.foo
  = this_is_also_ok(42)
@sds
Copy link
Owner

sds commented May 24, 2017

Hey @jaimerson,

This is doable with Slim-Lint, but I think you will find edge cases where static text is indeed what you want, which will lead you to do something silly like = 'My text'.

Open to a pull request that adds a linter checking this, but we'd have it disabled by default. Thanks!

@jaimerson
Copy link
Author

jaimerson commented May 24, 2017

@sds Yeah, sure. There will be also some cases where it's impossible to detect whether static text is being used, like = link_to 'Untranslated text here' ..., but I think detecting the type I mentioned is a good start.

Thanks for the response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants