-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
chore: Remove gomonkey dependency from formatter #1192
Conversation
9ceda39
to
f8a6d34
Compare
Move directory tree walking code from Formatter to format/ package that handles `fmt` subcommand.
f8a6d34
to
f7c67c6
Compare
- Handle file open/read/update in format/format.go - Only handle formatting file contents in formatter.go - Write tests against formatter public API only - Clean up formatter code
f7c67c6
to
bbbb6c5
Compare
@ubogdan have you seen this one before with CI tests? # cd .; git clone -- https://go.googlesource.com/lint /home/runner/work/swag/src/golang.org/x/lint
Cloning into '/home/runner/work/swag/src/golang.org/x/lint'...
fatal: unable to access 'https://go.googlesource.com/lint/': The requested URL returned error: 502
package golang.org/x/lint/golint: exit status 128 I couldn't reproduce locally |
Codecov Report
@@ Coverage Diff @@
## master #1192 +/- ##
==========================================
- Coverage 95.03% 94.70% -0.33%
==========================================
Files 10 11 +1
Lines 2557 2475 -82
==========================================
- Hits 2430 2344 -86
- Misses 69 71 +2
- Partials 58 60 +2
Continue to review full report at Codecov.
|
@akojo looks like a temporary issue. |
Coverage test seems to be failing because decreasing the amount of code lines in the repo brings overall coverage down. |
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.
LGTM
@akojo Thanks for your contribution. |
Describe the PR
Refactor formatter file handling code so that formatter itself and the
fmt
command-line tool can be tested without usinggomonkey
.Implement formatter tests so that they tests against actual pieces of go code with comments. While doing that clean up formatter code so that it's 100% covered by tests.
Relation issue
#1178