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 the -s|--stdin option unviable for editor integration.
I'm using VS Code with the Ruby extension, and it uses the output to replace the file contents when format-on-save is turned on. Here's the extension that produces the rubocop ... line.
Rubocop detects when it's outputting to stdout and skips SuggestExtensions. Or it prints it before the output delimiter so scripts ignore it.
Actual behavior
The suggested extensions copy gets appended to the file that was formatted by rubocop in my code editor.
Steps to reproduce the problem
Given some gems that produce suggested extensions, e.g. minitest, and a file /path/to/file.rb that contains some ruby code:
moduleRubocopBugEmptyFile;end
This is ok as it's human-usage, not scripted:
$: rubocop /path/to/file.rb
Inspecting 1 file
.
1 file inspected, no offenses detected
Tip: Based on detected gems, the following RuboCop extension libraries might be helpful:
* rubocop-minitest (http://github.com/rubocop-hq/rubocop-minitest)
You can opt out of this message by adding the following to your config (see https://docs.rubocop.org/rubocop/extensions.html#extension-suggestions for more options):
AllCops:
SuggestExtensions: false
This is incorrect as it's meant to be used by scripts for editor integration:
$: rubocop -s '/path/to/file.rb' -a < /path/to/file.rb
Inspecting 1 file
.
1 file inspected, no offenses detected
====================
module Empty; end
Tip: Based on detected gems, the following RuboCop extension libraries might be helpful:
* rubocop-minitest (http://github.com/rubocop-hq/rubocop-minitest)
You can opt out of this message by adding the following to your config (see https://docs.rubocop.org/rubocop/extensions.html#extension-suggestions for more options):
AllCops:
SuggestExtensions: false
$: rubocop -s '/path/to/file.rb' -a < /path/to/file.rb
Inspecting 1 file
.
1 file inspected, no offenses detected
====================
module Empty; end
RuboCop version
Include the output of rubocop -V or bundle exec rubocop -V if using Bundler.
If you see extension cop versions (e.g. rubocop-performance, rubocop-rspec, and others)
output by rubocop -V, include them as well. Here's an example:
Aw wow, that was super quick, thanks so much @dvandersluis!
Could you kindly comment here when it's released, so I get a notification please? Or if you know roughly when it might get released so I can set a reminder? Thanks a bunch!
I'm not sure when the next release is planned for but you can have github notify you about releases specifically in the Watch menu for the repo (under Custom). This will be released in the next release, whenever that ends up being (usually releases happen every 2-4 weeks or so but we don't have a specific schedule).
This makes the
-s|--stdin
option unviable for editor integration.I'm using VS Code with the Ruby extension, and it uses the output to replace the file contents when format-on-save is turned on. Here's the extension that produces the
rubocop ...
line.My VS Code settings for this:
Expected behavior
Rubocop detects when it's outputting to stdout and skips SuggestExtensions. Or it prints it before the output delimiter so scripts ignore it.
Actual behavior
The suggested extensions copy gets appended to the file that was formatted by rubocop in my code editor.
Steps to reproduce the problem
Given some gems that produce suggested extensions, e.g.
minitest
, and a file/path/to/file.rb
that contains some ruby code:This is ok as it's human-usage, not scripted:
This is incorrect as it's meant to be used by scripts for editor integration:
As far as I can tell, based on VS Code's Ruby extension known "output delimiter", I think it should be this:
RuboCop version
Include the output of
rubocop -V
orbundle exec rubocop -V
if using Bundler.If you see extension cop versions (e.g.
rubocop-performance
,rubocop-rspec
, and others)output by
rubocop -V
, include them as well. Here's an example:The text was updated successfully, but these errors were encountered: