profile
viewpoint
Michael Bachand bachand @airbnb San Francisco, CA iOS infrastructure @airbnb. Co-created @airbnb's Apple TV app and Design Language System. Formerly: CalPal, @Microsoft, @PrincetonUniversity

airbnb/ResilientDecoding 487

This package makes your Decodable types resilient to decoding errors and allows you to inspect those errors.

airbnb/BuckSample 306

An example app showing how Buck can be used to build a simple iOS app.

lelandrichardson/recoil 180

Swift and Kotlin ports of React (Prototype)

airbnb/apple-tv-auth 42

Example application to demonstrate how to build Apple TV style authentication.

dfed/CacheAdvance 22

A performant cache for logging systems. CacheAdvance persists log events 30x faster than SQLite.

fdiaz/SwiftInspector 3

SwiftInspector is a command line tool built on top of SwiftSyntax to help inspect usage of Swift code

bachand/battlestation 2

How I set up my battlestation

bachand/YouTubeCLI 2

A CLI tool to query YouTube.

bachand/AloeStackView 1

A simple class for laying out a collection of views with a convenient API, while leveraging the power of Auto Layout.

bachand/apollo-ios 1

📱 A strongly-typed, caching GraphQL client for iOS, written in Swift

Pull request review commentairbnb/swift

Reintroduce old wrapping rules

 _You can enable the following settings in Xcode by running [this script](resourc   ```    </details>+  +* <a id='long-function-declaration'></a>(<a href='#long-function-declaration'>link</a>) **Separate [long](https://github.com/airbnb/swift#column-width) function declarations with line breaks before each argument label and before the return signature.** Put the open curly brace on the next line so the first executable line doesn't look like it's another parameter. [![SwiftFormat: wrapArguments](https://img.shields.io/badge/SwiftFormat-wrapArguments-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/master/Rules.md#wrapArguments) [![SwiftFormat: wrapMultilineStatementBraces](https://img.shields.io/badge/SwiftFormat-wrapMultilineStatementBraces-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/master/Rules.md#wrapMultilineStatementBraces)

I think this and the following rule would be more at home in the Functions section than in the Closures section.

Screen Shot 2020-07-30 at 1 44 13 PM

calda

comment created time in 10 days

Pull request review commentairbnb/swift

Reintroduce old wrapping rules

 _You can enable the following settings in Xcode by running [this script](resourc   ```    </details>+  +* <a id='attributes-on-prev-line'></a>(<a href='#attributes-on-prev-line'>link</a>) **Place function/type attributes on the line above the declaration**. [![SwiftFormat: wrapAttributes](https://img.shields.io/badge/SwiftFormat-wrapAttributes-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/master/Rules.md#wrapAttributes)++  <details>++  ```swift+  // WRONG+  @objc class Spaceship: NSObject {

Let's remove NSObject to enter the modern era.

calda

comment created time in 10 days

Pull request review commentairbnb/swift

Reintroduce old wrapping rules

 _You can enable the following settings in Xcode by running [this script](resourc   ```    </details>+  +* <a id='long-function-declaration'></a>(<a href='#long-function-declaration'>link</a>) **Separate [long](https://github.com/airbnb/swift#column-width) function declarations with line breaks before each argument label and before the return signature.** Put the open curly brace on the next line so the first executable line doesn't look like it's another parameter. [![SwiftFormat: wrapArguments](https://img.shields.io/badge/SwiftFormat-wrapArguments-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/master/Rules.md#wrapArguments) [![SwiftFormat: wrapMultilineStatementBraces](https://img.shields.io/badge/SwiftFormat-wrapMultilineStatementBraces-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/master/Rules.md#wrapMultilineStatementBraces)++  <details>++  ```swift+  class Universe {++    // WRONG+    func generateStars(at location: Point, count: Int, color: StarColor, withAverageDistance averageDistance: Float) -> String {+      // This is too long and will probably auto-wrap in a weird way+    }++    // WRONG+    func generateStars(at location: Point,+                       count: Int,+                       color: StarColor,+                       withAverageDistance averageDistance: Float) -> String+    {+      // Xcode indents all the arguments+    }++    // WRONG+    func generateStars(+      at location: Point,+      count: Int,+      color: StarColor,+      withAverageDistance averageDistance: Float) -> String {+      populateUniverse() // this line blends in with the argument list+    }++    // WRONG+    func generateStars(+      at location: Point,+      count: Int,+      color: StarColor,+      withAverageDistance averageDistance: Float) throws+      -> String {+      populateUniverse() // this line blends in with the argument list+    }++    // RIGHT+    func generateStars(+      at location: Point,+      count: Int,+      color: StarColor,+      withAverageDistance averageDistance: Float) +      -> String+    {+      populateUniverse()+    }++    // RIGHT+    func generateStars(+      at location: Point,+      count: Int,+      color: StarColor,+      withAverageDistance averageDistance: Float) +      throws -> String+    {+      populateUniverse()+    }+  }+  ```++  </details>++* <a id='long-function-invocation'></a>(<a href='#long-function-invocation'>link</a>) **[Long](https://github.com/airbnb/swift#column-width) function invocations should also break on each argument.** Put the closing parenthesis on the last line of the invocation. [![SwiftFormat: wrapArguments](https://img.shields.io/badge/SwiftFormat-wrapArguments-7B0051.svg)](https://github.com/nicklockwood/SwiftFormat/blob/master/Rules.md#wrapArguments)++  <details>++  ```swift+  universe.generateStars(

Can we update this with a WRONG and RIGHT while we're here?

calda

comment created time in 10 days

Pull request review commentairbnb/swift

Reintroduce old wrapping rules

 _You can enable the following settings in Xcode by running [this script](resourc    </details> -* <a id='spaces-over-tabs'></a>(<a href='#spaces-over-tabs'>link</a>) **Use 2 spaces to indent lines.**

👌

calda

comment created time in 10 days

pull request commentairbnb/BuckSample

Add rake to Gemfile (for BuckLocal)

@andre-alves-ifood are you able to merge? If not one of the collaborators can help.

andre-alves-ifood

comment created time in a month

issue commentairbnb/swift

Long function invocations should also break on each argument

@calda good find. I think --wraparguments before-first --closingparen same-line would be perfect! I’d love to have this rule back in the style guide.

fdiaz

comment created time in a month

pull request commentairbnb/BuckSample

Open source Buck Local

Awesome @xianwen. Thanks for addressing my feedback and, more importantly, for making this technology available to the community. I think that a lot of teams could benefit from this work, and the ideas behind it.

xianwen

comment created time in a month

Pull request review commentairbnb/BuckSample

Open source Buck Local

 apple_bundle(     product_name = "ExampleApp",     info_plist = "Info.plist",     info_plist_substitutions = info_plist_substitutions("ExampleApp"),-    deps = [+    native_xcode_deps=prebuilt_frameworks + [         # For "#watch", https://buckbuild.com/rule/apple_bundle.html#deps         ":ExampleWatchApp#watch",         ":ExampleMessageExtension"-    ]-    + prebuilt_frameworks,+    ],+    buck_local_deps=prebuilt_frameworks,

Yes, not a priority today 👍

xianwen

comment created time in a month

pull request commentairbnb/BuckSample

Open source Buck Local

(My comments are not blocking)

xianwen

comment created time in a month

Pull request review commentairbnb/BuckSample

Open source Buck Local

+.

Do we need this?

xianwen

comment created time in a month

Pull request review commentairbnb/BuckSample

Open source Buck Local

+require 'English'+require 'open3'+require 'fileutils'++# Wrap text in terminal color codes+module Color

It could be cool to put this code into a Ruby get that we host on public Github so we can share the code between our public and private repos.

xianwen

comment created time in a month

Pull request review commentairbnb/BuckSample

Open source Buck Local

+# require 'tooling/buck/buckbuilder'+# require 'tooling/buck_cache_parser'+# require 'tooling/path'+# require 'tooling/files'++require 'buck_log_formatter'+require 'common'+require 'json'+require 'fileutils'++module BuckLocal

I think one day this could grown into a Swift command line tool

xianwen

comment created time in a month

Pull request review commentairbnb/BuckSample

Open source Buck Local

+#!/bin/bash

Sometimes Bash is the best tool for the job.

xianwen

comment created time in a month

Pull request review commentairbnb/BuckSample

Open source Buck Local

+</dict>+</dict>+</plist>

Do we need this?

xianwen

comment created time in a month

Pull request review commentairbnb/BuckSample

Open source Buck Local

+# Build all libraries via Buck, and copy over the artifacts to DerivedData so they can be used by Xcode.+xcode_prebuild_script(

Can you help me understand why this is a pre-build step? I'd expect it to be a post-build step.

xianwen

comment created time in a month

Pull request review commentairbnb/BuckSample

Open source Buck Local

 apple_bundle(     product_name = "ExampleApp",     info_plist = "Info.plist",     info_plist_substitutions = info_plist_substitutions("ExampleApp"),-    deps = [+    native_xcode_deps=prebuilt_frameworks + [         # For "#watch", https://buckbuild.com/rule/apple_bundle.html#deps         ":ExampleWatchApp#watch",         ":ExampleMessageExtension"-    ]-    + prebuilt_frameworks,+    ],+    buck_local_deps=prebuilt_frameworks,

I hope we can get watch and iMessage working some day.

xianwen

comment created time in a month

Pull request review commentairbnb/BuckSample

Open source Buck Local

 apple_test_all(     prebuilt_frameworks = prebuilt_frameworks, ) -xcode_workspace_config(+buck_local_workspace(     name = "workspace",     workspace_name = "ExampleApp",     src_target = ":ExampleApp",-    additional_scheme_actions = {+    native_xcode_scheme_actions={

Much better name 👌

xianwen

comment created time in a month

issue openedairbnb/BuckSample

Add example of App Clip

When we can support Xcode 12 in CI let's add an example of multiple App Clips, so we can learn how that will work.

created time in a month

push eventbachand/battlestation

Michael Bachand

commit sha 4ed13106de0ddb64742894e16b08d89841ac1d90

disable rerere

view details

push time in 2 months

push eventbachand/YouTubeCLI

Michael Bachand

commit sha 91f422f68768d3262f6d1c38c62a9e4dc36297bc

Update README.md

view details

push time in 2 months

push eventbachand/YouTubeCLI

Michael Bachand

commit sha fb14753a2625ed4a95238206700a809489e3883e

Update README.md

view details

push time in 2 months

issue openedbachand/YouTubeCLI

Gracefully handling exceeding the quota

When you exceed your quota you get an error like this:

Reponse: {
  "error": {
    "code": 403,
    "message": "The request cannot be completed because you have exceeded your \u003ca href=\"/youtube/v3/getting-started#quota\"\u003equota\u003c/a\u003e.",
    "errors": [
      {
        "message": "The request cannot be completed because you have exceeded your \u003ca href=\"/youtube/v3/getting-started#quota\"\u003equota\u003c/a\u003e.",
        "domain": "youtube.quota",
        "reason": "quotaExceeded"
      }
    ]
  }
}

What happens now is that we will try to decode this error as a response and then fail with an obscure decoding error.

Instead, when we fail to decode a valid response maybe we should fall back to trying to decode this error.

created time in 2 months

startedbachand/YouTubeCLI

started time in 2 months

push eventbachand/YouTubeCLI

Michael Bachand

commit sha afa0382bc7354b0a87c40b52668ab660ea1a1a6a

Add gitignore

view details

Michael Bachand

commit sha cc62a783a0bce4b333d7fc7108487ec464fa5da1

Add CI

view details

push time in 2 months

push eventbachand/YouTubeCLI

Michael Bachand

commit sha 86fea8f91c563a6187bb6738ed05dae58861a9de

Initial commit

view details

push time in 2 months

create barnchbachand/YouTubeCLI

branch : master

created branch time in 2 months

created repositorybachand/YouTubeCLI

A CLI tool to query YouTube.

created time in 2 months

delete branch bachand/battlestation

delete branch : mb--add-github-ci

delete time in 2 months

push eventbachand/battlestation

Michael Bachand

commit sha 94fb93244ed7460eff2e5203e0fa185496dc779b

Update Gemfile

view details

Michael Bachand

commit sha 25820e5c32c4c836e4c85fe9b68c3ac4315637d8

Update gems

view details

Michael Bachand

commit sha c4a8aabe1512c921dc37ee6c4e52b4227d086f9d

Simplify and standardize rpsec

view details

Michael Bachand

commit sha eea86a0d98ceb2d78b75942e7e735ed891fe8acb

Add github CI file

view details

Michael Bachand

commit sha 7203978e5e8cd284cd69c9c47f0cc71d609e5be8

Remove circle CI

view details

Michael Bachand

commit sha 57343c83f42b18f4f3ee8fce7f3f1a0fb70fa5fe

Remove circle ci badge

view details

Michael Bachand

commit sha 9347fbb676613ad4886c7bd424de06f4dd9d3238

Merge pull request #7 from bachand/mb--add-github-ci Set up CI on GitHub Actions

view details

push time in 2 months

Pull request review commentbachand/battlestation

Set up CI on GitHub Actions

+# This workflow uses actions that are not certified by GitHub.+# They are provided by a third-party and are governed by+# separate terms of service, privacy policy, and support+# documentation.+# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake+# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby++name: Ruby++on:+  push:+    branches: [ master ]+  pull_request:+    branches: [ master ]++jobs:+  test:++    runs-on: ubuntu-latest++    steps:+    - uses: actions/checkout@v2+    - name: Set up Ruby+      # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,+      # (see https://github.com/ruby/setup-ruby#versioning):+      uses: ruby/setup-ruby@v1

No need to specify a Ruby version if you have .ruby-version file.

bachand

comment created time in 2 months

push eventbachand/battlestation

Michael Bachand

commit sha 57343c83f42b18f4f3ee8fce7f3f1a0fb70fa5fe

Remove circle ci badge

view details

push time in 2 months

push eventbachand/battlestation

Michael Bachand

commit sha 7203978e5e8cd284cd69c9c47f0cc71d609e5be8

Remove circle CI

view details

push time in 2 months

PR opened bachand/battlestation

Set up CI on GitHub Actions
+47 -21

0 comment

5 changed files

pr created time in 2 months

create barnchbachand/battlestation

branch : mb--add-github-ci

created branch time in 2 months

push eventbachand/battlestation

Michael Bachand

commit sha 2a7216d4cfe20dc24e61dd9367bcf8581c940ecb

Make alias for vim

view details

push time in 2 months

issue commentairbnb/swift

Prefer AnyObject over class in protocol definitions

@gsabran could you put up a PR?

gsabran

comment created time in 2 months

startedairbnb/HorizonCalendar

started time in 2 months

delete branch bachand/battlestation

delete branch : mb--set-up-rbenv-in-zshenv

delete time in 3 months

PR closed bachand/battlestation

Set up Rbenv in zshenv

This was necessary to get Tasks to work in VS Code.

I moved this setup to my zshrc to fix an issue (see https://github.com/bachand/battlestation/commit/1e17bddc201c6c0ddf57c1b700f33b53532f8699).

I need to figure out what that issue was, and resolve it another way.

+9 -9

1 comment

2 changed files

bachand

pr closed time in 3 months

pull request commentbachand/battlestation

Set up Rbenv in zshenv

Actually I found a workaround for now.

bachand

comment created time in 3 months

PR opened bachand/battlestation

Set up Rbenv in zshenv

This was necessary to get Tasks to work in VS Code.

I moved this setup to my zshrc to fix an issue (see https://github.com/bachand/battlestation/commit/1e17bddc201c6c0ddf57c1b700f33b53532f8699).

I need to figure out what that issue was.

+9 -9

0 comment

2 changed files

pr created time in 3 months

create barnchbachand/battlestation

branch : mb--set-up-rbenv-in-zshenv

created branch time in 3 months

Pull request review commentairbnb/ResilientDecoding

Enable custom types to report errors via ResilientDecodingErrorReporter

 Pod::Spec.new do |s|   s.name     = 'ResilientDecoding'-  s.version  = '1.0.2'+  s.version  = '1.0.3'

I agree.

GeorgeLyon

comment created time in 3 months

pull request commentairbnb/ResilientDecoding

Enable custom types to report errors via ResilientDecodingErrorReporter

That said, there are use cases that Resilient does not explicitly support that can still benefit from reporting non-failure errors

@GeorgeLyon could you provide an example of one of these use cases?

GeorgeLyon

comment created time in 3 months

more