You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This makes sense to me. We don't have cycles to work on anything, so fire off a PR and add me as a reviewer and I'll help get it in. I should really look over existing PRs too...
It appears the loading custom linters from CLI doesn't work correctly. Following the README instructions is met with:
Taking a dive into this, it appears that options are loaded and validated before the custom linters are loaded.
https://github.com/Shopify/erb-lint/blob/90702271d5811cc9a677c69e2ae4f332ca53d248/lib/erb_lint/cli.rb#L35-L37
Here the args are validated against
known_linter_names
:https://github.com/Shopify/erb-lint/blob/90702271d5811cc9a677c69e2ae4f332ca53d248/lib/erb_lint/cli.rb#L269-L277
known_linter_names
expects that all the linters have already been loaded:https://github.com/Shopify/erb-lint/blob/90702271d5811cc9a677c69e2ae4f332ca53d248/lib/erb_lint/cli.rb#L213-L217
But in the
LinterRegistry
we can see that custom linters are only explicitly loaded whenload_custom_linters
is called:https://github.com/Shopify/erb-lint/blob/90702271d5811cc9a677c69e2ae4f332ca53d248/lib/erb_lint/linter_registry.rb#L20-L23
load_custom_linters
is only called when the Runner is initialised, but that happens some 30 lines after the options have been validated:https://github.com/Shopify/erb-lint/blob/90702271d5811cc9a677c69e2ae4f332ca53d248/lib/erb_lint/cli.rb#L58
Changing the
known_linter_names
to be the following appears to fix the issue:(Note that Custom Linters still don't work at this point as the README is out of date #123)
The text was updated successfully, but these errors were encountered: