-
Notifications
You must be signed in to change notification settings - Fork 12
Conversation
Can you update the |
lintOnFly: true | ||
lint: (editor) => | ||
filePath = editor.getPath() | ||
cwd = path.dirname(filePath) |
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.
path
hasn't been imported, so it crashes on this line currently.
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 wonder why it's not on my local setup :) anyway - fixing now
I think that's all the comments I have for now, if you want here is a .diff of the changes required to get this working, but it doesn't address all of the comments above: diff --git a/lib/init.coffee b/lib/init.coffee
index 82065ea..8ca5a44 100644
--- a/lib/init.coffee
+++ b/lib/init.coffee
@@ -22,6 +22,7 @@ module.exports =
@subscriptions.dispose()
provideLinter: ->
helpers = require('atom-linter')
+ path = require 'path'
provider =
name: 'gjslint'
grammarScopes: ['source.js', 'source.js.jquery', 'text.html.basic']
@@ -37,7 +38,7 @@ module.exports =
tmpFilePath
]
return helpers.exec(@executablePath, params, {cwd}).then (stdout) ->
- regex = /^Line\s(\d*)\, E\:(\d*):\s(.*)$/
+ regex = /Line\s(\d+), E:(\d+):\s(.+)/
lines = stdout.split('\n').filter (line) ->
line.indexOf('Line') == 0
|
Btw, when this gets eventually gets merged make sure to file an issue to get this re-instated over here: https://github.com/AtomLinter/atomlinter.github.io |
* Remove unnecessary escaping in RegEx * Always match at least one digit/character * Require path before using it :) * Use `is` instead of `==` * Include error code in the output message * Return whole line instead of first char as range
@Arcanemagus I've updated the PR to (hopefully) cover all your comments Please let me know if there's anything else I should be doing apart from reporting to atomlinter.github.io once this gets eventually merged. A bit OT: is there a "standard" way to disable the plugin live? (As you might expect, not all the project I work on require |
$ apm install linter-gjslint | ||
``` | ||
## Installation | ||
Run `amp install linter-gjslint` or search for `linter-gjslint` in atom package manager. |
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.
*Atom
Some plugins have a setting that, when enabled, disable linting if a configuration file isn't found. That really only helps if the linter itself uses configuration files though. You shouldn't need to restart Atom btw, just disabling the plugin should work (now that it's moved to the new linter API, the old API would always lint since it was somewhat running itself). |
@steelbrain this looks good to me (other than the slight README.md typo), any objections to merging this that you have? Also I would suggest that a team be created for this repo and @artoale be added as a maintainer, assuming you would want that @artoale 😉. |
@Arcanemagus Thanks for the info - I haven't needed the "disable" feature since the new linter API, well, because of the purpose of this PR :) I'll be very happy to help in maintaining this linter, if I can. I suspect it shouldn't require a massive effort in terms of time, so very happy to collaborate if needed! |
lint: (editor) => | ||
filePath = editor.getPath() | ||
cwd = path.dirname(filePath) | ||
tempFile path.basename(filePath), editor.getText(), (tmpFilePath) => |
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.
Is tempfile really necessary? I mean does it not support stdin?
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.
AFAIK no,
cat test.js | gjslint
gives
0 files checked, no errors found.
So, I suspect no :(
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.
google/closure-linter#96
We don't have to wait for it
Also you can completely drop the donation part in the readme |
@artoale You should've recieved the github emails |
@steelbrain Yeah, got the invitation :) |
LGTM. Merge at will. |
@steelbrain should I publish as well? if so, are we following a specific "definition" of how to use semver? (e.g. here we don't really change the API exposed - since well, we're just consuming some) |
To publish a release clone the repo and do |
Btw after doing an |
Oh, I see! Makes sense. Will do! On Thu, Oct 15, 2015, 18:15 Landon Abney notifications@github.com wrote:
|
As reported in #10, #14 and #15, Linter APIs have changed.
This pull request is an attempt at fixing the issue.
It doesn't support ignored code - but it should at least work (since current implementation is not).
I suspect adding support for ignored codes would be good for another issue/pr.
Let me know if there's anything I should add/change.