Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rubocop/rubocop-minitest
Code style checking for Minitest files.
https://github.com/rubocop/rubocop-minitest
code-formatter hacktoberfest linter minitest rubocop ruby static-code
Last synced: 1 day ago
JSON representation
Code style checking for Minitest files.
- Host: GitHub
- URL: https://github.com/rubocop/rubocop-minitest
- Owner: rubocop
- License: mit
- Created: 2019-08-05T05:39:32.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-15T07:22:44.000Z (24 days ago)
- Last Synced: 2024-11-05T08:19:37.631Z (3 days ago)
- Topics: code-formatter, hacktoberfest, linter, minitest, rubocop, ruby, static-code
- Language: Ruby
- Homepage: https://docs.rubocop.org/rubocop-minitest
- Size: 820 KB
- Stars: 141
- Watchers: 18
- Forks: 44
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README
# RuboCop Minitest
[![Gem Version](https://badge.fury.io/rb/rubocop-minitest.svg)](https://badge.fury.io/rb/rubocop-minitest)
[![CI](https://github.com/rubocop/rubocop-minitest/actions/workflows/test.yml/badge.svg)](https://github.com/rubocop/rubocop-minitest/actions/workflows/test.yml)A [RuboCop](https://github.com/rubocop/rubocop) extension focused on enforcing [Minitest](https://github.com/minitest/minitest) best practices and coding conventions.
The library is based on the guidelines outlined in the community [Minitest Style Guide](https://minitest.rubystyle.guide).## Installation
Just install the `rubocop-minitest` gem
```sh
$ gem install rubocop-minitest
```or if you use bundler put this in your `Gemfile`
```ruby
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`.
```yaml
require: rubocop-minitest
```Alternatively, use the following array notation when specifying multiple extensions.
```yaml
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
```sh
$ rubocop --require rubocop-minitest
```### Rake task
```ruby
require 'rubocop/rake_task'RuboCop::RakeTask.new do |task|
task.requires << 'rubocop-minitest'
end
```## The Cops
All cops are located under
[`lib/rubocop/cop/minitest`](lib/rubocop/cop/minitest), and contain
examples/documentation. The documentation is published [here](https://docs.rubocop.org/rubocop-minitest/).In your `.rubocop.yml`, you may treat the Minitest cops just like any other
cop. For example:```yaml
Minitest/AssertNil:
Exclude:
- test/my_file_to_ignore_test.rb
```## Documentation
You can read a lot more about RuboCop Minitest in its [official docs](https://docs.rubocop.org/rubocop-minitest/).
## 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](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)
Here are the Markdown snippets for the two badges:
``` markdown
[![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](CONTRIBUTING.md).
## License
`rubocop-minitest` is MIT licensed. [See the accompanying file](LICENSE.txt) for
the full text.