fix: resolve lint issues and improve test coverage for TOML v1.1.0
- Fix dupl lint: add nolint:dupl to parseInlineTable and parseValArray which have intentionally similar loop structures - Fix gci lint: correct alignment in multiline basic string test entries - Add unmarshaler tests for new TOML v1.1.0 features exercising public APIs: multiline inline tables with comments, trailing commas, leading commas, error cases (comma at start, missing separator, double comma, incomplete table), escape sequences, and type mismatch errors - Add parser test for inline table comment handling with KeepComments - Coverage increases from 97.37% to 97.44% vs v2 base https://claude.ai/code/session_01RdiWykFQdmwkQ2nbLwJwwP
This commit is contained in:
+2
-2
@@ -460,7 +460,7 @@ func (p *Parser) parseLiteralString(b []byte) ([]byte, []byte, []byte, error) {
|
||||
return v, v[1 : len(v)-1], rest, nil
|
||||
}
|
||||
|
||||
//nolint:funlen,cyclop
|
||||
//nolint:funlen,cyclop,dupl
|
||||
func (p *Parser) parseInlineTable(b []byte) (reference, []byte, error) {
|
||||
// inline-table = inline-table-open [ inline-table-keyvals ] inline-table-close
|
||||
// inline-table-open = %x7B ws ; {
|
||||
@@ -555,7 +555,7 @@ func (p *Parser) parseInlineTable(b []byte) (reference, []byte, error) {
|
||||
return parent, rest, err
|
||||
}
|
||||
|
||||
//nolint:funlen,cyclop
|
||||
//nolint:funlen,cyclop,dupl
|
||||
func (p *Parser) parseValArray(b []byte) (reference, []byte, error) {
|
||||
// array = array-open [ array-values ] ws-comment-newline array-close
|
||||
// array-open = %x5B ; [
|
||||
|
||||
Reference in New Issue
Block a user