Showing 840 of 840 total issues
Tab detected. Open
puts 'Module successfully created!'
- Exclude checks
Use the new Ruby 1.9 hash syntax. Open
method_option :description, :aliases => '-d', :desc => 'Provides a full description to the module'
- Read upRead up
- Exclude checks
This cop checks hash literal syntax.
It can enforce either the use of the class hash rocket syntax or the use of the newer Ruby 1.9 syntax (when applicable).
A separate offense is registered for each problematic pair.
The supported styles are:
- ruby19 - forces use of the 1.9 syntax (e.g.
{a: 1}
) when hashes have all symbols for keys - hash_rockets - forces use of hash rockets for all hashes
- nomixedkeys - simply checks for hashes with mixed syntaxes
- ruby19nomixed_keys - forces use of ruby 1.9 syntax and forbids mixed syntax hashes
Example: EnforcedStyle: ruby19 (default)
# bad
{:a => 2}
{b: 1, :c => 2}
# good
{a: 2, b: 1}
{:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol
{d: 1, 'e' => 2} # technically not forbidden
Example: EnforcedStyle: hash_rockets
# bad
{a: 1, b: 2}
{c: 1, 'd' => 5}
# good
{:a => 1, :b => 2}
Example: EnforcedStyle: nomixedkeys
# bad
{:a => 1, b: 2}
{c: 1, 'd' => 2}
# good
{:a => 1, :b => 2}
{c: 1, d: 2}
Example: EnforcedStyle: ruby19nomixed_keys
# bad
{:a => 1, :b => 2}
{c: 2, 'd' => 3} # should just use hash rockets
# good
{a: 1, b: 2}
{:c => 3, 'd' => 4}
Tab detected. Open
file_name,
- Exclude checks
Tab detected. Open
# Setting up Xcode objects
- Exclude checks
Tab detected. Open
file_group = dir_path.join(directory_name)
- Exclude checks
Space missing after comma. Open
test_target = ask_index("Select the appropriate target for adding your TESTS (type the index):\n" + targets_prompt,project.targets)
- Read upRead up
- Exclude checks
Checks for comma (,) not followed by some kind of space.
Example:
# bad
[1,2]
{ foo:bar,}
# good
[1, 2]
{ foo:bar, }
Prefer the use of the nil?
predicate. Open
if targets.count == 0 || files == nil || files.count == 0 || dir_path == nil || group_path == nil
- Read upRead up
- Exclude checks
This cop checks for comparison of something with nil using ==.
Example:
# bad
if x == nil
end
# good
if x.nil?
end
Tab detected. Open
if code_module.project_targets && code_module.project_group_path && code_module.project_file_path
- Exclude checks
Unnecessary spacing detected. Open
next_group = group_is_logical ? final_group.new_group(group_name) : final_group.new_group(group_name, group_name)
- Read upRead up
- Exclude checks
This cop checks for extra/unnecessary whitespace.
Example:
# good if AllowForAlignment is true
name = "RuboCop"
# Some comment and an empty line
website += "/bbatsov/rubocop" unless cond
puts "rubocop" if debug
# bad for any configuration
set_app("RuboCop")
website = "https://github.com/bbatsov/rubocop"
Tab detected. Open
end
- Exclude checks
Missing top-level class documentation comment. Open
class Template < Thor
- Read upRead up
- Exclude checks
This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.
The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.
Example:
# bad
class Person
# ...
end
# good
# Description/Explanation of Person class
class Person
# ...
end
Tab detected. Open
code_module.project_targets,
- Exclude checks
Line is too long. [125/80] Open
module_group = self.retrieve_group_or_create_if_needed(group_path, dir_path, file_group_path, project, true, root_path)
- Exclude checks
Line is too long. [116/80] Open
module_group = self.retrieve_group_or_create_if_needed(group_path, nil, nil, project, false, group_is_logical)
- Exclude checks
Tab detected. Open
puts('Creating test files...')
- Exclude checks
Avoid multi-line chains of blocks. Open
}.each { |template_name|
- Read upRead up
- Exclude checks
This cop checks for chaining of a block after another block that spans multiple lines.
Example:
Thread.list.find_all do |t|
t.alive?
end.map do |t|
t.object_id
end
Tab detected. Open
end
- Exclude checks
Tab detected. Open
puts "Test group path: #{code_module.test_group_path}".green if code_module.test_group_path
- Exclude checks
Extra empty line detected at class body beginning. Open
desc 'install', 'Installs all the templates specified in the Rambafile from the current directory'
- Read upRead up
- Exclude checks
This cops checks if empty lines around the bodies of classes match the configuration.
Example: EnforcedStyle: empty_lines
# good
class Foo
def bar
# ...
end
end
Example: EnforcedStyle: emptylinesexcept_namespace
# good
class Foo
class Bar
# ...
end
end
Example: EnforcedStyle: emptylinesspecial
# good
class Foo
def bar; end
end
Example: EnforcedStyle: noemptylines (default)
# good
class Foo
def bar
# ...
end
end
Tab detected. Open
def process_files_if_needed(files, code_module, template, project, targets, group_path, dir_path, root_path, processed_groups = [])
- Exclude checks