From ebaafde112c292884a3eace2be61a3feaca8e279 Mon Sep 17 00:00:00 2001 From: Desmond Brand Date: Tue, 8 Jul 2014 00:13:14 -0700 Subject: [PATCH 1/2] Use project root as cwd I have a pylint file in my project root that wasn't being found by `linter-pylint`. Looking into it, I discovered `@cwd` was `null` because `LinterPylint.constructor` never calls `super`. Test Plan: Opened a new Atom window in the directory that contains my pylint file and had pylint import things properly. --- lib/linter-pylint.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/linter-pylint.coffee b/lib/linter-pylint.coffee index bac26d4..81707e2 100644 --- a/lib/linter-pylint.coffee +++ b/lib/linter-pylint.coffee @@ -14,6 +14,9 @@ class LinterPylint extends Linter regexFlags: 'm' constructor: (@editor) -> + super @editor # sets @cwd to the dirname of the current file + # if we're in a project, use that path instead + @cwd = atom.project.path || @cwd exec 'pylint --version', cwd: @cwd, @executionCheckHandler console.log 'Linter-Pylint: initialization completed' From 0b8b28dc148c7d64f5abd39b8095338ef81d80b9 Mon Sep 17 00:00:00 2001 From: Desmond Brand Date: Thu, 10 Jul 2014 02:34:45 -0700 Subject: [PATCH 2/2] use existence operator --- lib/linter-pylint.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linter-pylint.coffee b/lib/linter-pylint.coffee index 81707e2..34c310f 100644 --- a/lib/linter-pylint.coffee +++ b/lib/linter-pylint.coffee @@ -16,7 +16,7 @@ class LinterPylint extends Linter constructor: (@editor) -> super @editor # sets @cwd to the dirname of the current file # if we're in a project, use that path instead - @cwd = atom.project.path || @cwd + @cwd = atom.project.path ? @cwd exec 'pylint --version', cwd: @cwd, @executionCheckHandler console.log 'Linter-Pylint: initialization completed'