Fix Naming/VariableName (#387)

This commit is contained in:
Kohei Sugi 2018-08-20 08:37:57 +09:00 committed by Ben Halpern
parent 43ed4bfeec
commit 2e0eb0e0ef
2 changed files with 10 additions and 17 deletions

View file

@ -85,13 +85,6 @@ Naming/UncommunicativeMethodParamName:
- 'app/models/chat_channel.rb'
- 'app/models/tweet.rb'
# Offense count: 2
# Configuration parameters: EnforcedStyle.
# SupportedStyles: snake_case, camelCase
Naming/VariableName:
Exclude:
- 'app/liquid_tags/github_tag/github_issue_tag.rb'
# Offense count: 3
Security/Open:
Exclude:

View file

@ -14,13 +14,13 @@ class GithubTag
end
def render
contentJSON = @content.issue_serialized
content_json = @content.issue_serialized
body = @content.processed_html
username = contentJSON[:user][:login]
user_html_url = contentJSON[:user][:html_url]
user_avatar_url = contentJSON[:user][:avatar_url]
date = Date.parse(contentJSON[:created_at].to_s).strftime("%b %d, %Y")
date_link = contentJSON[:html_url]
username = content_json[:user][:login]
user_html_url = content_json[:user][:html_url]
user_avatar_url = content_json[:user][:avatar_url]
date = Date.parse(content_json[:created_at].to_s).strftime("%b %d, %Y")
date_link = content_json[:html_url]
title = generate_title
html = "" \
"<div class=\"ltag_github-liquid-tag\"> "\
@ -69,10 +69,10 @@ class GithubTag
end
def generate_title
contentJSON = @content.issue_serialized
title = contentJSON[:title]
number = contentJSON[:number]
link = contentJSON[:html_url]
content_json = @content.issue_serialized
title = content_json[:title]
number = content_json[:number]
link = content_json[:html_url]
return unless title
"<h1> " \
"<a href=\"#{link}\">" \