https://github.com/nowlinuxing/rdoc_rubocop
Ruby static code analyzer and formatter for codes in RDoc
https://github.com/nowlinuxing/rdoc_rubocop
rdoc rubocop ruby ruby-gem
Last synced: 27 days ago
JSON representation
Ruby static code analyzer and formatter for codes in RDoc
- Host: GitHub
- URL: https://github.com/nowlinuxing/rdoc_rubocop
- Owner: nowlinuxing
- License: mit
- Created: 2018-12-23T11:47:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-11T04:15:49.000Z (over 7 years ago)
- Last Synced: 2025-02-26T18:53:58.501Z (over 1 year ago)
- Topics: rdoc, rubocop, ruby, ruby-gem
- Language: Ruby
- Homepage:
- Size: 63.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# RDocRuboCop
**RDocRuboCop** is a Ruby static code analyzer and formatter for codes in RDoc.
### before
```ruby
class Foo
# concatenate each elements with ","
#
# a = [ 1 , 2 , 3 ]
# foo=Foo.new
# foo.bar( a )
#
def bar(array)
array.join(",")
end
end
```
### after
```ruby
class Foo
# concatenate each elements with ","
#
# a = [1, 2, 3]
# foo = Foo.new
# foo.bar(a)
#
def bar(array)
array.join(",")
end
end
```
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'rdoc_rubocop'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install rdoc_rubocop
## Usage
# Generate .rdoc_rubocop.yml and .rdoc_rubocop_todo.yml
$ rdoc-rubocop --auto-gen-config
# If .rubocop.yml already exists, and apply same cops to RDoc, edit .rdoc_rubocop.yml:
#
# inherit_from: .rubocop.yml
# Style/FrozenStringLiteralComment:
# Enabled: false
# Correct the code
$ rdoc-rubocop -a
If you do not specify any file, rdoc_rubocop finds for files recursively from current directory. The extension of the target file is used to determine programming language. If it is .rb, it is parsed as Ruby, and if it is .c, it is parsed as C.
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/nowlinuxing/rdoc_rubocop.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).