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

feat: add packageName option for docs.go #1442

Merged
merged 4 commits into from
Mar 21, 2023

Conversation

hwwwi
Copy link
Contributor

@hwwwi hwwwi commented Jan 14, 2023

Describe the PR
swag is generating an invalid package name when the --output option is used with a hyphen.
Since using a hyphen in the package name is not allowed in go, replace it with an underscore.
Ex. --output my-swag will generate package my_swag

Also, I created a packageName option to specify the name of the package from generated docs.go file.
Ex. swag init --packageName my_swag will generate package my_swag.

Relation issue
fix #1441

@hwwwi hwwwi changed the title feat: replace hyphen from docs package name feat: add packageName option for docs.go Jan 14, 2023
@codecov
Copy link

codecov bot commented Mar 21, 2023

Codecov Report

Patch coverage: 50.00% and project coverage change: -0.07 ⚠️

Comparison is base (aaa681e) 85.24% compared to head (973284b) 85.18%.

❗ Current head 973284b differs from pull request most recent head 607212e. Consider uploading reports for the commit 607212e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1442      +/-   ##
==========================================
- Coverage   85.24%   85.18%   -0.07%     
==========================================
  Files          19       19              
  Lines        3654     3659       +5     
==========================================
+ Hits         3115     3117       +2     
- Misses        460      461       +1     
- Partials       79       81       +2     
Impacted Files Coverage Δ
gen/gen.go 92.34% <50.00%> (-1.21%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

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 f475da2 into swaggo:master Mar 21, 2023
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.

Remove hyphen from generated package name from docs.go
3 participants