Skip to content

Commit

Permalink
* add new linter settings
Browse files Browse the repository at this point in the history
  • Loading branch information
DisposaBoy committed May 4, 2013
1 parent e4af5a2 commit e1022f7
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ GoSublime Changes

Note: you may need to restart Sublime Text after GoSublime updates

## 13.05.04-3
* add new `lint_enbaled` and `linters` settings. note: the new linter has not yet been implemented
see https://github.com/DisposaBoy/GoSublime/issues/220

## 13.05.04-2
* removed setting: `margo_addr`, if you have a *MarGo* binary in your $PATH, delete it.

Expand Down
59 changes: 59 additions & 0 deletions GoSublime.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,65 @@
// how long to wait after the last keystroke before the gslint_cmd command is run (in milliseconds)
"gslint_timeout": 100,

// Not Implemented
// Whether or not gslint is enabled
"lint_enabled": true,

// Not Implemented
// list of linters to run
// note: before the linters are run, the builtin gs.syntax linter is run
// * its purpose is to do a basic syntax check on the active file.
// * by design, it cannot be disabled
// * if there is a syntax error, no user-defined linters will be run
//
// each linter is an object of the form:
//
// {
// "ctx": "", // the context in which this linter runs, e.g. "live"
// // default: "live", builtin contexts:
// // live: the linters are being called while you're editing the file
// // save: the linters are being called after saving.
// // this can be used to e.g. rebuild or install the pkg
//
// "pat": "", // a regexp pattern that will define the following variables:
// // fn: the filename
// // line: the line number (starting from 1)
// // column: the column number (starting from 1)
// // (this can be considered optional because the error message is still useful without it)
// // message: the error message
// //
// // the default pat will be defined such that it matches `main.go:1:2 error` resulting in:
// // fn: main.go
// // line: 1
// // column: 2
// // message: error
// //
// // it will also allow `line` and `column` to be missing. this should be sufficient
// // for the output of the go tools (go vet, compilers, etc.)
//
// "env": "", // an object mapping keys to string values that will be added to the default env
// // you could, e.g. set {"GOBIN": "/tmp"} in order to avoid installing potentially
// // broken commands into your GOPATH*/bin
//
// "kind": "", // a string that identifies the linter, e.g. `go.vet'
// // this is useful to be able to identify what kind of error you're seeing,
// // but is otherwise optional
//
// "cmd": [], // the command to run, e.g. ["go", "vet"]
// }
//
// the minimal linter is thus: {"cmd": ["go", "vet"]}
//
// builtin linters:
// {"cmd": ["gs.flag.parse"]}: try to report calls to e.g. flag.Int(),flag.String()
// for which there is no call to flag.Parse()
//
// {"cmd": ["gs.types"]}: this is essentially `gotype`, it will do a full typecheck of the pkg
// similar to the compilers. it's faster than doing a full `go build`
// however, it can lead to false-positive errors, especially on cgo
// and other non-pure-go pkgs
"linters": [],

// whether or not to include snippets in the auto-completion list
"autocomplete_snippets": true,

Expand Down
2 changes: 1 addition & 1 deletion gosubl/about.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import re
import sublime

ANN = 'a13.05.04-2'
ANN = 'a13.05.04-3'
VERSION = 'r13.05.04-1'
VERSION_PAT = re.compile(r'r\d{2}.\d{2}.\d{2}-\d+', re.IGNORECASE)
PLATFORM = '%s-%s' % (sublime.platform(), sublime.arch())
Expand Down
2 changes: 2 additions & 0 deletions gosubl/gs.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
"autosave": True,
"build_command": [],
"lint_filter": [],
"lint_enbled": True,
"linters": [],
}
_settings = copy.copy(_default_settings)

Expand Down

0 comments on commit e1022f7

Please sign in to comment.