Skip to content

Commit

Permalink
Optional display of pylint code, and human-readable version. Issue At…
Browse files Browse the repository at this point in the history
  • Loading branch information
bmhkim committed Jun 30, 2015
1 parent b08372d commit 0388f56
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/init.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ module.exports =
rcFile:
type: 'string'
default: ''
showCodes:
description: "Shows the pylint code in linter messages (E1101, etc.)"
type: 'boolean'
default: false
showReadableCodes:
description: "Shows the human-readable pylint symbol in linter messages (e.g., unused-import for W0611)"
type: 'boolean'
default: false

activate: ->
console.log 'Linter-Pylint: package loaded,
Expand Down
16 changes: 15 additions & 1 deletion lib/linter-pylint.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,21 @@ class LinterPylint extends Linter
# Sets the command based on config options
updateCommand: ->
cmd = [atom.config.get 'linter-pylint.executable']
cmd.push "--msg-template='{line},{column},{category},{msg_id}:{msg}'"

showCodes = atom.config.get 'linter-pylint.showCodes'
showReadableCodes = atom.config.get 'linter-pylint.showReadableCodes'

msgCodes = ""
if showCodes or showReadableCodes
msgCodes = '('
if showCodes
msgCodes += '{msg_id}'
if showReadableCodes
msgCodes += ';'
if showReadableCodes
msgCodes += '{symbol}'
msgCodes += ') '
cmd.push "--msg-template='{line},{column},{category},{msg_id}:" + msgCodes + "{msg}'"
cmd.push '--reports=n'
cmd.push '--output-format=text'

Expand Down

0 comments on commit 0388f56

Please sign in to comment.