Doesn't work without one or multiple restarts
See original GitHub issueI know there have been timing issues which prevented SublimeLinter from running with correct environment variables and paths every now and then. I thought this was fixed for good with a recent Sublime Text update and a new API callback. But for a few weeks I have the following problem:
Most times linting doesn’t work for me without restarts. I get (erred)
in the status bar at the bottom for rubocop and reek. Usually I restart Sublime once or twice and it works the way one would expect.
Since this happens for both rubocop and reek the issue doesn’t seem to be linter specific.
Here are 2 logs, the first one shows the error occuring, the other one shows how everything works after a restart of Sublime.
Log 1 👎:
SublimeLinter: log_handler.py:74: Logging installed; log level INFO
SublimeLinter: sublime_linter.py:50: debug mode: on
SublimeLinter: sublime_linter.py:51: version: 4.7.2
SublimeLinter: sublime_linter.py:250: Delay buffer 26 for 0.0s
SublimeLinter: linter.py:887: Checking lint mode background vs lint reason on_load
SublimeLinter: linter.py:887: Checking lint mode background vs lint reason on_load
SublimeLinter: #1 linter.py:907: 'reek' is linting 'shop_gallery_controller.rb'
SublimeLinter: #1 util.py:142: PATH:
/usr/bin
/bin
/usr/sbin
/sbin
SublimeLinter: #2 linter.py:907: 'rubocop' is linting 'shop_gallery_controller.rb'
SublimeLinter: #1 linter.py:1197: Automatically appending the filename to cmd has been deprecated. Use $file, $temp_file or $file_on_disk instead.
SublimeLinter: #2 linter.py:1263: Running ...
/Users/Enno/Sites/pictrs/master/pictrs (working dir)
$ cat app/controllers/shop_gallery_controller.rb | /usr/bin/ruby -S rubocop --format emacs --force-exclusion --stdin /Users/Enno/Sites/pictrs/master/pictrs/app/controllers/shop_gallery_controller.rb
SublimeLinter: #1 linter.py:1263: Running ...
/Users/Enno/Sites/pictrs/master/pictrs (working dir)
$ /usr/bin/ruby -S reek /var/folders/l2/j37t2cjs5ssgcgsrk1xyt1x40000gn/T/tmp3tvsad.rb
SublimeLinter: #2 linter.py:589: WARNING: rubocop output:
/usr/bin/ruby: No such file or directory -- rubocop (LoadError)
SublimeLinter: #2 linter.py:591: Note: above warning will become an error in the future. Implement `on_stderr` if you think this is wrong.
SublimeLinter: #1 linter.py:589: WARNING: reek output:
/usr/bin/ruby: No such file or directory -- reek (LoadError)
SublimeLinter: #1 linter.py:591: Note: above warning will become an error in the future. Implement `on_stderr` if you think this is wrong.
SublimeLinter: sublime_linter.py:444: Linting buffer 26 took 0.08s
Emmet: No need to update PyV8
Package Control: Skipping automatic upgrade, last run at 2018-08-14 10:27:54, next run at 2018-08-14 11:27:54 or after
Log 2 👍:
SublimeLinter: log_handler.py:74: Logging installed; log level INFO
SublimeLinter: sublime_linter.py:50: debug mode: on
SublimeLinter: sublime_linter.py:51: version: 4.7.2
Load settings: Open-Include
SublimeLinter: sublime_linter.py:250: Delay buffer 26 for 0.0s
SublimeLinter: linter.py:887: Checking lint mode background vs lint reason on_load
SublimeLinter: linter.py:887: Checking lint mode background vs lint reason on_load
SublimeLinter: #1 linter.py:907: 'reek' is linting 'shop_gallery_controller.rb'
SublimeLinter: #1 util.py:142: PATH:
/Users/Enno/.rvm/gems/ruby-2.2.4/bin
/Users/Enno/.rvm/gems/ruby-2.2.4@global/bin
/Users/Enno/.rvm/rubies/ruby-2.2.4/bin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Applications/VMware Fusion.app/Contents/Public
/Users/Enno/.rvm/bin
SublimeLinter: #2 linter.py:907: 'rubocop' is linting 'shop_gallery_controller.rb'
SublimeLinter: #1 linter.py:1197: Automatically appending the filename to cmd has been deprecated. Use $file, $temp_file or $file_on_disk instead.
SublimeLinter: #2 linter.py:1263: Running ...
/Users/Enno/Sites/pictrs/master/pictrs (working dir)
$ cat app/controllers/shop_gallery_controller.rb | /Users/Enno/.rvm/bin/rvm-auto-ruby -S rubocop --format emacs --force-exclusion --stdin /Users/Enno/Sites/pictrs/master/pictrs/app/controllers/shop_gallery_controller.rb
SublimeLinter: #1 linter.py:1263: Running ...
/Users/Enno/Sites/pictrs/master/pictrs (working dir)
$ /Users/Enno/.rvm/bin/rvm-auto-ruby -S reek /var/folders/l2/j37t2cjs5ssgcgsrk1xyt1x40000gn/T/tmp7n9l9s.rb
Emmet: No need to update PyV8
Package Control: Skipping automatic upgrade, last run at 2018-08-14 10:27:54, next run at 2018-08-14 11:27:54 or after
SublimeLinter: #2 linter.py:955: rubocop output:
/Users/Enno/Sites/pictrs/master/pictrs/app/controllers/shop_gallery_controller.rb:1:1: C: Unnecessary utf-8 encoding comment.
...
...
...
/Users/Enno/Sites/pictrs/master/pictrs/app/controllers/shop_gallery_controller.rb:2115:11: C: Avoid more than 3 levels of block nesting.
SublimeLinter: #1 linter.py:955: reek output:
/var/folders/l2/j37t2cjs5ssgcgsrk1xyt1x40000gn/T/tmp7n9l9s.rb -- 20 warnings:
[1372, 1372, 1374, 1376]:DuplicateMethodCall: ShopGalleryController#_add_pw_to_session calls 'album.shop' 4 times [https://github.com/troessner/reek/blob/master/docs/Duplicate-Method-Call.md]
...
...
...
[1253]:TooManyStatements: ShopGalleryController#redaktion_register has approx 14 statements [https://github.com/troessner/reek/blob/master/docs/Too-Many-Statements.md]
SublimeLinter: #1 linter.py:995: reek: No match for line: '/var/folders/l2/j37t2cjs5ssgcgsrk1xyt1x40000gn/T/tmp7n9l9s.rb -- 20 warnings:'
SublimeLinter: sublime_linter.py:444: Linting buffer 26 took 7.00s
System information:
- OSX 10.12.6
- Sublime Text 3.1.1 Build 3176
- SublimeLinter v4.7.2
I’m happy to assist if you need more information.
Issue Analytics
- State:
- Created 5 years ago
- Comments:16 (10 by maintainers)
Thx for your response. I thought I read a comment from Sublime’s creator adding some callback and everyone wildly celebrating that and referencing the corresponding issue. Dream or memory? 🤔 Never mind.
You’re correct, I’m using rvm. The current situation sucks but at least we have a fix, so thank you.
I don’t know if this is expected but:
rvm-auto-ruby
, no matter what linter. So my config looks like this right now (exactly the same for all linters):Is that the way it’s intended? Or did I stumble upon another wird behavior?
This seems to work on every start now: