diff --git a/src/beautifiers/autopep8.coffee b/src/beautifiers/autopep8.coffee index cc1a234..e38a648 100644 --- a/src/beautifiers/autopep8.coffee +++ b/src/beautifiers/autopep8.coffee @@ -27,8 +27,12 @@ module.exports = class Autopep8 extends Beautifier }) .then(=> if options.sort_imports + editor = atom.workspace.getActiveTextEditor() + filePath = editor.getPath() + projectPath = atom.project.relativizePath(filePath)[0] + @run("isort", - [tempFile], + ["-sp", projectPath, tempFile], help: { link: "https://github.com/timothycrosley/isort" }) diff --git a/src/beautifiers/yapf.coffee b/src/beautifiers/yapf.coffee index 5ba490c..3ac7092 100644 --- a/src/beautifiers/yapf.coffee +++ b/src/beautifiers/yapf.coffee @@ -24,8 +24,12 @@ module.exports = class Yapf extends Beautifier }, ignoreReturnCode: true) .then(=> if options.sort_imports + editor = atom.workspace.getActiveTextEditor() + filePath = editor.getPath() + projectPath = atom.project.relativizePath(filePath)[0] + @run("isort", - [tempFile], + ["-sp", projectPath, tempFile], help: { link: "https://github.com/timothycrosley/isort" })