Skip to content

Commit

Permalink
change prefix default
Browse files Browse the repository at this point in the history
Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>
  • Loading branch information
erikbaranowski committed Aug 30, 2023
1 parent c85cf96 commit 56af61e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scanner/identifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type SanitizeIdentifierOptions struct {

func sanitizeIdentifierOptionsDefault() *SanitizeIdentifierOptions {
return &SanitizeIdentifierOptions{
Prefix: "id_",
Prefix: "_",
Replacement: "_",
}
}
Expand Down
4 changes: 2 additions & 2 deletions scanner/identifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ func TestSanitizeIdentifierOptions(t *testing.T) {
opts *scanner.SanitizeIdentifierOptions
}{
{"empty", "", "", "cannot generate a new identifier for an empty string", nil},
{"start_number", "0identifier_1", "id_0identifier_1", "", nil},
{"start_number", "0identifier_1", "_0identifier_1", "", nil},
{"start_char", "identifier_1", "identifier_1", "", nil},
{"start_underscore", "_identifier_1", "_identifier_1", "", nil},
{"special_chars", "!@#$%^&*()", "id___________", "", nil},
{"special_chars", "!@#$%^&*()", "___________", "", nil},
{"special_char", "identifier_1!", "identifier_1_", "", nil},
{"spaces", "identifier _ 1", "identifier___1", "", nil},
{"bad prefix", "", "", "prefix `\"123\"` is not a valid river identifier", &scanner.SanitizeIdentifierOptions{Prefix: "123", Replacement: ""}},
Expand Down

0 comments on commit 56af61e

Please sign in to comment.