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

Feature Request: Partially parse the dependencies. #904

Closed
CNLHC opened this issue Mar 24, 2021 · 7 comments · Fixed by #1582
Closed

Feature Request: Partially parse the dependencies. #904

CNLHC opened this issue Mar 24, 2021 · 7 comments · Fixed by #1582

Comments

@CNLHC
Copy link

CNLHC commented Mar 24, 2021

I found that when using the --parseDependency flag, parsing would become very slow in large project.

I believe somebody else is suffering from the same problem, like #515 .

Maybe it is possible to refer the go test command. If i want to test a single case, i can just fire

go test -timeout 30s -run ^<SomeRegExp>$ <ModuleName> -v

So to the swag tool, a flag like include will be helpful. For example, the command below will only parse the github.com/lib/pq module instead of scanning all of the dependencies.

swag init --parseDependency --include "^github.com/lib/pq/$"

Do you think adding a filter mechanism to this feature is a good idea?

@sdghchj
Copy link
Member

sdghchj commented Mar 30, 2021

--parseDepth 3

@CNLHC
Copy link
Author

CNLHC commented Mar 30, 2021

--parseDepth 3

Merely setting depth constraint can not solve the problem because the dependencies tree may be fat but shallow.

@dskyu
Copy link

dskyu commented Apr 27, 2021

@CNLHC can't agree more!

@zskylark
Copy link

说得太对了,只要注解里引用了外部公共包里的类型定义就解析半天,就算是指定parseDepth也无济于事,经常解析20分钟以上。

@gaius-qi
Copy link

Is there a temporary solution?

@SilverRainZ
Copy link
Contributor

Does anyone work on this? This is a useful feature.

@SilverRainZ
Copy link
Contributor

I've submitted a PR to fix the issue. If you guys are interested, you can check out the corresponding branch.

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 a pull request may close this issue.

6 participants