lib/kanji/generators/project.rb
Class has too many lines. [117/100] Wontfix
Wontfix
class Project < AbstractGenerator
def initialize(app_name, options = {})
@app_name = app_name
super(underscored_project_name)
end
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Use 2 spaces for indentation in a heredoc by using some library(e.g. ActiveSupport's String#strip_heredoc
). Open
Open
\n
You're now ready to start writing your Kanji app! Congratulations!
Because this is a data driven API application, you can't do much
with it until you create some types! Get started by using a generator:
`kanji g type User email:string`
- Read upRead up
- Exclude checks
This cops checks the indentation of the here document bodies. The bodies
are indented one step.
In Ruby 2.3 or newer, squiggly heredocs (<<~
) should be used. If you
use the older rubies, you should introduce some library to your project
(e.g. ActiveSupport, Powerpack or Unindent).
Note: When Metrics/LineLength
's AllowHeredoc
is false(not default),
this cop does not add any offenses for long here documents to
avoid Metrics/LineLength
's offenses.
Example:
# bad
<<-RUBY
something
RUBY
# good
# When EnforcedStyle is squiggly, bad code is auto-corrected to the
# following code.
<<~RUBY
something
RUBY
# good
# When EnforcedStyle is active_support, bad code is auto-corrected to
# the following code.
<<-RUBY.strip_heredoc
something
RUBY
Unused method argument - options
. If it's necessary, use _
or _options
as an argument name to indicate that it won't be used. Open
Open
def initialize(app_name, options = {})
- Read upRead up
- Exclude checks
This cop checks for unused method arguments.
Example:
# bad
def some_method(used, unused, _unused_but_allowed)
puts used
end
Example:
# good
def some_method(used, _unused, _unused_but_allowed)
puts used
end
Line is too long. [109/100] Open
Open
add_template("system/project/application.rb.tt", "system/#{underscored_project_name}/application.rb")
- 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
Line is too long. [105/100] Open
Open
add_template("system/project/container.rb.tt", "system/#{underscored_project_name}/container.rb")
- Exclude checks
Line is too long. [103/100] Open
Open
add_template("system/project/settings.rb.tt", "system/#{underscored_project_name}/settings.rb")
- Exclude checks