Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom header option to generator #158

Merged
merged 2 commits into from
Jul 30, 2020

Conversation

andrewchang-bird
Copy link
Contributor

@andrewchang-bird andrewchang-bird commented Jul 26, 2020

The --header option allows users to inject custom content between the generated file heading and code sections. It supports specifying multiple lines of content like so:

$ mockingbird generate --header '// Header line 1' '// Header line 2'

would produce

//
//  MyAppTests-MyApp.generated.swift
//  MyApp
//
//  Generated by Mockingbird v0.14.0.
//  DO NOT EDIT
//

// Header line 1
// Header line 2

@testable import Mockingbird
@testable import MyApp

The `--header` option allows users to inject custom content between the
generated file heading and code sections. It supports specifying
multiple lines of content like so:

```console
$ mockingbird generate --header '// Header line 1' '// Header line 2'
```

would produce

```swift
//
//  MyAppTests-MyApp.generated.swift
//  MyApp
//
//  Generated by Mockingbird v0.14.0.
//  DO NOT EDIT
//

// Header line 1
// Header line 2

@testable import Mockingbird
@testable import MyApp
```
Copy link
Contributor

@ryanmeisters ryanmeisters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think i was supposed to do this but never got time 😇 YOU ARE THE BEST!! 🙌🏻

@@ -0,0 +1,674 @@
<p align="center">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this file supposed to be here in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use versioned READMEs now, but I forgot to create it during the 0.14 version bump. (This PR adds new generator flags which shows up in the README.)

@andrewchang-bird andrewchang-bird merged commit 4ca199c into typealiased:master Jul 30, 2020
@andrewchang-bird andrewchang-bird deleted the custom-header branch July 30, 2020 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants