Rakefile
Rename is_line_with_version_assignment?
to line_with_version_assignment?
. Open
Open
def is_line_with_version_assignment?(line)
- Read upRead up
- Exclude checks
This cop makes sure that predicates are named properly.
Example:
# bad
def is_even?(value)
end
# good
def even?(value)
end
# bad
def has_value?
end
# good
def value?
end
Do not freeze immutable objects, as freezing them has no effect. Open
Open
VERSION_ASSIGNMENT_REGEXP = /\A\s*?VERSION\s*?=\s*?['"](.*?)['"]\s*?\z/mx.freeze
- Read upRead up
- Exclude checks
This cop check for uses of Object#freeze on immutable objects.
Example:
# bad
CONST = 1.freeze
# good
CONST = 1
Line is too long. [85/80] Open
Open
is_line_with_version_assignment?(line) ? %( VERSION = "#{new_version}"\n) : line
- Exclude checks
Line is too long. [178/80] Open
Open
raise ArgumentError, 'There are two files called version.rb and I do not know which one to use. Override the version_file method in your Rakefile and provide the correct path.'
- Exclude checks
Avoid the use of double negation (!!
). Open
Open
!!(line[VERSION_ASSIGNMENT_REGEXP])
- Read upRead up
- Exclude checks
This cop checks for uses of double negation (!!) to convert something to a boolean value. As this is both cryptic and usually redundant, it should be avoided.
Example:
# bad
!!something
# good
!something.nil?
Please, note that when something is a boolean value !!something and !something.nil? are not the same thing. As you're unlikely to write code that can accept values of any type this is rarely a problem in practice.
Line is too long. [307/80] Open
Open
raise ArgumentError, "There are more than one line in version.rb which assign a value to VERSION. This is almost certainly a mistake. At the very least, I have no idea what I'm supposed to do. You must either increment the version manually in the file, or change the file so it only assigns VERSION once."
- Exclude checks
Line is too long. [106/80] Open
Open
array_of_value_versions = lines_of_version_file.grep(VERSION_ASSIGNMENT_REGEXP) { Regexp.last_match(1) }
- Exclude checks
Line is too long. [99/80] Open
Open
raise ArgumentError, 'I did not find anything in the version file matching a version assignment.'
- Exclude checks