GithubHelp home page GithubHelp logo

warder's Introduction

Warder

Build Status Code Climate Dependency Status

Getting started

Main goal of this project was to provide you tool, which will help make code better. I used these tools for a while and can provide some tips.

Just to start with warder, it would be great to do something simple. And I will recommend to start with checking your bundle for security issues

$ warder --bundle-audit

Sooner or later you will start with code cleanup. There are two main ways to deal with it, depending what you plan to achieve. If you are interested in clean code, according to style guides, you may want to use

$ warder --style-guide

But if you want to see you code OOP-friendly, then you need different approach

$ warder --code-smell

Next steps for stylish code are:

$ warder --magick-numbers
$ warder --code-duplication

And for OOP-style code next steps will be:

$ warder --code-complexity

Then you can apply everything is left. But I strongly recommend to add validations one by one, right after all issues are fixed from previous one. Now it is not possible to compare results on feature branches without scripting, so you must be careful, if you want to use all suitable validators and results are not as good as it can be.

There are few rails specific validators, but the rules are the same. Security is the first priority:

$ warder --rails-security

You may also want to see some advice, regarding rails best practices:

$ warder --rails-advice

but be careful with it, some reported advices may conflict with another validators.

You may also see, how your rails app meets Sandi Metz rules:

$ warder --sandi-rules

You can validate not only ruby files, but also coffeescript files:

$ warder --coffee-lint

Installation

Add this line to your application's Gemfile:

gem 'warder'

And then execute:

$ bundle

Or install it yourself as:

$ gem install warder

Usage

First of all, RTFM!

$ warder --help

to see all supported scanners. If you are too lazy, you will be confused with results.

$ warder

to see that everything is good (actually no one validator used) and you don't need to fix any issues :)

You also can use shortcuts:

$ warder --all

to run all validations, even ones you don't really need.

To run only rails related validations:

$ warder --rails

or to validate your ruby project:

$ warder --all --no-rails

if you so tired looking at your code issues, you can use silent mode

$ warder --quiet

and you just will get result by exit code.

But if you, or your CI is really interested in statistics, there is statistics mode for you:

$ warder --quiet --stats

if you working on multiple projects, you can pass path to another project as an argument:

$ warder --quiet /path/to/another/project

The best thing I can do with warder is validate project itself, so anyone can see, that it is not so hard to write good ruby code. Just check build status on Travis CI.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

warder's People

Contributors

yltsrc avatar

Watchers

James Cloos avatar

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.