Note: Our company name was The Funtasty before the rebranding, therefore the name
These are the rules we use for checking our pull requests by Danger optimized for mobile app development:
release/branches can point to master.
- Branch name should have
- Title should be
JIRA-ID Some descriptive namefor
- Should not be work in progress
- Should not be over 500 lines.
- Commit names should start with a large letter and should not be too long.
- iOS specific:
- Swiftlint should not produce any warnings.
- Xcode build should not produce any warnings.
Examples of pretty branch names:
We want to run Danger on CI, so the configuration here is focusing on it.
First, we need to get the GitHub API token for the bot account, which will be commeting our pull requests and set it as an environment variable.
Second, if we do not use other Ruby tools and gems, we need to create Gemfile for our dependencies:
Then we add the Danger rules gem as a dependency:
bundle add thefuntasty_danger
And last if we need to install/update our rules, we only need to call:
After the setup is finished we can simply create
Dangerfile and import this configuration.
For testing locally we can just call:
bundle exec danger local
If we need to automate this (for CI) and do not have other Ruby dependencies then this short script will install everything we need and run Danger (if of course Ruby and bundler are installed):
#!/usr/bin/env bash bundle init bundle add thefuntasty_danger bundle install echo "danger.import_dangerfile(gem: 'thefuntasty_danger')" > Dangerfile bundle exec danger
For deploying to RubyGems run these commands:
gem build thefuntasty_danger gem push thefuntasty_danger-X.X.X.gem
Project is available under the MIT license. See the LICENSE file for more information.