-
Notifications
You must be signed in to change notification settings - Fork 45
Fix per-project configuration behaviour #201
Fix per-project configuration behaviour #201
Conversation
Huh, I was under the impression (from that description) that specifying a config file caused |
Yes, Btw, I've just realized my solution has a problem. I should check also the config file exists, not only if the parameter is specified (already updated this 😃 ). |
04f3dd0
to
0725f9f
Compare
getExistingConfigFiles: (configFiles) -> | ||
return configFiles | ||
.split(/[ ,]+/) | ||
.map (configFile) -> path.join(atom.project.getPaths()[0], configFile) |
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.
Note that this will fail if the file isn't opened in a project.
0725f9f
to
a25842f
Compare
I updated my solution. Take it a look and tell me if you see something wrong :D |
@@ -188,6 +188,32 @@ module.exports = | |||
return p | |||
return execPath | |||
|
|||
getProjectPath: (lintedFile) -> |
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 whole function can be replaced with:
atom.project.relativizePath(lintedFile)[0]
See here for the documentation.
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.
Note that you need to handle when that returns null
(the file not being opened in a project).
@rarguelloF Are you interested in addressing the review comments? |
Yes I'm interested, I'll review your comments this week. And sorry for disappearing so long, I've had some extremely busy weeks 😢 Thanks for your patience!! 😄 |
No worries, it took me that long to check back 😛. |
Override user settings only if per-project config files exist (using the first encountered one).
Now the associated project path is calculated from the linted file path.
0613e2c
to
b1eeb5b
Compare
@Arcanemagus I've already addressed the issues. Please tell me if you want me to change something else :D |
LGTM, merging! |
Published in v1.13.3 🎉 |
Per-project settings should take precedence over user settings, just as stated in the docs:
This PR fix this behaviour and ignores user settings if finds a local configuration file.