Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pocke/dont_comment
Do not comment out unused code, use version control system instead and remove it!
https://github.com/pocke/dont_comment
Last synced: about 2 months ago
JSON representation
Do not comment out unused code, use version control system instead and remove it!
- Host: GitHub
- URL: https://github.com/pocke/dont_comment
- Owner: pocke
- License: apache-2.0
- Created: 2017-04-14T02:25:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-09T15:21:56.000Z (almost 6 years ago)
- Last Synced: 2024-10-18T22:10:07.440Z (2 months ago)
- Language: Ruby
- Homepage: https://rubygems.org/gems/dont_comment
- Size: 34.2 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DontComment
[![Gem Version](https://badge.fury.io/rb/dont_comment.svg)](https://badge.fury.io/rb/dont_comment)
[![Build Status](https://travis-ci.org/pocke/dont_comment.svg?branch=master)](https://travis-ci.org/pocke/dont_comment)Do not comment out unused code, use version control system instead and remove it!
## What's this?
If you use version control system, you must not comment out unused code.
For example, you can remove the old implementation in the following code.
```ruby
# def some_method
# puts 'an old implementation'
# enddef some_method
puts 'a new implementation'
end
```This tool detects this problem.
### Detect comment outs for debug
```ruby
class ExampleController < ApplicationController
# before_action :validate_foobar
end
```Sometime we comment out validation or something for debug.
If we forget to restore the comment before we commit the change, it will be a serious bug.We can avoid the bug by this tool.
### False positives
Maybe, This tools will make many false positives.
I design this tools to use with a pull-request.
Do not use use this tool for all ruby files in your repository. It probably will not be useful.## Installation
Add this line to your application's Gemfile:
```ruby
gem 'dont_comment'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install dont_comment
### Requirements
- Ruby 2.4 or higher
## Usage
```bash
$ dont_comment some/ruby/file/path.rb
some/ruby/file/path.rb:3: Do not comment out unused code, use version control system instead and remove it!
some/ruby/file/path.rb:7: Do not comment out unused code, use version control system instead and remove it!
```## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/pocke/dont_comment.