百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
Q

quality

> 编程语言
开源

质量是一个工具,它使用社区工具对您的代码进行质量检查,确保您的数字随着时间的推移不会变得更糟。 只需添加 'rake qualit

156 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

质量是一个工具,它使用社区工具对您的代码进行质量检查,确保您的数字随着时间的推移不会变得更糟。 只需添加 'rake qualit

Quality -- code quality ratchet for Ruby

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:

  • bigfiles
  • brakeman
  • bundler_audit
  • cane
  • eslint
  • flake8
  • flay
  • flog
  • jscs
  • pycodestyle
  • punchlist
  • rails_best_practices
  • reek
  • rubocop

How to use - using Docker

See DOCKER.md for info.

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

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

or in your Gemfile:

ruby
group :development do
  gem 'quality'
end

and then:

bash
bundle install

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

ruby
require 'quality/rake/task'

Quality::Rake::Task.new

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

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

  Quality::Rake::Task.new
end

Then run:

bash
rake quality

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

bash
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.

ruby
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:

bash
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. This lock affects both the Docker-based quality gem (helping to ensure build stability for floating major versions) as well as the gem when included directly in your project's gems.

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.

Contributions

This project, as with all others, rests on the shoulders of a broad ecosystem supported by many volunteers doing thankless work, along with specific contributors.

In particular I'd like to call out:

  • Audrey Roy Greenfeld for the cookiecutter tool and associated examples, which keep my many projects building with shared boilerplate with a minimum of fuss.

License

Licensed under the MIT license.

Issues· 29 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言