-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extend parsing instructions to use json object instead of plain txt
- Loading branch information
1 parent
fd9a130
commit cfcccbd
Showing
4 changed files
with
103 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/mgechev/revive/lint" | ||
"github.com/mgechev/revive/rule" | ||
) | ||
|
||
func TestJsonDataFormat(t *testing.T) { | ||
testRule(t, "json-data-format-atomic", &rule.AtomicRule{}) | ||
|
||
} | ||
func TestJsonDataFormatVarNaming(t *testing.T) { | ||
testRule(t, "json-data-format-var-naming", &rule.VarNamingRule{}, &lint.RuleConfig{}) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package fixtures | ||
|
||
import ( | ||
"sync/atomic" | ||
) | ||
|
||
type Counter uint64 | ||
|
||
func AtomicTests() { | ||
x = atomic.AddUint64(&x, 1) // json:{"MATCH": "direct assignment to atomic value","Confidence": 1} | ||
x := uint64(1) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package fixtures | ||
|
||
func foo() string { | ||
customID := "result" // ignore | ||
customVm := "result" // json:{"MATCH": "var customVm should be customVM"} | ||
CUSTOMER_UP := "result" // json:{"MATCH": "don't use ALL_CAPS in Go names; use CamelCase", "Confidence": 0.8} | ||
return customId | ||
} |