Merge pull request #1522 from taylon/isort_config

Get isort configuration from project
This commit is contained in:
Glavin Wiechert 2017-04-15 02:54:34 -03:00 committed by GitHub
commit cdcb3e8137
2 changed files with 10 additions and 2 deletions

View File

@ -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"
})

View File

@ -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"
})