• Stars
    star
    121
  • Rank 283,693 (Top 6 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 4 years ago
  • Updated 26 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Code style checking for Minitest files.

RuboCop Minitest

Gem Version CircleCI

A RuboCop extension focused on enforcing Minitest best practices and coding conventions. The library is based on the guidelines outlined in the community Minitest Style Guide.

Installation

Just install the rubocop-minitest gem

$ gem install rubocop-minitest

or if you use bundler put this in your Gemfile

gem 'rubocop-minitest', require: false

Usage

You need to tell RuboCop to load the Minitest extension. There are three ways to do this:

RuboCop configuration file

Put this into your .rubocop.yml.

require: rubocop-minitest

Alternatively, use the following array notation when specifying multiple extensions.

require:
  - rubocop-other-extension
  - rubocop-minitest

Now you can run rubocop and it will automatically load the RuboCop Minitest cops together with the standard cops.

Command line

$ rubocop --require rubocop-minitest

Rake task

RuboCop::RakeTask.new do |task|
  task.requires << 'rubocop-minitest'
end

The Cops

All cops are located under lib/rubocop/cop/minitest, and contain examples/documentation. The documentation is published here.

In your .rubocop.yml, you may treat the Minitest cops just like any other cop. For example:

Minitest/AssertNil:
  Exclude:
    - test/my_file_to_ignore_test.rb

Documentation

You can read a lot more about RuboCop Minitest in its official docs.

Readme Badge

If you use RuboCop Minitest in your project, you can include one of these badges in your readme to let people know that your code is written following the community Minitest Style Guide.

Minitest Style Guide

Minitest Style Guide

Here are the Markdown snippets for the two badges:

[![Minitest Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop-minitest)

[![Minitest Style Guide](https://img.shields.io/badge/code_style-community-brightgreen.svg)](https://minitest.rubystyle.guide)

Contributing

Checkout the contribution guidelines.

License

rubocop-minitest is MIT licensed. See the accompanying file for the full text.

More Repositories

1

ruby-style-guide

A community-driven Ruby coding style guide
16,361
star
2

rubocop

A Ruby static code analyzer and formatter, based on the community Ruby style guide.
Ruby
12,486
star
3

rails-style-guide

A community-driven Ruby on Rails style guide
6,432
star
4

rspec-style-guide

Best practices for writing your specs!
942
star
5

rubocop-rspec

Code style checking for RSpec files
Ruby
778
star
6

rubocop-rails

A RuboCop extension focused on enforcing Rails best practices and coding conventions.
Ruby
764
star
7

rubocop-performance

An extension of RuboCop focused on code performance checks.
Ruby
615
star
8

guard-rubocop

Guard plugin for RuboCop
Ruby
261
star
9

rubocop-emacs

An Emacs interface for RuboCop
Emacs Lisp
128
star
10

rubocop-ast

RuboCop's AST extensions and NodePattern functionality
Ruby
93
star
11

rubocop-rake

A RuboCop plugin for Rake
Ruby
71
star
12

rubocop-md

RuboCop for Markdown code snippets
Ruby
70
star
13

minitest-style-guide

Best practices for writing your tests
66
star
14

rubocop-jp

A place for RuboCop discussions in Japanese
56
star
15

rubocop-extension-generator

A generator of RuboCop's custom cops gem.
Ruby
44
star
16

vscode-rubocop

The official VS Code extension for the RuboCop linter and code formatter.
TypeScript
41
star
17

rubocop-factory_bot

Code style checking for factory_bot files
Ruby
33
star
18

rubocop-capybara

Code style checking for Capybara files.
Ruby
33
star
19

rubocop-sequel

Code style checking for Sequel
Ruby
28
star
20

rubocop-rubycw

Wrap ruby -cw by RuboCop
Ruby
23
star
21

blog.rubystyle.guide

A companion blog to the community Ruby, Rails and RSpec guides
HTML
7
star
22

packaging-style-guide

Best practices for writing downstream compatible code!
5
star
23

docs.rubocop.org

RuboCop's documentation site
Handlebars
4
star
24

circleci-ruby-snapshot-image

Builds a Ruby nightly image and publishes it to Docker Hub
Ruby
3
star
25

.github

2
star
26

capybara-style-guide

A community-driven Capybara coding style guide
1
star