Giter Site home page Giter Site logo

komondor's Introduction

Komondor

Git Hook automation for Swift and Xcode projects. A port of Husky to Swift.

TL:DR

  1. Add or amend a Package.swift
  2. Add this dependency .package(url: "https://github.com/shibapm/Komondor.git", from: "1.0.0"),
  3. Run the install command: swift run komondor install
  4. Add a config section to your Package.swift

Then you'll get git-hooks consolidated and centralized so that everyone can work with the same tooling.

Why?

If you care about something, you should automate it.

Git Hooks like what Komondor provides gives you more surface area for per-project automation. Komondor provides an easily understood way to see how all the git automation touch-points in your project will come together. These hooks allow for much faster feedback during development and let different team-members to use different tools but still have the same bar of quality.

For example, adding SwiftFormat to your pre-commit hook means that no-one will ever need to discuss formatting in code review again. Perfect. It won't slow down your Xcode builds, because it lives outside of your project and you can verify it on CI if you'd like to be 100% that everyone conforms.

Another example, running tests before pushing - this means you don't have to come back 10-15m later once CI has told you that you have a failing test. This moves more validation to a point where you are still in-context.

An Example

This is from the repo you're looking at:

#if canImport(PackageConfig)
    import PackageConfig

    let config = PackageConfiguration([
        "komondor": [
            "pre-push": "swift test",
            "pre-commit": [
                "swift test",
                "swift run swiftformat .",
                "swift run swiftlint autocorrect --path Sources/",
                "git add .",
            ],
        ],
    ]).write()
#endif

See more about the config here.

Getting Set up

On a SwiftPM project On an Xcode Project

Deployment

Use swift run rocket [patch]

komondor's People

Contributors

cszatmary avatar daneov avatar dirtyhenry avatar duemunk avatar f-meloni avatar leogdion avatar orta avatar sahara-ooga avatar

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.