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 generated time flag #501

Merged
merged 3 commits into from
Dec 27, 2019
Merged

Conversation

xizhibei
Copy link
Contributor

Describe the PR
Add generation time flag, as described below in #488

Relation issue
#488

Additional context

@codecov-io
Copy link

codecov-io commented Aug 28, 2019

Codecov Report

Merging #501 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #501      +/-   ##
==========================================
+ Coverage   86.36%   86.38%   +0.01%     
==========================================
  Files           7        7              
  Lines        1614     1616       +2     
==========================================
+ Hits         1394     1396       +2     
  Misses        136      136              
  Partials       84       84
Impacted Files Coverage Δ
gen/gen.go 96.74% <100%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e5dd7d...7955f5e. Read the comment docs.

@nnordrum
Copy link

IMO, you should add a generatedTime flag with a true default. I don’t like negative options, but maybe that’s just me.

@xizhibei xizhibei force-pushed the generation-time-flag branch 2 times, most recently from 53411c3 to 189bdae Compare August 29, 2019 01:50
@xizhibei
Copy link
Contributor Author

Yes, I did not find the cli.BoolTFlag for that at first, thks

@xizhibei xizhibei changed the title Add no generated time flag Add generated time flag Aug 29, 2019
gen/gen_test.go Outdated
@@ -230,7 +230,7 @@ func TestGen_writeGoDoc(t *testing.T) {
swapTemplate := packageTemplate

packageTemplate = `{{{`
err := gen.writeGoDoc(nil, nil)
err := gen.writeGoDoc(nil, nil, nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you and the new test cases having pass by configuration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@ubogdan
Copy link
Contributor

ubogdan commented Sep 18, 2019

@xizhibei , any update here ?

@xizhibei
Copy link
Contributor Author

Waiting for @easonlin404 reply, but I can make the test code update first

@alexanderbez
Copy link

Looking forward to having this in a release 👍

@forestgagnon
Copy link

Eagerly awaiting this as well! When code generation commands are idempotent, it really helps reduce churn and noise in repositories, and the reproducibility of output makes builds more scriptable.

@easonlin404
Copy link
Member

sorry for the late reply. @xizhibei can you help fix conflicting files if you have free time? Rest LGTM.

easonlin404
easonlin404 previously approved these changes Dec 23, 2019
Copy link
Contributor

@ubogdan ubogdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ubogdan ubogdan merged commit bef48a6 into swaggo:master Dec 27, 2019
@ubogdan
Copy link
Contributor

ubogdan commented Dec 27, 2019

Thanks for contributing.

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

Successfully merging this pull request may close these issues.

None yet

7 participants