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

Ignore swag file from root dir only #775

Merged
merged 2 commits into from
Aug 18, 2020
Merged

Ignore swag file from root dir only #775

merged 2 commits into from
Aug 18, 2020

Conversation

arvenil
Copy link
Contributor

@arvenil arvenil commented Aug 14, 2020

Describe the PR
The .gitignore rule swag matches not only file in main directory but also folder in cmd/swag.
I've changed it to match only in current folder. For visual I've changed also swag.exe.

Additional context
I've run into the issue when I tried to vendor sources for swag but also for tool. The main.go got ignored by git, I've forced git to add it with git add -f vendor/github.com/swaggo/swag/cmd/swag/main.go

https://git-scm.com/docs/gitignore#_pattern_format

If there is a separator at the beginning or middle (or both) of the pattern, then the pattern is relative to the directory level of the particular .gitignore file itself. Otherwise the pattern may also match at any level below the .gitignore level.

The rule `swag` matches not only file in main directory but also folder in `cmd/swag`.
I've changed it to match only in current folder. For visual I've changed also `swag.exe`.

I've run into issue when I tried to vendor sources for swag but also for tool. The main.go got ignored by git, I was required to `git add -f vendor/github.com/swaggo/swag/cmd/swag/main.go`
@codecov
Copy link

codecov bot commented Aug 14, 2020

Codecov Report

Merging #775 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #775   +/-   ##
=======================================
  Coverage   82.16%   82.16%           
=======================================
  Files           8        8           
  Lines        1744     1744           
=======================================
  Hits         1433     1433           
  Misses        193      193           
  Partials      118      118           

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 542e932...8f8b3fc. Read the comment docs.

Copy link
Member

@easonlin404 easonlin404 left a comment

Choose a reason for hiding this comment

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

LGTM

@easonlin404 easonlin404 merged commit 1889a3a into swaggo:master Aug 18, 2020
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.

2 participants