Comments (32)
Hi @jaresty I'll look into it,
Can you provide a gist of an example file to lint?
And the output of:
$ rubocop --version
$ ruby --version
I have ruby 2.0.0p451
installed with rvm
and gem rubocop v0.22.0
and no issues.
from linter.
It happens with any ruby file at all. I'm not sure if it's a
linter-rubocop issue or a linter issue.
Thanks,
Josh
2014年5月26日月曜日、Maxime [email protected]さんは書きました:
Hi @jaresty https://github.com/jaresty I'll look into it,
Can you provide a gist of an example file to lint?Thank's
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/57#issuecomment-44177051
.
Best,
Josh Aresty
Web Developer
The MathWorks
from linter.
@jaresty I edited my message, as you answered by mail you didn't noticed it.
It seems more an issue with your installation of rubocop
can you give me your ruby --version
and rubocop --version
.
Also can you try to lint a file with the command line directly in shell with: $ rubocop path/to/file.rb
and give me the result.
from linter.
% rubocop --version
0.21.0
% ruby --version
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
/Users/jaresty/.rvm/gems/ruby-2.1.2/bin/rubocop --format emacs /var/folders/2_/7s_9bc4s5q586np5tmjh3tn80000gr/T/114421-34216-1eagftfsource.ruby
No such file or directory @ rb_sysopen - /var/folders/2_/7s_9bc4s5q586np5tmjh3tn80000gr/T/114421-34216-1eagftfsource.ruby
/Users/jaresty/.rvm/gems/ruby-2.1.2/gems/rubocop-0.21.0/lib/rubocop/source_parser.rb:10:in `read'
/Users/jaresty/.rvm/gems/ruby-2.1.2/gems/rubocop-0.21.0/lib/rubocop/source_parser.rb:10:in `parse_file'
/Users/jaresty/.rvm/gems/ruby-2.1.2/gems/rubocop-0.21.0/lib/rubocop/file_inspector.rb:86:in `process_source'
/Users/jaresty/.rvm/gems/ruby-2.1.2/gems/rubocop-0.21.0/lib/rubocop/file_inspector.rb:52:in `process_file'
/Users/jaresty/.rvm/gems/ruby-2.1.2/gems/rubocop-0.21.0/lib/rubocop/file_inspector.rb:23:in `block in process_files'
/Users/jaresty/.rvm/gems/ruby-2.1.2/gems/rubocop-0.21.0/lib/rubocop/file_inspector.rb:21:in `each'
/Users/jaresty/.rvm/gems/ruby-2.1.2/gems/rubocop-0.21.0/lib/rubocop/file_inspector.rb:21:in `process_files'
/Users/jaresty/.rvm/gems/ruby-2.1.2/gems/rubocop-0.21.0/lib/rubocop/cli.rb:31:in `run'
/Users/jaresty/.rvm/gems/ruby-2.1.2/gems/rubocop-0.21.0/bin/rubocop:14:in `block in <top (required)>'
/Users/jaresty/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
/Users/jaresty/.rvm/gems/ruby-2.1.2/gems/rubocop-0.21.0/bin/rubocop:13:in `<top (required)>'
/Users/jaresty/.rvm/gems/ruby-2.1.2/bin/rubocop:23:in `load'
/Users/jaresty/.rvm/gems/ruby-2.1.2/bin/rubocop:23:in `<main>'
/Users/jaresty/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
/Users/jaresty/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'
% /Users/jaresty/.rvm/gems/ruby-2.1.2/bin/rubocop --format emacs ~/Desktop/roley-poley/player.rb
/Users/jaresty/Desktop/roley-poley/player.rb:1:80: C: Line is too long. [85/79]
/Users/jaresty/Desktop/roley-poley/player.rb:3:80: C: Line is too long. [123/79]
/Users/jaresty/Desktop/roley-poley/player.rb:5:1: C: Missing top-level class documentation comment.
/Users/jaresty/Desktop/roley-poley/player.rb:12:3: C: Use `attr_reader` to define trivial reader methods.
/Users/jaresty/Desktop/roley-poley/player.rb:17:1: C: Missing top-level module documentation comment.
/Users/jaresty/Desktop/roley-poley/player.rb:23:1: C: Missing top-level class documentation comment.
/Users/jaresty/Desktop/roley-poley/player.rb:33:5: C: Use self-assignment shorthand `+=`.
/Users/jaresty/Desktop/roley-poley/player.rb:37:1: C: Missing top-level class documentation comment.
/Users/jaresty/Desktop/roley-poley/player.rb:38:3: C: Missing top-level class documentation comment.
/Users/jaresty/Desktop/roley-poley/player.rb:40:31: W: Ambiguous negative number operator. Parenthesize the method arguments if it's surely a negative number operator, or add a whitespace to the right of the `-` if it should be a subtraction.
/Users/jaresty/Desktop/roley-poley/player.rb:44:3: C: Missing top-level class documentation comment.
/Users/jaresty/Desktop/roley-poley/player.rb:62:4: C: Prefer `$PROGRAM_NAME` over `$0`.
/Users/jaresty/Desktop/roley-poley/player.rb:67:80: C: Line is too long. [102/79]
/Users/jaresty/Desktop/roley-poley/player.rb:72:80: C: Line is too long. [101/79]
I'm seeing some new errors in the console:
editorView.editor.getGrammar().scopeNametext.plain.null-grammar init.coffee:44
linter: run commands linter-view.coffee:109
linter: lintOnModified linter-view.coffee:104
linter: run commands linter-view.coffee:109
Failed to load resource: the server responded with a status of 404 (Not Found) https://api.travis-ci.org/MatthewMueller/cheerio.svg?branch=master
Failed to load resource: the server responded with a status of 404 (Not Found) https://api.travis-ci.org/MatthewMueller/cheerio.png?branch=master
linter: grammar changed init.coffee:34
linter: run commands linter-view.coffee:109
linter: run linter command linter.coffee:77
/Users/jaresty/.rvm/gems/ruby-2.1.2/bin/rubocop --format emacs /var/folders/2_/7s_9bc4s5q586np5tmjh3tn80000gr/T/114426-47784-10jbyahsource.ruby linter.coffee:78
/Users/jaresty/Desktop/roley-poley linter.coffee:79
env: ruby_executable_hooks: No such file or directory
from linter.
First try to update rubocop
version 0.22.0
is out now.
I'm looking into it.
from linter.
Did you install ruby with rvm? I will update rubocop as soon as I get back
home (I'm out for the day now)
2014年5月26日月曜日、Maxime [email protected]さんは書きました:
First try to update rubocop it's on version 0.22.0
I'm looking into it.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/57#issuecomment-44192135
.
Best,
Josh Aresty
Web Developer
The MathWorks
from linter.
Yes, installed with rvm too ;)
btw co-workers are telling me that https://github.com/sstephenson/rbenv is better now than RVM (fyi)
Can I have an example file with his extension which fails? Into a gist.
from linter.
It's looking for /var/folders/2_/7s_9bc4s5q586np5tmjh3tn80000gr/T/114421-34216-1eagftfsource.ruby
which doesn't seems to exists. And the extension of the file is kinda weird.
from linter.
Right: I don't know where that file name is coming from; I assumed it was
something internal to atom or the linter plugin.
2014年5月26日月曜日、Maxime [email protected]さんは書きました:
It's looking for
/var/folders/2_/7s_9bc4s5q586np5tmjh3tn80000gr/T/114421-34216-1eagftfsource.rubywhich doesn't seems to exists. And the extension of the file is kinda weird.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/57#issuecomment-44192773
.
Best,
Josh Aresty
Web Developer
The MathWorks
from linter.
@jaresty Yep, it's intern to Linter plugin. To lint on modify, we copy the text buffer into a temporary file which will be used by the specific linter.
Normally it should add the correct extension to the file, so something is going wrong. When you have time, give me a not working example file ;)
from linter.
Could you send me an example file that works for you too?
2014年5月26日月曜日、Maxime [email protected]さんは書きました:
@jaresty https://github.com/jaresty Yep, it's intern to Linter plugin.
To lint on modify, we copy the text buffer into a temporary file which will
be used by the specific linter.Normally it should add the correct extension to the file, so something is
going wrong. When you have time, give me a not working exemple file ;)—
Reply to this email directly or view it on GitHubhttps://github.com//issues/57#issuecomment-44193288
.
Best,
Josh Aresty
Web Developer
The MathWorks
from linter.
This file is named player.rb
, and produces the error when loaded into the linter. It happens actually with any .rb file I try to use.
# Different take on delegation--always have an identified original message recipient.
#
# Inspired by: http://www.saturnflyer.com/blog/jim/2012/07/06/the-gang-of-four-is-wrong-and-you-dont-understand-delegation/
class Role
def initialize(delegate)
@delegate = delegate
end
private
def delegate
@delegate
end
end
module ActsAs
def as(role_class)
role_class.new self
end
end
class Account
include ActsAs
attr_reader :balance
def initialize(balance)
@balance = balance
end
def update_balance(amount)
@balance = @balance + amount
end
end
class TransferMoney
class Source < Role
def withdraw(amount)
delegate.update_balance -amount
end
end
class Destination < Role
def deposit(amount)
delegate.update_balance amount
end
end
def initialize(amount, source, destination)
@amount = amount
@source = source.as Source
@destination = destination.as Destination
end
def run
@source.withdraw @amount
@destination.deposit @amount
end
end
if $0 == __FILE__
savings = Account.new 300
checking = Account.new 100
puts "Before transfer, savings contains $#{savings.balance}, checking contains $#{checking.balance}"
transfer = TransferMoney.new 100, savings, checking
transfer.run
puts "After transfer, savings contains $#{savings.balance}, checking contains $#{checking.balance}"
end
from linter.
Hi @jaresty I add so much work this week, gonna look more into it today. But I have problem to reproduce :/
With your file, on OSX 10.9.3, ruby 2.0.0p451, rubocop 0.22.0 I have no errors:
from linter.
Would it help if I could show you? I can screen share with google plus I
think.
2014年5月30日金曜日、Maxime [email protected]さんは書きました:
Hi @jaresty https://github.com/jaresty I add so much work this week,
gonna look more into it today. But I have problem to reproduce :/—
Reply to this email directly or view it on GitHub
#57 (comment).
Best,
Josh Aresty
Web Developer
The MathWorks
from linter.
@jaresty Okey It seems to doesn't find the temporary file created from the buffer, on what OSX version are you working? They may be an issue while creating the temp file.
from linter.
I'm on Mavericks (10.9), but this happened on my work machine running 10.8
too.
Best,
Josh Aresty
Web Developer
The MathWorks
On Fri, May 30, 2014 at 10:31 AM, Maxime Tyler [email protected]
wrote:
@jaresty https://github.com/jaresty Okey It seems to doesn't find the
temporary file created from the buffer, on what OSX version are you
working? They may be an issue while creating the temp file.—
Reply to this email directly or view it on GitHub
#57 (comment).
from linter.
Are other linters working? Like the jshint
or coffeelint
?
from linter.
jshint doesn't seem to throw errors, but I don't see any visible linting
feedback so I'm not sure if it's really working.
Best,
Josh Aresty
Web Developer
The MathWorks
On Fri, May 30, 2014 at 10:35 AM, Maxime Tyler [email protected]
wrote:
Are other linters working? Like the jshint or coffeelint ?
—
Reply to this email directly or view it on GitHub
#57 (comment).
from linter.
@jaresty Looks like you are the only one who can debug this! Can you check if the https://www.npmjs.org/package/temp package works on your system? Sounds like it doesn't create the file from the editor buffer.
I can help you with this if you don't have any experience into node and javascript.
from linter.
What command should I run to test the package?
2014年5月30日金曜日、Maxime [email protected]さんは書きました:
@jaresty https://github.com/jaresty Looks like you are the only one who
can debug this! Can you check if the https://www.npmjs.org/package/temp
package works on your system? Sounds like it doesn't create the file from
the editor buffer.I can help you with this if you don't have any experience into node and
javascript.—
Reply to this email directly or view it on GitHub
#57 (comment).
Best,
Josh Aresty
Web Developer
The MathWorks
from linter.
@jaresty You should try to create a little nodejs script using the module. Creating a temporary file and see if it's working on your system. I'm not sure how to help you.
If someone has an idea? @park9140 @hd-deman
from linter.
Is there some sample code I could look to to get a specific example? Where
in the package is the tempfile code used? It would help if I could make my
example as close to the package's usage as possible.
Thanks,
Josh
Best,
Josh Aresty
Web Developer
The MathWorks
On Mon, Jun 2, 2014 at 9:34 AM, Maxime Tyler [email protected]
wrote:
@jaresty https://github.com/jaresty You should try to create a little
nodejs script using the module. Creating a temporary file and see if it's
working on your system. I'm not sure how to help you.If someone has an idea? @park9140 https://github.com/park9140 @hd-deman
https://github.com/hd-deman—
Reply to this email directly or view it on GitHub
#57 (comment).
from linter.
I used the example I found on the module website, copied and pasted into
the console in atom, and didn't get any errors:
// Fake data
var myData = "foo\nbar\nfoo\nbaz";
// Process the data (note: error handling omitted)
temp.open('myprefix', function(err, info) {
if (!err) {
fs.write(info.fd, myData);
fs.close(info.fd, function(err) {
exec("grep foo '" + info.path + "' | wc -l", function(err, stdout) {
console.log(stdout.trim());
});
});
}
});
undefined
2
Best,
Josh Aresty
Web Developer
The MathWorks
On Mon, Jun 2, 2014 at 11:15 AM, Josh Aresty [email protected] wrote:
Is there some sample code I could look to to get a specific example?
Where in the package is the tempfile code used? It would help if I could
make my example as close to the package's usage as possible.Thanks,
Josh
Best,
Josh Aresty
Web Developer
The MathWorksOn Mon, Jun 2, 2014 at 9:34 AM, Maxime Tyler [email protected]
wrote:@jaresty https://github.com/jaresty You should try to create a little
nodejs script using the module. Creating a temporary file and see if it's
working on your system. I'm not sure how to help you.If someone has an idea? @park9140 https://github.com/park9140 @hd-deman
https://github.com/hd-deman—
Reply to this email directly or view it on GitHub
#57 (comment).
from linter.
Write this in something.js
var temp = require('temp');
temp.track();
// Fake data
var myData = "foo\nbar\nfoo\nbaz";
// Process the data (note: error handling omitted)
temp.open('myprefix', function(err, info) {
if (!err) {
fs.write(info.fd, myData);
fs.close(info.fd, function(err) {
exec("grep foo '" + info.path + "' | wc -l", function(err, stdout) {
console.log(stdout.trim());
});
});
}
});
And then run in your shell: $ node something.js
You need to install the module temp by running: $ npm install -g temp
from linter.
When I run this code, the result is "2". It works on my system.
Best,
Josh Aresty
Web Developer
The MathWorks
On Mon, Jun 2, 2014 at 11:45 AM, Maxime Tyler [email protected]
wrote:
Write this in something.js
var temp = require('temp');
temp.track();// Fake data
var myData = "foo\nbar\nfoo\nbaz";// Process the data (note: error handling omitted)
temp.open('myprefix', function(err, info) {
if (!err) {
fs.write(info.fd, myData);
fs.close(info.fd, function(err) {
exec("grep foo '" + info.path + "' | wc -l", function(err, stdout) {
console.log(stdout.trim());
});
});
}
});And then run in your shell: $ node something.js
You need to install the module temp by running: $ npm install -g temp
—
Reply to this email directly or view it on GitHub
#57 (comment).
from linter.
I think I've figured out the issue:
On a mac when you install rubocop using rvm and try to set up the linter-rubocop package to point to the rvm (not the mac-system) rubocop, that file contains the line #! env ruby_executable_hooks
, which gives a file-not-found error on the mac since your windowed session does not know how to access rvm
.
from linter.
Mind blown
Waaaahou!
from linter.
@jaresty, try installing atom command line aliases and then start atom from the command line. This issue exists in a bunch of the linters in sublime as well and that fixes the issue there.
The underlying problem being that certain package managers like nodenv, rbenv, rvm... only install their path in the bash profile, and in osx this file does not get added to the standard application context.
I would suggest that we do an interactive process for discovering a linter location. Each linter could provide guesses for the linter install location, and failing that the base linter could alert the user to input the base linter location so that they are told when the above issue results in not finding the linter executable requirement.
from linter.
Can't the bash_profile not be loaded into the atom / linter environment? This would solve this issue more automatically and terminal commands would also work in linters.
from linter.
It could, however there are still those among us who do not use bash profile as well. I use fish, and a couple other people around my office use zsh, neither of which use the bash_profile for sourcing path information by default. So even if we pulled the bash profile we would not guarantee access to the correct path data. Though I would love to see atom automatically include the bash profile path info.
from linter.
@park9140 that did it. Good idea-thanks!
from linter.
The specific issue here seems to be resolved. Closing, but see #150 for @johanneswuerbach's suggesting of loading the profile into Atom.
from linter.
Related Issues (20)
- Replacement position does not change when replacement is applied further left
- release span HOT 13
- Atom Linter "highlight error lines in gutter" not showing in settings
- Unable to install 3.3 version of linter on windows
- Feature request: explicitly tell user that by default linter lints on save HOT 1
- linter-csslint:: Error while running CSSLint! HOT 1
- JS private fields error HOT 1
- AtomLinter is showing incorrect errors
- Linter is not honoring "Lint on Change" and "Lint on Change Interval" settings HOT 1
- disabled providers list not respected HOT 7
- Linter is not working HOT 7
- I HATE LINTER!!! NOW I CAN DELETE THIS IN ATOM OR DISABLED??? HOT 3
- Linter dropdown not functioning on some OS X platforms
- Linter timeout using ShellCheck
- Failed to install linter dependencies
- Beep sound on error
- Uncaught ReferenceError: 耽a is not defined
- Getting "Inavlid Point" Error with every linter plugin I try.
- Errors not showing on mac HOT 1
- Problem with Axios >=1.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linter.