Showing 219 of 219 total issues
Final newline missing. Open
Open
end
- Exclude checks
Tab detected. Open
Open
Jekyll.logger.warn("Warning:", "The MeetupApi failed for \"#{group}\" retrying #{retries} times before giving up… Sleeping for #{sleepTimeout} seconds")
- Exclude checks
Tab detected. Open
Open
end
- Exclude checks
Use snake_case for variable names. Open
Open
maxRetryTimeout = 50
- Read upRead up
- Exclude checks
This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.
Example: EnforcedStyle: snake_case (default)
# bad
fooBar = 1
# good
foo_bar = 1
Example: EnforcedStyle: camelCase
# bad
foo_bar = 1
# good
fooBar = 1
Tab detected. Open
Open
convertedDate = "#{DateTime.strptime(dateWithOffset.to_s,'%Q').strftime('%Y-%m-%d %H:%M:%S')} #{@@timezone}"
- Exclude checks
Tab detected. Open
Open
def getMeetUpGroupEvents(group)
- Exclude checks
Tab detected. Open
Open
keyPath = "#{@site.source}/meetup_api_key"
- Exclude checks
Non-local exit from iterator, without return value. next
, break
, Array#find
, Array#any?
, etc. is preferred. Open
Open
config.api_key = ENV['MEETUP_API_KEY'] || File.file?(keyPath) && File.read(keyPath) || return
- Read upRead up
- Exclude checks
This cop checks for non-local exits from iterators without a return value. It registers an offense under these conditions:
- No value is returned,
- the block is preceded by a method chain,
- the block has arguments,
- the method which receives the block is not
define_method
ordefine_singleton_method
, - the return is not contained in an inner scope, e.g. a lambda or a method definition.
Example:
class ItemApi
rescue_from ValidationError do |e| # non-iteration block with arg
return { message: 'validation error' } unless e.errors # allowed
error_array = e.errors.map do |error| # block with method chain
return if error.suppress? # warned
return "#{error.param}: invalid" unless error.message # allowed
"#{error.param}: #{error.message}"
end
{ message: 'validation error', errors: error_array }
end
def update_items
transaction do # block without arguments
return unless update_necessary? # allowed
find_each do |item| # block without method chain
return if item.stock == 0 # false-negative...
item.update!(foobar: true)
end
end
end
end
Space missing after comma. Open
Open
doc.data['dateStart'] = convertDate(event['time'],event['utc_offset'])
- 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, }
Tab detected. Open
Open
def generateEventDocument(event)
- Exclude checks
Tab detected. Open
Open
if event['duration']
- Exclude checks
Tab detected. Open
Open
@collection.docs << doc
- Exclude checks
Tab detected. Open
Open
end
- Exclude checks
Tab detected. Open
Open
end
- Exclude checks
Use snake_case for method names. Open
Open
def convertDate(date, offset)
- Read upRead up
- Exclude checks
This cop makes sure that all methods use the configured style, snake_case or camelCase, for their names.
Example: EnforcedStyle: snake_case (default)
# bad
def fooBar; end
# good
def foo_bar; end
Example: EnforcedStyle: camelCase
# bad
def foo_bar; end
# good
def fooBar; end
Use 2 (not 1) spaces for indentation. Open
Open
Jekyll.logger.error("Error:", "No more retries left, we're going down 💥")
- Read upRead up
- Exclude checks
This cops checks for indentation that doesn't use the specified number of spaces.
See also the IndentationConsistency cop which is the companion to this one.
Example:
# bad
class A
def test
puts 'hello'
end
end
# good
class A
def test
puts 'hello'
end
end
Example: IgnoredPatterns: ['^\s*module']
# bad
module A
class B
def test
puts 'hello'
end
end
end
# good
module A
class B
def test
puts 'hello'
end
end
end
Space missing after comma. Open
Open
doc.data['dateEnd'] = convertDate(event['time']+event['duration'],event['utc_offset'])
- 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, }
Tab detected. Open
Open
retry
- Exclude checks
Tab detected. Open
Open
doc = Jekyll::Document.new('', :site => @site, :collection => @collection)
- Exclude checks
Tab detected. Open
Open
doc.data['category'] = event['group']['name'].downcase.gsub(/\s+|[():]/, "")
- Exclude checks