Comments (6)
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.
from swiftformat.
When you say that you are running via a keyboard shortcut, do you mean running the command line tool, or the Xcode extension?
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.
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
from swiftformat.
@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.
from swiftformat.
Sounds wonderful, just what im looking for. Please share :)
from swiftformat.
@zeljkomarinkovic Here's the repo.
from swiftformat.
@insha thanks, will put it to a good use :) Thanks
from swiftformat.
Related Issues (20)
- `enumNamespaces` applies even to types with macros attached HOT 4
- Missing version 0.53.2
- redundanttype rule is not smart enough HOT 1
- Option idea for rule `wrapMultilineConditionalAssignment`
- Hoist try error with multi line string HOT 1
- Lots of issues with `nonisolated(unsafe)` HOT 5
- Universal build fails with `error: duplicate key found: '<ResolvedTarget: CommandLineTool>'`
- Capture Lists and `--wrapcollections` HOT 3
- hoistAwait misbehaves in async auto closures HOT 2
- SwiftFormat creating incorrect SwiftData code: "A default value requires a fully qualified domain named value" HOT 3
- `blankLineAfterImports` rule works incorrectly with `internal` and `private` keywords HOT 1
- warning: Failed to write cache file at ..swiftformat.cache. HOT 5
- Rule idea: computed vars over functions with 0 arguments HOT 1
- False positive with `spaceAroundBrackets` for consuming or borrowing array parameter HOT 4
- Format rule --allman false HOT 2
- Breaks the code by removing needed parentheses for generic parameter packs HOT 1
- `wrapEnumCases` breaks for associated values when `case` is on different line HOT 1
- Really strange permission problem HOT 1
- How I can setup indentation for empty lines? HOT 2
- Breaks code by introducing a space in a function attribute HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiftformat.