File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -54,3 +54,19 @@ in your `$PATH`.
54
54
- ` swag-fmt` - Runs `swag fmt` on all files in the project.
55
55
- ` swag-init` - Runs `swag init` on the project. Please
56
56
reference [available CLI flags in the documentation](https://github.com/swaggo/swag#swag-cli).
57
+
58
+ # # Additional Notes
59
+
60
+ # ## Usage with `end-of-file-fixer`
61
+
62
+ - When using the `swag-fmt` hook together with `end-of-file-fixer`
63
+ from [pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks), consider :
64
+ - Defining the `end-of-file-fixer` _after_ the `swag-fmt` hook.
65
+ - Excluding the `swagger.json` file from pre-commit actions by adding this to the top-level exclude
66
+ pattern, otherwise you end up in an infinite loop where `swag-fmt` generates JSON without a new line at the end,
67
+ and `end-of-file-fixer` keeps adding it :
68
+
69
+ ` ` ` yaml
70
+ exclude: '^.*swagger\. json$'
71
+ ` ` `
72
+
You can’t perform that action at this time.
0 commit comments