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 exemption for type assertions in Is(error) bool methods #51

Merged
merged 3 commits into from
Aug 20, 2023

Conversation

triarius
Copy link
Contributor

@triarius triarius commented Aug 2, 2023

Fixes #50

@triarius triarius changed the title Add exmption for type assertions in Is(error) bool methods Add exemption for type assertions in Is(error) bool methods Aug 2, 2023
@triarius
Copy link
Contributor Author

triarius commented Aug 2, 2023

PS I tried to run the tests locally and was met with some resistance:

?   	github.com/polyfloyd/go-errorlint	[no test files]
src/allowed/allowed.go:15:2: cannot find package "golang.org/x/sys/unix" in any of:
	/usr/lib/go/src/golang.org/x/sys/unix (from $GOROOT)
	/home/narthana/devel/triarius/go-errorlint/errorlint/testdata/src/golang.org/x/sys/unix (from $GOPATH)
/home/narthana/devel/triarius/go-errorlint/errorlint/testdata/src/allowed/allowed.go:15:2: could not import golang.org/x/sys/unix (invalid package name: "")
--- FAIL: TestAllowedComparisons (0.45s)
    analysistest.go:304: error analyzing errorlint@allowed: analysis skipped due to errors in package
FAIL
FAIL	github.com/polyfloyd/go-errorlint/errorlint	1.617s
FAIL

@kolyshkin
Copy link
Contributor

PS I tried to run the tests locally and was met with some resistance:

@triarius mea culpa. Broken by #47, fixed in #52. Missed because CI was not running tests (fixed in #53). Quite a story :)

@kolyshkin
Copy link
Contributor

@triarius you also need to write commit message titles in the commitizen format.

@triarius triarius force-pushed the is-type-assertions-and-switches branch from 9abe5ef to 0d4020f Compare August 15, 2023 12:37
@triarius
Copy link
Contributor Author

No worries @kolyshkin

I have cherry-picked your commit and the tests run fine locally.

@polyfloyd
Copy link
Owner

Thanks!

@polyfloyd polyfloyd merged commit e13f442 into polyfloyd:main Aug 20, 2023
2 checks passed
@triarius triarius deleted the is-type-assertions-and-switches branch August 20, 2023 23:04
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.

Is methods should be exempt for type assertions and switches too
3 participants