-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Adds standardrb to ale #2133
Adds standardrb to ale #2133
Conversation
See: https://github.com/testdouble/standard StandardRB is to RuboCop what StandardJS is to ESLint. This commit naively copies the RuboCop linter and fixer to point at the standardrb executable. Any other adjustments are very minor (the only I can think of is that standardrb takes a `--fix` option instead of `--auto-correct`). This raises a confusing point to me as both developer and a user: since ale enables all linters by default, won't this run both RuboCop and StandardRB (the results of which will almost always be in conflict with one another)? How does ale already solve for this for the similar case of StandardJS and ESLint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good overall, but it needs tests.
With regard to running both rubocop and standard, check your :ALEInfo
to see what is enabled. If both are, rubocop is most likely just in agreement with standard; however, I think it is more likely that you do not have rubocop installed.
Re: testing, I read the developer guide on testing but I'm still too dense to know what you'd expect for a feature like this that invokes the methods in rubocop. Can you point to a similar example? Re: running both, ALEInfo said both were enabled and both were running (per the command log below) but Rubocop was finding zero violations in each project I tested—this made no sense to me because running rubocop from the CLI would find a bunch |
The tests should check the handler (error parser) against real (but hardcoded) output, and test that the command line parameters are built correctly. Check the existing tests (say, eslint or rubocop) for examples. As far as running both and not getting any lints from rubocop, I would need to reproduce it myself to know what is going on. |
Sorry that I'm struggling to add the tests you asked for:
As for having both rubocop and standard installed, it seems to work fine in practice for me, but either way I am going to follow the example of standardjs (which is so closely analogous that it may as well be precedent) and just recommend standardrb users to explicitly specify what tools they want to run, as documented here |
There was a test failure caused I think by an overly aggressive gitignore rule added in April here 7cf3ddf It is ignoring all files that start with a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the tests are pretty good now. See my comment here.
The |
I added a comment to |
In response to feedback from @w0rp here: dense-analysis#2133 (comment)
Thanks! |
Cheers! |
See: https://github.com/testdouble/standard ( standardrb/standard#43 )
StandardRB is to RuboCop what StandardJS is to ESLint. This commit
naively copies the RuboCop linter and fixer to point at the standardrb
executable. Any other adjustments are very minor (the only I can think
of is that standardrb takes a
--fix
option instead of--auto-correct
).This raises a confusing point to me as both developer and a user: since
ale enables all linters by default, won't this run both RuboCop and
StandardRB (the results of which will almost always be in conflict with
one another)? How does ale already solve for this for the similar case
of StandardJS and ESLint?
In practice, it seems to "just work" and only run standard but I'm completely confused as to how, given that both rubocop and standardrb are present in the bundle. If someone could advise me on how this works I'd be happy to adjust things