0.0
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Do not comment out unused code, use version control system instead and remove it!
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
 Dependencies

Development

~> 1.14
~> 2.13.0
~> 5.9.0
~> 10.0
>= 0.48.1

Runtime

>= 0
 Project Readme

DontComment

Gem Version Build Status

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.

# def some_method
#   puts 'an old implementation'
# end

def some_method
  puts 'a new implementation'
end

This tool detects this problem.

Detect comment outs for debug

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:

gem 'dont_comment'

And then execute:

$ bundle

Or install it yourself as:

$ gem install dont_comment

Requirements

  • Ruby 2.4 or higher

Usage

$ 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.