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

Add NebulousLabs/glyphcheck as linter #2329

Closed
adamdecaf opened this issue Nov 1, 2021 · 4 comments
Closed

Add NebulousLabs/glyphcheck as linter #2329

adamdecaf opened this issue Nov 1, 2021 · 4 comments
Labels
enhancement New feature or improvement

Comments

@adamdecaf
Copy link

Your feature request related to a problem? Please describe.

Homoglyph attacks are an increasing concern for source code and currently hard to detect. There are some tools available for detecting suspect UTF-8 runes.

Describe the solution you'd like.

Including support for running a homoglyph linter would be a good first step.

Describe alternatives you've considered.

There are few if any good homoglyph linters available for the Go language. Perhaps a new linter should be written.

https://github.com/search?l=Go&q=homoglyph&type=Repositories

Additional context.

https://github.com/NebulousLabs/glyphcheck

@adamdecaf adamdecaf added the enhancement New feature or improvement label Nov 1, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Nov 1, 2021

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

@ldez ldez changed the title Add NebulousLabs/glyphcheck as disabled linter Add NebulousLabs/glyphcheck as linter Nov 1, 2021
@bombsimon
Copy link
Member

A liter needs to be written using the go/analysis package to be merged to golangci-lint. It doesn't look like any of the ones in the search result does this so someone would need to write a new linter for golangci-lint to pick it up.

@ldez
Copy link
Member

ldez commented Nov 1, 2021

Hello,

asciicheck already checks those cases.

https://golangci-lint.run/usage/linters/#disabled-by-default-linters--e--enable

Quick example:

.golangci.yml
linters:
  disable-all: true
  enable:
    - asciicheck
example.go
package sandbox

import "fmt"

func gitһub() {
	fmt.Println("Hello")
}
$ golangci-lint run
foo.go:7:6: identifier "gitһub" contain non-ASCII character: U+04BB 'һ' (asciicheck)
func gitһub() {
     ^

@ldez
Copy link
Member

ldez commented Nov 1, 2021

@adamdecaf you can follow the PR #2330

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement
Projects
None yet
Development

No branches or pull requests

3 participants