Showing 25 of 25 total issues
Avoid using rescue
in its modifier form. Open
Open
rails_root: (Rails.root.to_s rescue nil),
- Read upRead up
- Exclude checks
This cop checks for uses of rescue in its modifier form.
Example:
# bad
some_method rescue handle_error
# good
begin
some_method
rescue
handle_error
end
Use warn
instead of $stderr.puts
to allow such output to be disabled. Open
Open
$stderr.puts "Cannot batch post - environment variable CODECLIMATE_REPO_TOKEN must be set."
- Read upRead up
- Exclude checks
This cop identifies places where $stderr.puts
can be replaced by
warn
. The latter has the advantage of easily being disabled by,
e.g. the -W0 interpreter flag, or setting $VERBOSE to nil.
Example:
# bad
$stderr.puts('hello')
# good
warn('hello')
Use %q
only for strings that contain both single quotes and double quotes. Open
Open
spec.post_install_message = %q(
Code Climate's codeclimate-test-reporter gem has been deprecated in favor of
our language-agnostic unified test reporter. The new test reporter is faster,
distributed as a static binary so dependency conflicts never occur, and
supports parallelized CI builds & multi-language CI configurations.
- Exclude checks
Empty line detected around arguments. Open
Open
Please visit https://docs.codeclimate.com/v1.0/docs/configuring-test-coverage
- Read upRead up
- Exclude checks
This cops checks if empty lines exist around the arguments of a method invocation.
Example:
# bad
do_something(
foo
)
process(bar,
baz: qux,
thud: fred)
some_method(
[1,2,3],
x: y
)
# good
do_something(
foo
)
process(bar,
baz: qux,
thud: fred)
some_method(
[1,2,3],
x: y
)
The name of this source file (codeclimate-test-reporter.rb
) should use snake_case. Open
Open
require "code_climate/test_reporter"
- Read upRead up
- Exclude checks
This cop makes sure that Ruby source files have snake_case names. Ruby scripts (i.e. source files with a shebang in the first line) are ignored.
Example:
# bad
lib/layoutManager.rb
anything/usingCamelCase
# good
lib/layout_manager.rb
anything/using_snake_case.rake