lib/kanji/generators/type.rb
Align the operands of an expression in an assignment spanning multiple lines. Open
Open
" field :destroy#{class_name}, Types::#{class_name}[:destroy_mutation]\n"
- Read upRead up
- Exclude checks
This cop checks the indentation of the right hand side operand in binary operations that span more than one line.
Example:
# bad
if a +
b
something
end
# good
if a +
b
something
end
Do not use spaces between ->
and opening brace in lambda literals Open
Open
lookup_type: -> (name) { lookup_type(name) },
- Read upRead up
- Exclude checks
This cop checks for spaces between -> and opening parameter brace in lambda literals.
Example: EnforcedStyle: requirenospace (default)
# bad
a = -> (x, y) { x + y }
# good
a = ->(x, y) { x + y }
Example: EnforcedStyle: require_space
# bad
a = ->(x, y) { x + y }
# good
a = -> (x, y) { x + y }
Use \
instead of +
or <<
to concatenate those strings. Open
Open
" field :update#{class_name}, Types::#{class_name}[:update_mutation]\n" +
- Read upRead up
- Exclude checks
This cop checks for string literal concatenation at the end of a line.
Example:
# bad
some_str = 'ala' +
'bala'
some_str = 'ala' <<
'bala'
# good
some_str = 'ala' \
'bala'
Line is too long. [124/100] Open
Open
add_template("migration.rb.tt", "db/migrate/#{Time.now.strftime("%Y%m%d%H%M%S")}_create_#{pluralized_type_name}.rb")
- Exclude checks
Line is too long. [104/100] Open
Open
generator.processor.insert_into_file "./app/mutation_type.rb", fields, after: /description ".*"/
- Exclude checks
Keep a blank line before and after private
. Open
Open
private
- Read upRead up
- Exclude checks
Access modifiers should be surrounded by blank lines.
Example:
# bad
class Foo
def bar; end
private
def baz; end
end
# good
class Foo
def bar; end
private
def baz; end
end
Do not use spaces between ->
and opening brace in lambda literals Open
Open
lookup_column_type: -> (name) { lookup_column_type(name) }
- Read upRead up
- Exclude checks
This cop checks for spaces between -> and opening parameter brace in lambda literals.
Example: EnforcedStyle: requirenospace (default)
# bad
a = -> (x, y) { x + y }
# good
a = ->(x, y) { x + y }
Example: EnforcedStyle: require_space
# bad
a = ->(x, y) { x + y }
# good
a = -> (x, y) { x + y }
Align the operands of an expression in an assignment spanning multiple lines. Open
Open
" field :update#{class_name}, Types::#{class_name}[:update_mutation]\n" +
- Read upRead up
- Exclude checks
This cop checks the indentation of the right hand side operand in binary operations that span more than one line.
Example:
# bad
if a +
b
something
end
# good
if a +
b
something
end
Use \
instead of +
or <<
to concatenate those strings. Open
Open
fields = "\n\n field :create#{class_name}, Types::#{class_name}[:create_mutation]\n" +
- Read upRead up
- Exclude checks
This cop checks for string literal concatenation at the end of a line.
Example:
# bad
some_str = 'ala' +
'bala'
some_str = 'ala' <<
'bala'
# good
some_str = 'ala' \
'bala'