Skip to content
Quality is a tool that runs quality checks on your code using community tools, and makes sure your numbers don't get any worse over time. Just add 'rake quality' as part of your Continuous Integration.
Ruby Python Dockerfile Shell Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
bin Fix Python 3 issue May 28, 2019
coverage Break up circular dependency on Threshold class (#139) Jan 4, 2020
etc Add Sep 24, 2016
feature Run RSpec specs and features as part of build (#133) Jan 2, 2020
lib/quality Remove fork of pronto-flake8 (#142) Jan 5, 2020
metrics Ratchet bigfiles (#136) Jan 2, 2020
rakelib Add pronto-bigfiles in Docker image (#140) Jan 4, 2020
sample-project
spec
test/unit
.codeclimate.yml Add rubocop-minitest and rubocop-rake plugins (#130) Jan 1, 2020
.gitignore
.hound.yml HoundCI: SHUT UP SHUT UP SHUT UP Sep 10, 2016
.pronto.yml
.rubocop.yml
.ruby-version
.travis.yml Break up circular dependency on Threshold class (#139) Jan 4, 2020
CONFIGURATION.md
ChangeLog.md Prep release (#143) Jan 5, 2020
DOCKER.md
Dockerfile
Gemfile
License.txt Initial version Aug 11, 2013
Makefile Run RSpec specs and features as part of build (#133) Jan 2, 2020
README.md
Rakefile
TODO Kill whitespace Apr 27, 2014
entrypoint.sh
foo.js Temp Sep 9, 2016
mitch.tishmack@gmail.com-55881c97.rsa.pub
publish-docker-image.sh
quality.gemspec Add pronto-bigfiles in Docker image (#140) Jan 4, 2020

README.md

Quality -- code quality ratchet for Ruby

Build Status

Overview

Quality is a tool that runs quality checks on code in git repos using different analysis tools and makes sure your numbers don't get any worse over time.

Why

See this post or these slides for more information on the problem the quality gem solves.

Tools

Quality makes use of the following other tools, which do the actual checking:

How to use - using Docker

See DOCKER.md for info.

How to use - as part of a Ruby-based Rakefile

pip install flake8
brew install cmake icu4c shellcheck scalastyle # macOS
gem install quality

or in your Gemfile:

group :development do
  gem 'quality'
end

and then:

bundle install

Once you have the gem, configure your Rakefile like this:

require 'quality/rake/task'

Quality::Rake::Task.new

If you're using Rails, you must check your environment in your Rakefile.

if Rails.env.development?
  require 'quality/rake/task'

  Quality::Rake::Task.new
end

Then run:

rake quality

If you want to ratchet up the quality and force yourself to improve code, run:

rake ratchet

Configuration options

See CONFIGURATION.md

Pronto

To help better understand which warnings came from your current set of changes, consider using Pronto, which provides incremental reporting from different quality tools, and can add comments directly to PR reviews. You can see an example in this project's Rakefile

Vendored files

Quality uses GitHub's linguist gem to find and classify source files to analyze. In addition to the exclude_files and source_files_exclude_glob options in Quality, you can refer to Linguists's documentation on overrides to use the gitattributes file to mark files as vendored, at which point Quality will not try to analyze them.

Code coverage

You can pull a similar trick with code coverage using SimpleCov in Ruby--put 'simplecov' in your Gemfile, and add the code below into your test_helper.rb or spec_helper.rb.

require 'simplecov'
SimpleCov.start
SimpleCov.refuse_coverage_drop

After your first run, check in your coverage/.last_run.json.

Build

On OS X, you may see build failures in charlock_holmes. To work around, if you are using Homebrew:

bundle config build.charlock_holmes --with-cxxflags=-std=c++11 --with-icu-dir=/usr/local/opt/icu4c

Caveats

Quality uses semantic versioning--any incompatible changes (including new tools being added) will come out as major number updates.

This includes RuboCop upgrades - the quality gem locks in a specific minor version of RuboCop to avoid your metrics being bumped and breaking your build.

Expect your build to break on major upgrades if you use RuboCop.

Supported Ruby Versions

Tested against Ruby >=2.2--does not support Ruby 1.9.x or JRuby.

Contributing

  • Fork the repo
  • Create a feature branch
  • Submit a github pull request

Many thanks to all contributors, especially @andyw8, who has contributed some great improvements.

License

Licensed under the MIT license.

You can’t perform that action at this time.