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

quickfix QF1013: detect quoted string escaping quote, while backticks could be used #1566

Open
ccoVeille opened this issue Jun 24, 2024 · 5 comments · May be fixed by #1580
Open

quickfix QF1013: detect quoted string escaping quote, while backticks could be used #1566

ccoVeille opened this issue Jun 24, 2024 · 5 comments · May be fixed by #1580

Comments

@ccoVeille
Copy link

I didn't find a linter for this so I'm creating an issue here.

I asked Gopher Slack community https://gophers.slack.com/archives/C4MTR76PQ/p1719215628975379

And it appears I was right and this linter/checker doesn't exist yet.

The idea is to be able to report this for any string

fmt.Println("I'm \"happy\"")
fmt.Println(`I'm "happy"`)

This should be an optional rule of course, as it could bring a lot of noise.

I think one could improve the readability of the code

@ccoVeille ccoVeille added the needs-triage Newly filed issue that needs triage label Jun 24, 2024
@ccoVeille
Copy link
Author

@ccoVeille
Copy link
Author

@dominikh how do we attribute a number for the checker I mean the sXXXX ?

@dominikh
Copy link
Owner

The prefix for quickfixes is QF, its only category is 1, so currently the next available ID would be QF1013.

@ccoVeille ccoVeille changed the title quickfix: detect quoted string escaping quote, while backticks could be used quickfix QF1013: detect quoted string escaping quote, while backticks could be used Jun 24, 2024
@dominikh dominikh added new-check and removed needs-triage Newly filed issue that needs triage labels Jun 24, 2024
@ccoVeille
Copy link
Author

This could help me to list all strings wherever they are

https://github.com/dominikh/go-tools/blob/master/stylecheck%2Fst1018%2Fst1018.go

ccoVeille added a commit to ccoveille-forks/dominikh-go-tools that referenced this issue Jul 31, 2024
@Antonboom
Copy link

+1 to such check
was surprised too that it doesn't implement yet anywhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants