-
Notifications
You must be signed in to change notification settings - Fork 48
Conversation
|
executable: | ||
type: 'string' | ||
default: 'pylint' | ||
rcFile: |
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.
Doesn't pylint automatically search for rc file in the file tree?
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 think it can be useful to be able to use a rc file that lives in a different location
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.
Okay, then I am neutral on the idea.
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.
This was part of keeping feature and behavior parity with the current version. In general it seems ok to expose often used cli flags via the config. I'm also neutral though 😁
waiting for a few reports of confirming this works, I might test this as well, but not in a position to do so any time soon. |
c3d7c95
to
71c2364
Compare
@steelbrain I have fixed the
|
projDir = @getProjDir(file) | ||
cwd = projDir | ||
pythonPath = @pythonPath.replace(/%p/g, projDir) | ||
env = _.merge {}, process.env, |
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.
How about you do Object.create(process.env)
here
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.
✅
args.push "--rcfile=#{@rcFile}" | ||
args.push tmpFilename | ||
return helpers.exec(@executable, args, {env: env, cwd: cwd}).then (output) => | ||
_.reject helpers.parse(output, @regex, {filePath: file}), {type: 'info'} |
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 don't understand why would you need _.reject
here. You can completely drop lodash IMO.
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.
As a convenient way to suppress messages of type info
. Admittedly, I could instead use filter
and a whitelist approach.
Concerning lodash, I am also using trim
, compact
, and find
, which I think provides some value and conciseness for our code.
Happy to remove it if it's an issue.
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.
It is not an issue 😃 But I am against importing modules that could easily be replaced by native code. Also we have a String.prototype.trim
in native JS.
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.
Reasonable.
RE: trim, unfortunately native trim only trims whitespace. I needed to trim :
from use input, since I add the :
later.
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.
_.reject
does the same thing as helpers.parse(...).filter(e => e)
right?
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.
Yes, but with sugar - you can give it an object rather than a function. It removes any items with properties that match. IMO it is pretty fluent since you can basically read it as "reject from array if type is 'info'". Native filter alternative is
helpers.parse(output, @regex, {filePath: file}).filter (lintIssue) -> lintIssue.type isnt 'info'
which is also pretty concise and fluent 😁
71c2364
to
a1c836f
Compare
All comments should be addressed |
@Arcanemagus would you have some time to try this one? |
You are right about this. Originally I had ignored anything from Let me see if I can find a way to suppress this specific warning. |
@Arcanemagus I am guessing that the program this linter uses writes something to stderr and we dislike something on stderr when we are expecting stdout, so we throw. |
@SpainTrain We do have a |
I do love how the example image on the |
Yup, that's what I was using before the temp file and other updates. The issue there is the user won't be notified of legitimate errors. For example, while I was doing some testing I had to go into the dev tools in atom just to see the legitimate errors that pylint was reporting. It's possibly minor enough to just use |
That is amazing... |
Actually, now I realize that I am setting |
daaf85b
to
290ea05
Compare
✅ should play nice with Windows now! |
Checking out now. |
Looks like it's working at a basic level, haven't tested any of the settings but the main linter works. |
Btw, for errors that have 0 for their column you might want to use |
290ea05
to
37bfc92
Compare
@steelbrain any issues that you can see preventing this getting merged? |
About to push this change |
@Arcanemagus I am super-dooper busy, If this looks good to you, I am happy to merge. |
* Use latest atom linter API * Use helpers from atom-linter * Refactor to use latest linter plugin conventions (main.coffee, etc.) Closes AtomLinter#52 AtomLinter#53 AtomLinter#51 AtomLinter#50 AtomLinter#49
37bfc92
to
4431f0b
Compare
Added this |
.map (lintIssue) -> | ||
[[lineStart, colStart], [lineEnd, colEnd]] = lintIssue.range | ||
if lineStart == lineEnd and colStart <= colEnd <= 0 | ||
return _.merge {}, lintIssue, |
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.
Object.create
would not work here
@SpainTrain Thanks for all the hard work and effort You've put into this rewrite 👏 |
Update: Use latest linter API
np, it's been fun, thx for merging |
Oops, just realized I neglected to add the new config params to the README 😞 |
Another PR? 😃 |
Of course #56 |
Testing
This is a significant change, so it would be great if folks could test it out to ensure it works with their environment/config.
cd
into yourlinter-pylint
directoryapm link --dev
atom -d
Using these directions will not affect your current linter-pylint. You can go back to normal by running atom without the
-d
flag.If you do run into issues, please comment and provide:
linter
versionCloses #52 #53 #51 #50 #49
This change is