lib/tabulatr/generators/tabulatr/table_generator.rb
Line is too long. [113/80] Open
Open
template 'tabulatr_data.rb', File.join('app/tabulatr_data/', class_path, "#{file_name}_tabulatr_data.rb")
- Exclude checks
Line is too long. [87/80] Open
Open
[:id] + attributes.select { |attr| !attr.reference? }.map { |a| a.name.to_sym }
- Exclude checks
Line is too long. [86/80] Open
Open
argument :attributes, type: :array, default: [], banner: 'field:type field:type'
- Exclude checks
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
Open
desc "create TabulatrData Class"
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Pass &:reference?
as an argument to select
instead of a block. Open
Open
attributes.select { |attr| attr.reference? }.map { |a| a.name.to_sym }
- Read upRead up
- Exclude checks
Use symbols as procs when possible.
Example:
# bad
something.map { |s| s.upcase }
# good
something.map(&:upcase)
Missing top-level class documentation comment. Open
Open
class TableGenerator < Rails::Generators::NamedBase
- 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