-
Notifications
You must be signed in to change notification settings - Fork 89
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
feat: optimize artisan check #238
Conversation
Lint会在发现问题时输出一堆毫无意义的信息: |
assert.Nil(t, file.Remove("config.conf")) | ||
|
||
mockConfig.AssertExpectations(t) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug risks:
- The code modifies the global variable
support.EnvPath
without restoring its original value after the test. This can affect other tests that rely on the default value ofsupport.EnvPath
.
Improvement suggestions:
- Instead of modifying the global variable
support.EnvPath
, it would be better to use a local variable within the test function to specify the custom environment file path. - The code uses assert statements for checking conditions and error handling. Consider using testing functions like
Errorf
orFailNow
to provide more informative failure messages when assertions fail. - There is an opportunity to improve code readability by breaking down the second test function into smaller, more focused test cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug risks:
- The code modifies the global variable
support.EnvPath
without restoring its original value after the test. This can affect other tests that rely on the default value ofsupport.EnvPath
.Improvement suggestions:
- Instead of modifying the global variable
support.EnvPath
, it would be better to use a local variable within the test function to specify the custom environment file path.- The code uses assert statements for checking conditions and error handling. Consider using testing functions like
Errorf
orFailNow
to provide more informative failure messages when assertions fail.- There is an opportunity to improve code readability by breaking down the second test function into smaller, more focused test cases.
Good idea.
@hwbrzzl Codecov 似乎有问题,Token 404 |
cc @hwbrzzl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, LGTM 👍
📑 Description
对昨天#237 的补充
✅ Checks
ℹ Additional Information