Code Monkey home page Code Monkey logo

Comments (6)

nicklockwood avatar nicklockwood commented on June 11, 2024

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.

zeljkomarinkovic avatar zeljkomarinkovic commented on June 11, 2024

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.

insha avatar insha commented on June 11, 2024

@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.

zeljkomarinkovic avatar zeljkomarinkovic commented on June 11, 2024

Sounds wonderful, just what im looking for. Please share :)

from swiftformat.

insha avatar insha commented on June 11, 2024

@zeljkomarinkovic Here's the repo.

from swiftformat.

zeljkomarinkovic avatar zeljkomarinkovic commented on June 11, 2024

@insha thanks, will put it to a good use :) Thanks

from swiftformat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.