Danger base file for Taqtile projects
On your project root folder:
- Create a
Gemfile
with
source "https://rubygems.org"
gem "danger", "4.2.1"
- Execute
$ bundle install
- Create a
Dangerfile
with
@platform = "nodejs" # Possible platforms are "nodejs", "ios", "android" and "web"
danger.import_dangerfile(github: "indigotech/danger")
To execute Danger on your project referencing a local file instead of Github you can use the following command
danger.import_dangerfile(path: "/absolute/path/to/your/Dangerfile-folder")
There are currently two ways of working with your dangerfile locally
- Run danger locally against a PR on github
$ bundle exec danger pr <link to github PR>
- Run danger locally against the last merged PR on the current branch. Please note that Danger detects the last merged PR, and not the last merge. So you'll need to have a PR setup on github anyways.
$ bundle exec danger local
- Add angithub access token as
DANGER_GITHUB_API_TOKEN
environment variable to enableDanger
to access Github PR and add comments.
- If you already have a token variable you can use something like the following:
export DANGER_GITHUB_API_TOKEN=$YOUR_CURRENT_GITHUB_TOKEN_VARIABLE
- To execute on CI, add the following command preferably before building your code and after the environment variable was defined.
$ bundle exec danger --dangerfile=path/to/Dangerfile
- Warn if some files/folders to be changed/committed like
.gitignore
,Gemfile
,Gemfile.lock
,.travis.yml
-
>>>
Strings to make sure rebase was successful - Big PRs
- Warn when
Gemfile
was modified andGemfile.lock
was not - Fail when no description is provided
- Warn when Amazon Secret Key is hardcoded
- Warn when
Dangerfile
was modified - Warn when
http://
is used
- Warn if some files/folders to be changed/committed like
yarn.lock
,docker-compose.yml
,Procfile
,npm-shrinkwrap.json
,node_modules
,env.coffee
- Warn when
npm install -g
is used - Warn when
.env
or.nvmrc
files are modified - Warn when
console.log
is added - Warn when
package.json
was modified andyarn.lock
orshrinkwrap
was not - Warn if node version is different between .travis.yml, .nvmrc, package.json and README (or just warn if node version has change just in one of these locations)
- At packages.json every package should have its version fixed (do not use ^ or ~), or explicitly set the major and minor versions (ie.: 1.2.x)
- [TypeScript] Warn if using
<any>
as return type.
- Warn if some files/folders to be changed/committed like
Cakefile
,settings.yml.erb
,Fastfile
- Warn when
Podfile
was modified andPodfile.lock
was not - Warn if changes made in Cakefile may 'break' provisionings and sign certificates configurations
- Warn when ATS Exception is set in plist
- Warn when Landscape orientation is set in plist
- Warn when Facebook ID is hardcoded in plist
- Warn when pod is being loaded from external git repos
- Warn when
TODO
is added - Warn when
print(“”)
is added - Warn when
fatalError
is added - Warn if Podfile has pods should not using fixed versions
- [Swift] Warn if forced unwrapping was found
- Warn if hardcoded font is used in
.xib
- Warn if hardcoded color is used in
.xib
- Warn when
.gradle
orManifest.xml
files are modified
- Warn if some files/folders to be changed/committed like
yarn.lock
,docker-compose.yml
,Procfile
,npm-shrinkwrap.json
,node_modules
,env.coffee
- Warn when
npm install -g
is used - Warn when
.env
or.nvmrc
files are modified - Warn when
console.log
is added - Warn when
package.json
was modified andyarn.lock
orshrinkwrap
was not - Warn if node version is different between .travis.yml, .nvmrc, package.json and README (or just warn if node version has change just in one of these locations)
- At packages.json every package should have its version fixed (do not use ^ or ~), or explicitly set the major and minor versions (ie.: 1.2.x)
- [TypeScript] Warn if using
<any>
as return type. - Warn if CSS files were changed
Local repository was not found on GitHub. If you're trying to test a private repository please provide a valid API token through DANGER_GITHUB_API_TOKEN environment variable.
- Create a github Personal Access Token
- Export it to an environment variable
$ export DANGER_GITHUB_API_TOKEN=your token here