GithubHelp home page GithubHelp logo

krausefx / callisto Goto Github PK

View Code? Open in Web Editor NEW

This project forked from patrick-kladek/callisto

0.0 2.0 0.0 203 KB

Parse Clang Static Analyzer messages and pass them to Slack

License: MIT License

Swift 100.00%

callisto's Introduction

Callisto

Twitter: @PatrickKladek License alt text

Logo

Clang Static Analyzer is great, it catches lots of potential bugs and errors in your code. It has one downside though: running the Clang Static Analyzer every time you build your project takes a lot of time, and we all could use some shorter build times. Callisto solves this problem, as it allows you to run the Clang Static Analyzer on your build server (e.g. BuildKite) and posts the results to our favorite messaging tool Slack.

#!/bin/bash

fastlane ios static_analyze 2>&1 | tee /tmp/fastlane_iOS_Output.txt
Callisto -fastlane "/tmp/fastlane_iOS_Output.txt" \
-slack "<SLACK_WEBHOOK_URL>" \
-branch "$BUILDKITE_BRANCH" \
-githubUsername "<GITHUB_USERNAME>" \
-githubToken "<GITHUB_TOKEN>" \
-githubOrganisation "<GITHUB_ORGANISATION>" \
-githubRepository "<GITHUB_REPOSITORY>" \
-ignore "todo, -Wpragma"

fastlane static_analyze lane:

The important thing here is xcargs: "analyze". If you don't want to run the static analyzer and only post build errors & warnings to slack just remove the "analyze" from xcargs.

platform :ios do
    desc "Build and run the static Analyzer"
    lane :staticAnalyze do
        scan(
             devices: [
                "iPhone 6s"
             ],
             clean: true,
             workspace: "MyWorkspace.xcworkspace",
             scheme: "MyProject for iOS",
             xcargs: "analyze"
        )
    end
end

Parameters

  • -slack: create a Slack Webhook URL and pass it as a parameter to Callisto, to enable posting to Slack
  • -branch: when using BuildKite you can simply pass the environment variable "$BUILDKITE_BRANCH"
  • -githubUsername: The username of a GitHub account that has access to your repository
  • -githubToken: The recommended way to safely connect to GitHub: create a token for your user
  • -githubOrganisation: needed to create the correct URL for communicating with GitHub
  • -githubRepository: needed to create the correct URL for communicating with GitHub
  • -ignore: pass keywords which should be excluded from your Slack report, e.g. you can exclude "todo"

How does it work?

Callisto simply parses the output from fastlane, which mostly pipes through the Clang Static Analyzer messages from the compiler. By filtering these messages and reformatting them Callisto is able to post only the relevant information to Slack. In addition to that, if you enable GitHub-Checks you can also block Pull Request from being merged, if Callisto finds an issue in your code.

Callisto is brought to you by IdeasOnCanvas, the creator of MindNode for iOS, macOS & watchOS.

callisto's People

Contributors

aquarius avatar myell0w avatar patrick-kladek avatar

Watchers

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