-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix(no-raw-keys): do not report constants from other packages #67
fix(no-raw-keys): do not report constants from other packages #67
Conversation
@tmzane I see the problem with the checks, GitHub is looking for a location that doesn't exist on the runner.
Just taking a look at a solution now |
@tmzane Here is the potential resolution https://stackoverflow.com/questions/64448560/golang-package-is-not-in-goroot-usr-local-go-src-packagename |
@tmzane as this would be a CICD change most likely, I will remove the test case for now. |
I might have an idea how to fix it, let me check. |
Looks like the tests are passing now, good. May I ask why you updated the check to use |
Nevermind, I see now that |
@Jacobbrewer1 Thanks! |
Closes #66
This pull request includes changes to improve the handling of raw keys in the
sloglint
package. The most important changes include enhancing the key checking logic, adding new constant definitions, and modifying test cases to use the new constants.Improvements to key checking logic:
sloglint.go
: Enhanced the logic in thevisit
function to handle package selectors and ensure that keys are constants defined within any package.Additions to constant definitions:
testdata/src/no_raw_keys/keys/consts.go
: Added a new file to define package-level constants.Updates to test cases:
testdata/src/no_raw_keys/no_raw_keys.go
: Modified imports to include the new constants and updated test cases to use these constants. [1] [2]Testing
The new test case does not trigger the error