Giter VIP home page Giter VIP logo

sep-danger's Introduction

Dependency Status Build Status

Sep::Danger

This is based on Danger and helps us automate our code-reviews. Everything is very opionated and aimed only for Rails.

Installation

Add this line to your application's Gemfile:

gem 'sep-danger'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sep-danger

Usage

After you've added gem to Gemfile, just add Dangerfile to root of your project with contents:

danger.import_dangerfile(gem: 'sep-danger')

Features

Releasing new version

  1. be sure to be in master branch
  2. Change version in version file
  3. run rake master_release

Yes, it so simple!

Development

Automate code review process to maximize time on what matters.

Ideas for this, could be found in:

Lead maintainer for this project is @dvdbng

License

The gem is available as open source under the terms of the MIT License.

sep-danger's People

Contributors

dvdbng avatar davydovanton avatar kirkbowers-wt avatar daveed avatar edikgat avatar

Watchers

 avatar Charles avatar Alex Timofeev avatar Carlos Cervantes avatar Joey Cruz avatar James Cloos avatar  avatar David Reiff avatar Gavin Hewitt avatar  avatar

Forkers

fanahova dvdbng

sep-danger's Issues

Check for possible injection attacks in app/models/ folder

Write a check that verifies inerpolation is used in where statements in code of app/models/ folder.

Don’t use standard Ruby interpolation (#{foo}) to insert user inputted strings into ActiveRecord or raw SQL queries. Use the ? character, named bind variables or the ActiveRecord::Sanitization methods to sanitize user input used in DB queries. Mitigates SQL injection attacks.
(c) https://github.com/brunofacca/zen-rails-security-checklist

Check that HTTParty gem will not be used in a code

People tend to use a lot of HTTP wrapper libraries (Faraday, Mechanize, HTTParty and etc) - usually everyone has their own preferences, so codebase is polluted with different types.

I'm highly against HTTParty for now - using Net::HTTP is prefered.

Avoid using #shuffle in code

Array#shuffle.first vs Array#sample code

Array#shuffle allocates an extra array.
Array#sample indexes into the array without allocating an extra array.
This is the reason why Array#sample exists.
—— @sferik rails/rails#17245

$ ruby -v code/array/shuffle-first-vs-sample.rb
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]

Calculating -------------------------------------
Array#shuffle.first 25.406k i/100ms
Array#sample 125.101k i/100ms

Array#shuffle.first 304.341k (± 4.3%) i/s - 1.524M
Array#sample 5.727M (± 8.6%) i/s - 28.523M

Comparison:
Array#sample: 5727032.0 i/s
Array#shuffle.first: 304341.1 i/s - 18.82x slower

https://github.com/JuanitoFatas/fast-ruby

Fix "debugging code found" issue

Right now Danger throws a "Debugging code found - puts" in every check; let's limit the scan to files changed in this PR, not the whole project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.