-
Notifications
You must be signed in to change notification settings - Fork 617
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
Format only uncommited(modifications) if are available #1629
Comments
When you say that you are running via a keyboard shortcut, do you mean running the command line tool, or the Xcode extension? If you just want to be able to format the current open file with a keyboard shortcut, instead of the whole project, using the Xcode Extension may be the best way to do that. Currently there is no way to limit the command line tool to run only on edited files, unless you use something like a git hook. |
Xcode extension :)
So yes, im running XCode extension on kb shortcut, so every time i save file it formats that whole file, but now that i work with more devs it'q quite annoying to get all this changes in git commit. If this is not possible is it possible to follow rules from SwiftLint since project is linted but not formated by SwiftLint. They are running SwiftLint as build phase via Pods |
@zeljkomarinkovic I have a script that I can run (either manually or as part of the build phase in Xcode) that does just that. It will format only the files have changed and nothing else. I have been using it for a long while now on a daily basis and my productivity has noticeblely improved (non-scientific and sample of few ;) ) . The script has been tweaked over the years to accommodate use case as I (and several other people) encountered them such as Xcode previews, CI, and such. Let me know if you are interested and I will share. |
Sounds wonderful, just what im looking for. Please share :) |
@zeljkomarinkovic Here's the repo. |
@insha thanks, will put it to a good use :) Thanks |
Maybe have missed something, so sorry if i did. But i tried to find solution without success.
I have been using SwiftFormat for some time now, and i love it. But recently started with new to me project where there are other developer working on. Now, i use SwiftFormat with kb shortcut to format on save, but problem is that it bring too much noise in commit.
So i was trying to set SwiftFormat to work only on changes that are made to some file if there is no changes, maybe just lint but do not format whole file.
Is this possible? Can this be a feature to consider if not done already?
Sorry again if i have missed something
Thanks :)
The text was updated successfully, but these errors were encountered: