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

Misspell not detecting strings inside single quotes #3893

Closed
4 tasks done
perfectcw opened this issue Jun 7, 2023 · 4 comments
Closed
4 tasks done

Misspell not detecting strings inside single quotes #3893

perfectcw opened this issue Jun 7, 2023 · 4 comments
Labels
dependencies Relates to an upstream dependency question Further information is requested

Comments

@perfectcw
Copy link

perfectcw commented Jun 7, 2023

Welcome

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc.).
  • Yes, I've tried with the standalone linter if available (e.g., gocritic, go vet, etc.). (https://golangci-lint.run/usage/linters/)

Description of the problem

Issue: Misspell not detecting strings inside single quotes
In this case, misspell not detecting 'Unkonwn'

Input test.go:

// comment with incorrect spelling: occured
// comment with incorrect spelling: langauge
// comment with incorrect spelling: somethng
// comment with incorrect spelling: Unkown
// comment with incorrect spelling: 'Unkonwn'
// comment with incorrect spelling: Unkonwn

Output:

query/mkpl_inventory_bidding_entity_builder.go:66:38: `occured` is a misspelling of `occurred` (misspell)
   // comment with incorrect spelling: occured

query/mkpl_inventory_bidding_entity_builder.go:67:38: `langauge` is a misspelling of `language` (misspell)
   // comment with incorrect spelling: langauge

query/mkpl_inventory_bidding_entity_builder.go:69:38: `Unkown` is a misspelling of `Unknown` (misspell)
   // comment with incorrect spelling: Unkown

query/mkpl_inventory_bidding_entity_builder.go:71:38: `Unkonwn` is a misspelling of `Unknown` (misspell)
   // comment with incorrect spelling: Unkonwn

Version of golangci-lint

V1.53.2

Configuration file

not exist

Go environment

go version go1.20.5 darwin/amd64

Verbose output of running

query/test.go:66:38: `occured` is a misspelling of `occurred` (misspell)
	// comment with incorrect spelling: occured
	
query/test.go:67:38: `langauge` is a misspelling of `language` (misspell)
	// comment with incorrect spelling: langauge

query/test.go:69:38: `Unkown` is a misspelling of `Unknown` (misspell)
	// comment with incorrect spelling: Unkown
	
query/test.go:71:38: `Unkonwn` is a misspelling of `Unknown` (misspell)
	// comment with incorrect spelling: Unkonwn

Code example or link to a public repository

// comment with incorrect spelling: occured
// comment with incorrect spelling: langauge
// comment with incorrect spelling: somethng
// comment with incorrect spelling: Unkown
// comment with incorrect spelling: 'Unkonwn'
// comment with incorrect spelling: Unkonwn
@perfectcw perfectcw added the bug Something isn't working label Jun 7, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Jun 7, 2023

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@ldez ldez added the dependencies Relates to an upstream dependency label Jun 7, 2023
@ldez
Copy link
Member

ldez commented Jun 7, 2023

Hello,

I think this is expected because misspell uses var wordRegexp = regexp.MustCompile(`[a-zA-Z0-9']+`) to split word.
Maybe it's a way to ignore a word.

@perfectcw
Copy link
Author

Thanks for your response! So it actually checks for 'Unkown' rather than Unkown.

@ldez ldez added question Further information is requested and removed bug Something isn't working labels Jun 17, 2023
@Antonboom
Copy link
Contributor

Related to client9/misspell#195

I think we should close this issue (as unrelated to golangci-lint) and open another one (or do contribution) in misspell.

@ldez ldez closed this as completed Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Relates to an upstream dependency question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants