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
Ensure absolute paths to processors #2207
Conversation
f6d43a4
to
1b985ca
Compare
@davidtheclark it might be nice to include #1663 in the next release too, so the deprecations are landed at once. Although I've not done any work on that yet. |
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.
One question, but otherwise LGTM.
return (root, result) => { | ||
let filePath = options.from || _.get(root, "source.input.file") | ||
if (filePath !== undefined && !path.isAbsolute(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.
Is this pattern the same here and in standalone.js
? If so, is it possible to create a util named something like absolutizePath()
and use that?
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 think this pattern is util-worthy. It's just very straightforward JS.
@@ -51,7 +52,13 @@ module.exports = function (options/*: Object */)/*: Promise<stylelint$standalone | |||
}) | |||
|
|||
if (!files) { | |||
return stylelint._lintSource({ code, codeFilename }).then(postcssResult => { | |||
const absoluteCodeFilename = (codeFilename !== undefined && !path.isAbsolute(codeFilename)) |
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.
See comment about creating a util.
@@ -70,7 +77,12 @@ module.exports = function (options/*: Object */)/*: Promise<stylelint$standalone | |||
} | |||
|
|||
const getStylelintResults = filePaths.map(filePath => { | |||
return stylelint._lintSource({ filePath }).then(postcssResult => { | |||
const absoluteFilepath = (!path.isAbsolute(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.
See comment about creating a util.
Added to changelog as:
Oops, I just saw this. I got caught up eating mince pies. I can probably do a release today - I'll create an issue.
The final list of deprecations still needs to be decided on. Hence the |
Hope you enjoyed your holiday! |
I did thank you! I trust you had an enjoyable xmas too! :) |
Closes #2194, closes #2195.
Although this does not add more tests, it does add some errors that break things (causing tests to fail) if absolute paths are for some reason not coming through. More focused unit tests looked like more trouble to figure out than they were worth, so I think this does the trick.
I'd like to cut a release for this as soon as possible, so processors stop failing. How about finishing up this and #2197 and then releasing?