RuboCop plugin with cops for Rake task files
open sourceMITfree
RuboCop Rake is an open source RuboCop plugin from the RuboCop organization that adds cops for Rakefiles and .rake tasks. They catch tasks without a desc, duplicate tasks and namespaces, and classes, modules or methods defined inside a task, which Ruby puts at the top level. You load it with plugins: rubocop-rake in .rubocop.yml (RuboCop 1.72 and newer), on the command line or in a RuboCop Rake task.
Problems it solves
- lint my Rakefile and .rake tasks with RuboCop
- make sure every Rake task has a description
- catch duplicate Rake task names in a Ruby project
Features
- Rake/Desc: require a desc for every task
- Rake/DuplicateTask and Rake/DuplicateNamespace
- Rake/ClassDefinitionInTask: no classes or modules defined inside a task
- Rake/MethodDefinitionInTask: no methods defined inside a task
Alternatives
The same job
These do what RuboCop Rake does.
- RuboCop A Ruby static code analyzer and formatter, based on the community Ruby style guide.
- RuboCop Performance Performance optimization analysis for Ruby code, as a RuboCop extension
- RuboCop RSpec RuboCop extension with cops for RSpec test files
- RuboCop Rails RuboCop extension with cops for Rails best practices and conventions
- rubocop-require_tools RuboCop extension that flags missing require statements
- Standard Ruby Unconfigurable Ruby linter and formatter built on RuboCop
