mirror of
https://github.com/mgechev/revive.git
synced 2025-11-27 22:18:41 +02:00
Add white & black lists for var-naming
This PR introduces a white & black lists of initialisms for the `var-naming` rule. Now the rule can be configured with: ```toml [rule.var-naming] arguments = [["ID"], ["VM", "BAR"]] ``` This way, the linter will ignore `customId` but will throw on `customVm` or `customBar`. Fix #41
This commit is contained in:
@@ -275,7 +275,7 @@ func TestLintName(t *testing.T) {
|
||||
{"IEEE802_16Bit", "IEEE802_16Bit"},
|
||||
}
|
||||
for _, test := range tests {
|
||||
got := lint.Name(test.name)
|
||||
got := lint.Name(test.name, nil, nil)
|
||||
if got != test.want {
|
||||
t.Errorf("lintName(%q) = %q, want %q", test.name, got, test.want)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user