Skip to content
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

Linters not linting... #112

Closed
MiniFlames opened this issue Jun 26, 2014 · 46 comments

Comments

Projects
None yet
@MiniFlames
Copy link

commented Jun 26, 2014

Just installed linter and a couple of it's plugins [linter-csslint, linter-coffelint, linter-scss-lint and linter-jshint] and well... they're not doing anything... not highlighting of errors, no 'you idiot you've missed off a semicolon', nothing...

no errors in the developer tools console or anything like that, i'm clearly missing something but can't for the life of me figure out what it is...

Running Windows 8.1 x64, atom version 0.107.0-ccb01c2

@localjo

This comment has been minimized.

Copy link

commented Jun 27, 2014

Same issue here on OS X 10.9.3 with Atom 0.106.0.

@allanchang

This comment has been minimized.

Copy link

commented Jun 28, 2014

I've got the same issue, too. On OSX 10.9.3 with Atom 0.106.0

@mhozza

This comment has been minimized.

Copy link

commented Jun 29, 2014

same issue on Ubuntu 14.04, Atom 0.106.0

@iam4x

This comment has been minimized.

Copy link
Contributor

commented Jun 29, 2014

Can you list the linters you installed? If you have a linter-* not ready and installed it won't works. Like linter-{pep257,rst}.

Can you also open the console and tell if any errors? @MiniFlames

@mhozza

This comment has been minimized.

Copy link

commented Jun 29, 2014

I fixed it by uninstalling linter-jsl, which was causing an exception.

@MiniFlames

This comment has been minimized.

Copy link
Author

commented Jun 29, 2014

Intalled Linters

Linter
Linter Coffeelint
Linter Csslint
Linter Jshint
Linter Scss Lint

Nothing immediately appears in the console, but cycle through the console tabs yields this error:

GET file:///C:/Program%20Files/Atom/resources/app/static/c:/Users/Barrie/.atom/packages/linter-scss-lint/lib/init.coffee /C:/Program%20Files/Atom/resources/app/static/c:/Users/Barrie/.atom/packages/linter-scss-lint/lib/init.coffee:1

Disabling the mentioned linter doesn't affect the others, none of them are working...
EDIT: Neither does removing linter-scss-lint completely

Full Console output -

screenshot 9

@iam4x

This comment has been minimized.

Copy link
Contributor

commented Jun 29, 2014

Any guys on OSX can show me a log? Cause I'm not a Windows user, can't explain it @MiniFlames

cc @josiahsprague @allanchang

@localjo

This comment has been minimized.

Copy link

commented Jun 30, 2014

I've got no error logs at all in the console, even with Lint Debug turned on. No evidence at all that the package is doing anything.

screen shot 2014-06-30 at 8 27 18 am

@tom2strobl

This comment has been minimized.

Copy link

commented Jun 30, 2014

Same here on OSX Yosemite dev preview (thought it was a OSX beta thing, but apparently not)

@localjo

This comment has been minimized.

Copy link

commented Jun 30, 2014

Had a little bit of a frustrating situation this morning, wasn't able to save anything in Atom or use a handful of shortcuts such as ⌘+t. Found out it was caused by checking the Lint Debug box even though I had uninstalled AtomLinter. Had to manually remove that from my Atom config files to get Atom working right again. Not really related to this issue, but I thought it was worth mentioning here in case any of you run into the same problem I did while debugging the issue.

@pmuens

This comment has been minimized.

Copy link

commented Jun 30, 2014

Same issue here. 0.106.0. Nothing is linting...

@allanchang

This comment has been minimized.

Copy link

commented Jun 30, 2014

I finally got it working on my Mac and if you're a Windows user, it's pointless to read further:

My setup: OSX 10.9.3 + latest Git/Node/Atom/packages

I wasn't able to get Atom to install packages correctly until I downloaded Github for Mac and installed their command line tools. Also, I started opening Atom thru the terminal instead of simply clicking the desktop icon.

After installing Linter + Linter Jshint, it wasn't working so I went to Terminal and typed "which jshint" and it provided me the path "/usr/local/bin/jshint". In the settings, Linter Jshint asks for an executable path; I entered "/usr/local/bin" (the parent). Since then, Linter Jshint has been working without any problems.

Note: I had already been using Gulp+Jshint on a project so I knew beforehand that Jshint was configured correctly and ran outside of using Atom + Linter.

@ghost

This comment has been minimized.

Copy link

commented Jul 2, 2014

I've also noticed problems on OS X 10.9.3 as well lately @allanchang's suggestions seemed to have helped. After nuking my ~/.atom folder and starting over, I had the same problems again, but ensuring that Github's command line tools were installed through the prefs on the GitHub app seemed to have help.

@localjo

This comment has been minimized.

Copy link

commented Jul 2, 2014

@allanchang's suggestions didn't change anything for me. I've had much better luck with https://github.com/yujinakayama/atom-lint/

@MiniFlames

This comment has been minimized.

Copy link
Author

commented Jul 2, 2014

I know @allanchang's suggestion was mac-specific but i thought i'd give it a go anyway, manually pointed atom at where the respective commands were, %appdata%/npm in windows' case [tried with and without the %appdata% shortcut], and still no joy... the csslint, coffeelint and jshint commands work on their own when typed into command prompt/powershell...

@ebertmi

This comment has been minimized.

Copy link

commented Jul 3, 2014

I've got the same problem. Currently running on Win 7 and Atom Build 0.107.0-a92eed5
No errors are thrown but also no pane or and visual indicators for errors. With lint debug checked I can see the stdout from pep8 and getting errors. However those are not showing up in the UI. Tested on normal editor and on react.

@HasRoie

This comment has been minimized.

Copy link

commented Jul 3, 2014

Same here, installed but not seeing anything.

@oak-tree

This comment has been minimized.

Copy link

commented Jul 9, 2014

same here. this time on the new atom version for windows. running windows 8.1 and atom 0.113.0
it seems that linter for javascript is activated (from console screen). moreover, it seems that i tries to do some validation. by nothing really happened. i'm attaching two screen shots here:

note:
the error mark is only because i click on a temporary link that does not exists

screenshot 2014-07-09 14 01 50
![screenshot 2014-07-09 14 02 33](https://cloud.githubusercontent.com/assets/667153/3523396/96717c04-0758-11e4-8267-2a00b7aa3951.png

EDIT:
long time ago i tried to compile atom by my self. and failed to do so. so i had .atom lib on my computer.
i remove .atom folder and restart atom. reinstall linter and linter-jshint but i get the same error as above

@oak-tree

This comment has been minimized.

Copy link

commented Jul 9, 2014

after some debugging it seems that BufferedNodeProcess is not running the node command
linter.coffee lintFile function (at line 86):
even if i unmark the debug condition the stdout nor the stderr callback are not being called.

edit: . add onexit callback from Process object. this doesn't fire as well

@glek

This comment has been minimized.

Copy link

commented Jul 9, 2014

I'm not sure that's the case. I poked at the Atom source a bit and, by adding some logging to the BufferedProcess, I got this:

output

The process is running normally, it's just not providing any output back.

@allanchang

This comment has been minimized.

Copy link

commented Jul 9, 2014

In fact, I tried to install Atom + Linter + Linter Jshint on another Mac and was unsuccessful. Not sure why it works on one Mac and not the other.

@oak-tree

This comment has been minimized.

Copy link

commented Jul 9, 2014

hey @glek
ok. with your idea of debugging atom directly
BufferedNodeProcess add the exec "node" file to run the node program. and from some reason it set "atom exe" as the node file. as you said this runs but does not return any output.
i changed it (in memory) instead of my atom location to run just "node" and it worked out. so it seems like atom issue on windows and not linter issue

EDIT: if you have path "node" and changed line 16 in BufferedNodeProcess function to be node = "node" linter will run on windows

@andrewburgess

This comment has been minimized.

Copy link

commented Jul 9, 2014

Nice find @oak-tree

Referencing your issue in main Atom repo: atom/atom#2887

@nguyer

This comment has been minimized.

Copy link

commented Jul 10, 2014

I just built Atom from source (0.114.0-db1652f) and none of my linters are linting, running on Ubuntu 14.04. Does anybody have any other workarounds or a fix?

@andrewburgess

This comment has been minimized.

Copy link

commented Jul 10, 2014

@nguyer Can you look at the referenced issue atom/atom#2887 and duplicate what I did here atom/atom#2887 (comment) and see if you have the same issue?

At least on Windows, there seems to be an issue with redirecting console.log output to stdout when using the underlying Node system in Atom.

@nguyer

This comment has been minimized.

Copy link

commented Jul 10, 2014

@andrewburgess I did the same exact thing you did with no error. However, I just discovered that if I do not have a .jscsrc file in my working directory, Linter Jshint works fine...strange...

Even if I remove all content or just leave empty curly braces {} in the file, if there is even a .jscsrc file in the folder, it appears to break Jshint.

Does anyone know why this would be? This used to work just fine with these same files.

@nguyer

This comment has been minimized.

Copy link

commented Jul 10, 2014

To follow up...

I have Linter, Linter Jshint, and Linter Jscs all installed. If I do not have a .jshint or a .jscsrc file in my project folder, both linters work correctly.

As soon as I put a .jshint file in my working directory, Linter Jshint no longer works.
As soon as I put a .jscsrc file in my working directory, Linter Jscs no longer works.

Is this a different issue, or can others reproduce this behavior?

@andrewburgess

This comment has been minimized.

Copy link

commented Jul 10, 2014

See if you can follow the chain of events by throwing in some console.logs in the buffered-process.js file (atom/resources/app/src/buffered-process.js I believe) and then reloading Atom (View -> Reload or Ctrl+Alt+r possibly)

See if you are getting any data around line 70 (where the bufferStream function is setting up the stream.on('data') handler)

@nguyer

This comment has been minimized.

Copy link

commented Jul 11, 2014

@andrewburgess At first glance, nothing seems to be broken here. I open a file and the on('data) event gets called eight times whether I have a .jshintrc file in my directory or not.

@andrewburgess

This comment has been minimized.

Copy link

commented Jul 11, 2014

What output does it receive from the linter?

@batjko

This comment has been minimized.

Copy link

commented Jul 11, 2014

Ugh... that's a lot of "same here" 's without any consistent workaround, at least not for Windows apparently?

According to the console output, GopherJS is used to make system calls, which according to the repo's README.md is simply not supported for Windows... ergo this package is not compatible with Windows at this point:

"When running your code with Node.js on Windows, it is theoretically possible to use system calls. To do so, you would need a special Node.js module that provides direct access to system calls.
However, since the interface is quite different from the one used on OS X and Linux, the system calls
module included in GopherJS currently does not support Windows.
Sorry.
Get in contact if you feel like you want to change this situation."

@nguyer

This comment has been minimized.

Copy link

commented Jul 14, 2014

Interesting...I reverted back to v0.4.9 7dc1981 and this doesn't seem to be an issue anymore. Maybe this is a regression, or a regression caused by changes in the latest Atom?

@glek

This comment has been minimized.

Copy link

commented Jul 26, 2014

I believe the cause of this problem comes from the use of BufferedNodeProcess instead of a regular BufferedProcess. BufferedNodeProcess sets an environment variable that is meant to cause the Atom shell to execute the command with the installed version of node. If I'm reading the Atom shell source right, the variable is noticed but at the time it does not cause node to be run, resulting in nothing happening. In v0.4.9, if linter was using node, it would manually fetch the node executable path and execute a BufferedProcess with the node path as the command. If you change the source of the current version to mimic this behavior, linters start working again.

@batjko

This comment has been minimized.

Copy link

commented Jul 26, 2014

What's the latest status? I'm now on atom v119, re-installed linter and some of its plugins and they're still doing nothing.

Are we still on "Windows-Not-Supported mode", or has anyone found a way to make it work?

@glek

This comment has been minimized.

Copy link

commented Jul 28, 2014

There's no official fix as of yet, but you can make some local changes to the source files to get them working.

To get them working locally, I did the following:

  • Bring up Settings and open the Linter addon
  • Select Open in Atom to bring up the source
  • Go to lib/linter.coffee
  • At line 57, you should see
if @executablePath
      cmd_list[0] = "#{@executablePath}/#{cmd_list[0]}"
  • Immediately after that if block, add the following code:
if @isNodeExecutable
      cmd_list.unshift(@getNodeExecutablePath())
  • Now go to line 96, where you should see
if @isNodeExecutable
      Process = BufferedNodeProcess
  • Change it to
if @isNodeExecutable
      Process = BufferedProcess

Reload any open projects and your linters should begin linting again.

@batjko

This comment has been minimized.

Copy link

commented Jul 28, 2014

@glek It works! Most exhilarating!
And lint I shall.

@vorou

This comment has been minimized.

Copy link

commented Jul 31, 2014

@glek here's what I've got on Windows after I did what you said:

stderr 
C:\Users\vorou\AppData\Roaming\npm\jshint:2
basedir=`dirname "$0"`
        ^
SyntaxError: Unexpected token ILLEGAL
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:902:3

What am I doing wrong?

@n3dst4

This comment has been minimized.

Copy link

commented Jul 31, 2014

@vorou If you've overriden the path to jshint in the linter-jshint settings, set it back to default (blank)? I had that briefly after I'd got it working using @glek's instructions.

@vorou

This comment has been minimized.

Copy link

commented Jul 31, 2014

@n3dst4 looks like working, thanks!

@cesugden

This comment has been minimized.

Copy link

commented Aug 1, 2014

@glek and @n3dst4 This worked for me too, thanks guys!

@dmnd

This comment has been minimized.

Copy link

commented Aug 1, 2014

@glek how about creating a pull request with that fix?

@ghost

This comment has been minimized.

Copy link

commented Aug 9, 2014

The problem is BufferedNodeProcess on my Windows. I posted my fix here.

@dmnd

This comment has been minimized.

Copy link

commented Aug 9, 2014

@glek's fix #148 is now merged to master so I'm closing this issue.

@dmnd dmnd closed this Aug 9, 2014

@djalmajr

This comment has been minimized.

Copy link

commented Oct 15, 2014

This still happens to me ... I have two linters: jsxhint and jslint. With jsxhint gives this error, with jshint everything is ok. Version of the atom v0.136.0 (Win8.1)

stderr 
c:\Users\Djalma\.atom\packages\linter-jsxhint\node_modules\.bin\jsxhint:2
basedir=`dirname "$0"`
              ^
SyntaxError: Unexpected token ILLEGAL
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3
@bgreenawald

This comment has been minimized.

Copy link

commented Jul 4, 2015

I had this same problem on Windows 8 but was able to fix it by editing the config.cson file in Atom. After you've downloaded your linters, you need to first get the full path (file location) for the linter. Then, go into the config.cson file and you should see all the linters you've downloaded somewhere in the file. For example, I was trying to get pylint to work. In the config file there should quotations containing your specific linter somewhere in the file, for example, mine has a line of code that just read:
"linter-pylint": {}

Delete the brackets and in the line under the name of your linter (keep the colon and it should auto indent the next line) add "path: " and then the full path name of your linter. So my pylint went from
"linter-pylint": {}

to

"linter-pylint":
path: "C:Users/Student/.atompackageslinter-pylint"

then I restarted Atom and the linter was working just fine. The same method worked for the c++ linter clang. Note: you also might need to do the same thing for the generic linter itself i.e your file might contain a line that just says
"linter": {}

or something similar, and you just follow the same procedure. Hope this helps!

@steelbrain

This comment has been minimized.

Copy link
Owner

commented Jul 4, 2015

@bgreenawald be advised that I and a lot of other people are using the new linter without any kind-of config.cson at all. If someone else has this issue, they should try upgrading their atom or maybe resetting their atom conf

mv ~/.atom ~/.atom-bkp

Repository owner locked and limited conversation to collaborators Oct 7, 2015

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.