taqtile-dangerjs-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

taqtile-dangerjs-plugin

Build Status npm version semantic-release Code Climate

Taqtile Danger-js Plugin

Environment

  • Use correct node version (from .nvmrc file)
$ nvm use

(If any error is found, install correct node versio via $ nvm install)

  • Install correct yarn version
$ npm install -g yarn@`node -pe "require('./package.json').engines.yarn"`

Install dependencies

$ yarn install

Adding new rules

Add your rules to src/rules folder and its respective tests.

When adding new rules, please follow current scope files for pr, nodejs, android, etc or create a new one in case your rule does not fit in any of the existing ones.

Also, check Danger's guide on Phrasing to understand how to better use error messages to provide an impartial but polite feedback.

What is currently being checked

PR

  • Fail when no description is provided
  • Warns if description provided is too short
  • Big PRs

Platform/Language agnostic

  • >>> Strings to make sure rebase was successful
  • Warn when Dangerfile was modified
  • Warn when http:// is used
  • Warn when definition files were changes but their lockfile weren't:
    • Gemfile vs Gemfile.lock
    • package.json vs yarn.lock
  • Warn if some files/folders were changed/committed:
    • Dangerfile
    • .gitignore
    • Gemfile
    • Gemfile.lock
    • .travis.yml
    • coverage

Node

  • Warn when npm install -g is used
  • Warn when console.log is added
  • Warn when package.json was modified and yarn.lock or shrinkwrap 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 were changed/committed:
    • npm-debug.log
    • yarn-error.log
    • docker-compose.yml
    • tslint.json
    • tsconfig.json
    • .nvmrc
    • Procfile
    • npm-shrinkwrap.json
    • .env
    • .env.test
    • .env.sample
    • env.coffee
    • nodemon.json

iOS

  • Warn if some files/folders to be changed/committed like Cakefile, settings.yml.erb, Fastfile
  • Warn when Podfile was modified and Podfile.lock was not
  • Warn when ATS Exception is set in plist
  • Warn when Landscape orientation is set in plist
  • Warn when pod is being loaded from external git repos
  • Warn if Podfile has pods should not using fixed versions
  • [Swift] Warn if forced unwrapping was found

Android

  • Warn if there are hardcoded dimens different from 0dp on .xml files
  • Warn if there are hardcoded colors on .xml files
  • Warn if there are hardcoded texts on .xml files
  • [Kotlin] Error when !! is found (similar to swift forced unwrap when anything! is found)
  • [Kotlin] Warn if using Any or Any? as return type
  • [Kotlin] Warn if ButterKnife or findViewById are found
  • Warn if some files/folders were changed/committed:
    • Manifest.xml
    • .gradle

Web

  • Warn if CSS files were changed

Nice to have

  • Warn when Amazon Secret Key is hardcoded
  • Warn if changes made in Cakefile may 'break' provisionings and sign certificates configurations
  • Warn when Facebook ID is hardcoded in plist
  • Warn when TODO is added
  • Warn when print(“”) is added
  • Warn when fatalError is added
  • Warn if hardcoded font is used in .xib
  • Warn if hardcoded color is used in .xib

Usage

For danger-js

Install:

yarn add taqtile-dangerjs-plugin --dev

At a glance:

// dangerfile.js
import { schedule } from 'danger'
import taqtileDangerjsPlugin from 'taqtile-dangerjs-plugin'
 
schedule(async() => {
  await taqtileDangerjsPlugin();
})

For peril

Install:

yarn add taqtile-dangerjs-plugin --dev

Add plugin module to json settings:

"settings"{
  "modules": ["taqtile-dangerjs-plugin"]
},

Use it in any peril dangerfile

// dangerfile.js
import { schedule } from 'danger'
import taqtileDangerjsPlugin from 'taqtile-dangerjs-plugin'
 
schedule(async() => {
  await taqtileDangerjsPlugin();
})

Changelog

See the GitHub release history.

Contributing

See CONTRIBUTING.md.

Package Sidebar

Install

npm i taqtile-dangerjs-plugin

Weekly Downloads

2

Version

0.0.4

License

MIT

Unpacked Size

95.6 kB

Total Files

46

Last publish

Collaborators

  • taqtile