Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore new lint error & update formatting #1292

Merged
merged 1 commit into from
May 3, 2022
Merged

Ignore new lint error & update formatting #1292

merged 1 commit into from
May 3, 2022

Conversation

alexott
Copy link
Contributor

@alexott alexott commented May 3, 2022

Lint error on Go 1.18:

provider/generate_test.go:250:18: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.  (SA1019)
qa/testing.go:458:17: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.  (SA1019)

@alexott alexott requested a review from nfx May 3, 2022 10:08
@codecov
Copy link

codecov bot commented May 3, 2022

Codecov Report

Merging #1292 (7b589a6) into master (36c961d) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1292   +/-   ##
=======================================
  Coverage   90.57%   90.57%           
=======================================
  Files         118      118           
  Lines        9970     9970           
=======================================
  Hits         9030     9030           
  Misses        559      559           
  Partials      381      381           
Impacted Files Coverage Δ
catalog/resource_grants.go 96.03% <ø> (ø)
permissions/resource_permissions.go 94.71% <ø> (ø)
storage/resource_mount.go 100.00% <100.00%> (ø)

go.mod Outdated
@@ -19,6 +19,7 @@ require (
github.com/zclconf/go-cty v1.10.0
golang.org/x/mod v0.5.1
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5
golang.org/x/text v0.3.7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need it? What license does it have?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's needed to fix error reported by linter, as strings.Title may not handle unicode correctly.
License is the same as for Go (https://cs.opensource.google/go/x/text/+/master:LICENSE, https://go.dev/LICENSE )

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add ignore to that rule in those two places and not add more third-party dependencies? =)

I'd park this till more holistic go1.18 update.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok.
it's really not a 3rd party, just "extension pack" from Golang devs...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nfx added ignore instead of using new library

@alexott alexott changed the title Fix lint errors & update formatting Ignore new lint error & update formatting May 3, 2022
Lint error on Go 1.18:

```
provider/generate_test.go:250:18: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.  (SA1019)
qa/testing.go:458:17: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.  (SA1019)
```
@nfx nfx merged commit e97ff62 into master May 3, 2022
@nfx nfx deleted the fix-lint-errors branch May 3, 2022 11:41
@nfx nfx mentioned this pull request May 5, 2022
michael-berk pushed a commit to michael-berk/terraform-provider-databricks that referenced this pull request Feb 15, 2023
Lint error on Go 1.18:

```
provider/generate_test.go:250:18: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.  (SA1019)
qa/testing.go:458:17: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.  (SA1019)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants