diff --git a/lib/init.coffee b/lib/init.coffee index 8bc72e2..7f05ccf 100644 --- a/lib/init.coffee +++ b/lib/init.coffee @@ -1,6 +1,8 @@ module.exports = - configDefaults: - pep8DirToExecutable: null + config: + pep8DirToExecutable: + type: 'string' + default: '' activate: -> console.log 'activate linter-python-pep8' diff --git a/lib/linter-python-pep8.coffee b/lib/linter-python-pep8.coffee index e1a54e2..b506197 100644 --- a/lib/linter-python-pep8.coffee +++ b/lib/linter-python-pep8.coffee @@ -15,7 +15,6 @@ class Pep8Linter extends Linter regex: ':(?\\d+):(?\\d+): ((?E\\d+)|(?W\\d+)) (?.*?)\n' - constructor: (editor)-> super(editor) @@ -24,10 +23,11 @@ class Pep8Linter extends Linter if errorCodes @cmd += " --ignore=#{errorCodes.toString()}" - atom.config.observe 'linter-python-pep8.pep8DirToExecutable', => + @configSubscription = atom.config.observe 'linter-python-pep8.pep8DirToExecutable', => @executablePath = atom.config.get 'linter-python-pep8.pep8DirToExecutable' destroy: -> - atom.config.unobserve 'linter-python-pep8.pep8DirToExecutable' + super + @configSubscription.dispose() module.exports = Pep8Linter diff --git a/package.json b/package.json index 9abfb27..29761d9 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "main": "./lib/init", "version": "0.2.0", "description": "Linting Python files on the fly using pep8 command", - "activationEvents": [], "repository": "https://github.com/bsnux/linter-python-pep8", "license": "MIT", "engines": {