Skip to content

fix: swag fmt not working with relative path like ../#2117

Open
shindonghwi wants to merge 1 commit intoswaggo:masterfrom
shindonghwi:fix/fmt-relative-dir
Open

fix: swag fmt not working with relative path like ../#2117
shindonghwi wants to merge 1 commit intoswaggo:masterfrom
shindonghwi:fix/fmt-relative-dir

Conversation

@shindonghwi
Copy link
Copy Markdown
Contributor

Summary

  • Fix swag fmt --dir ../ not formatting files when using relative parent path
  • The excludeDir function incorrectly treated .. as a hidden folder because it checked if path starts with . and has length > 1

Changes

  • Modified hidden folder detection to exclude .. from being treated as hidden
  • Added test case for relative path formatting

Fixes #2112

The excludeDir function incorrectly treated ".." as a hidden folder
because it checked if the path starts with "." and has length > 1.
This caused `swag fmt --dir ../` to skip the parent directory entirely.

Fixes swaggo#2112
@CodingTil
Copy link
Copy Markdown

Push

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.

Swag Fmt ignores --dir option

2 participants