Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
add support for --select flag
Browse files Browse the repository at this point in the history
by default flake8 ignore some errors e.g "E226 missing whitespace around arithmetic operator"
  • Loading branch information
schepelin committed Sep 14, 2014
1 parent 08119c9 commit 2abd81b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/linter-flake8.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,29 @@ class LinterFlake8 extends Linter
atom.config.observe 'linter-flake8.ignoreErrorCodes', =>
@updateCommand()

atom.config.observe 'linter-flake8.selectErrors', =>
@updateCommand()

destroy: ->
atom.config.unobserve 'linter-flake8.maxLineLength'
atom.config.unobserve 'linter-flake8.ignoreErrorCodes'
atom.config.unobserve 'linter-flake8.executableDir'
atom.config.unobserve 'linter-flake8.selectErrors'

updateCommand: ->
cmd = 'flake8'
maxLineLength = atom.config.get 'linter-flake8.maxLineLength'
errorCodes = atom.config.get 'linter-flake8.ignoreErrorCodes'
selectErrors = atom.config.get 'linter-flake8.selectErrors'

if maxLineLength
cmd = "#{cmd} --max-line-length=#{maxLineLength}"

if errorCodes and errorCodes.length > 0
cmd += " --ignore=#{errorCodes.toString()}"


if selectErrors
cmd += " --select=#{selectErrors.toString()}"

@cmd = cmd
module.exports = LinterFlake8

0 comments on commit 2abd81b

Please sign in to comment.