thriftrw / thriftrw-go

A Thrift encoding code generator and library for Go
MIT License
100 stars 53 forks source link

Revert to strings.Title again for pascalCase #582

Closed r-hang closed 1 year ago

r-hang commented 1 year ago

PR #578 replaced strings.Title with golang.org/x/text/cases due to staticcheck SA1019. There is at least one behavioral difference between these two Title casing approaches uncovered during pre-release testing.

A test case to flag this change and an exemption for staticcheck in the relevant file are also added.

Example:

chunk := "10x"
fmt.Println(strings.Title(strings.ToLower(chunk))) # 10x
fmt.Println(cases.Title(language.English).String(strings.ToLower(chunk))) # 10X
codecov[bot] commented 1 year ago

Codecov Report

Merging #582 (2155616) into dev (0977c0d) will not change coverage. The diff coverage is 100.00%.

:exclamation: Current head 2155616 differs from pull request most recent head 495fa70. Consider uploading reports for the commit 495fa70 to get more accurate results

@@           Coverage Diff           @@
##              dev     #582   +/-   ##
=======================================
  Coverage   68.01%   68.01%           
=======================================
  Files         142      142           
  Lines       23878    23878           
=======================================
  Hits        16241    16241           
  Misses       4577     4577           
  Partials     3060     3060           
Impacted Files Coverage Δ
gen/string.go 78.57% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more