Skip to content

Commit

Permalink
Merge pull request #127 from publify/update-rubocop-settings
Browse files Browse the repository at this point in the history
Switch to no-trailing-comma style
  • Loading branch information
mvz authored Nov 12, 2023
2 parents c61864f + 3604949 commit f39643d
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 31 deletions.
8 changes: 0 additions & 8 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,6 @@ Style/StringLiteralsInInterpolation:
Style/SymbolArray:
EnforcedStyle: brackets

# Prefer consistent lines for multi-line arrays
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma

# Prefer consistent lines for multi-line hashes
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma

# Allow small arrays of words with quotes
Style/WordArray:
MinSize: 4
2 changes: 1 addition & 1 deletion app/helpers/admin/feedback_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def show_feedback_actions(item, context = "listing")
change_status(item, context),
button_to_edit_comment(item),
button_to_delete_comment(item),
button_to_conversation(item),
button_to_conversation(item)
], " "
end

Expand Down
2 changes: 1 addition & 1 deletion app/models/archives_sidebar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def parse_request(_contents, _params)
name: I18n.l(Date.new(year, month), format: "%B %Y"),
month: month,
year: year,
article_count: entry.count,
article_count: entry.count
}
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/text_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def self.all
markdown,
smartypants,
markdown_smartypants,
none,
none
]
end

Expand Down
14 changes: 7 additions & 7 deletions spec/controllers/admin/articles_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
it "search query and limit on published_at" do
get :index, params: { search: {
searchstring: article.body[0..4],
published_at: article.published_at + 2.days,
published_at: article.published_at + 2.days
} }
expect(assigns(:articles)).to be_empty
end
Expand Down Expand Up @@ -404,7 +404,7 @@ def base_article(options = {})

it "allows updating body_and_extended" do
put :update, params: { "id" => article.id, "article" => {
"body_and_extended" => "foo<!--more-->bar<!--more-->baz",
"body_and_extended" => "foo<!--more-->bar<!--more-->baz"
} }
expect(response).to redirect_to action: "index"
article.reload
Expand All @@ -414,7 +414,7 @@ def base_article(options = {})

it "allows updating password" do
put :update, params: { "id" => article.id, "article" => {
"password" => "foobar",
"password" => "foobar"
} }
expect(response).to redirect_to action: "index"
article.reload
Expand All @@ -431,7 +431,7 @@ def base_article(options = {})
before do
put(:update, params: {
id: original.id,
article: { id: draft.id, body: "update" },
article: { id: draft.id, body: "update" }
})
end

Expand All @@ -454,7 +454,7 @@ def base_article(options = {})
before do
put(:update, params: {
id: draft.id,
article: { id: draft.id, body: "update" },
article: { id: draft.id, body: "update" }
})
end

Expand All @@ -477,7 +477,7 @@ def base_article(options = {})
before do
put(:update, params: {
id: draft.id,
article: { id: draft.id, body: "update", published_at: "2016-07-07" },
article: { id: draft.id, body: "update", published_at: "2016-07-07" }
})
end

Expand All @@ -492,7 +492,7 @@ def base_article(options = {})
@orig = create(:article)
put(:update, params: {
id: @orig.id,
article: { title: @orig.title, draft: "draft", body: "update" },
article: { title: @orig.title, draft: "draft", body: "update" }
})
end

Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/admin/pages_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def base_page(options = {})
page: {
name: "new_page", title: "New Page Title", body: "Emphasis _mine_,
arguments *strong*"
},
}
}
end

Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/feedback_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
create(:comment, state: :presumed_ham),
create(:comment),
create(:trackback, title: "some"),
create(:trackback, title: "items"),
create(:trackback, title: "items")
]
end

let!(:spammy_items) do
[
create(:spam_comment),
create(:trackback, state: "spam"),
create(:trackback, state: "spam")
]
end

Expand Down
8 changes: 4 additions & 4 deletions spec/controllers/notes_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
"screen_name" => "a screen name",
"entities" => {
"url" => {
"urls" => [{ "expanded_url" => "an url" }],
},
},
},
"urls" => [{ "expanded_url" => "an url" }]
}
}
}
}
end
let(:permalink) do
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

config.cache_store = :memory_store
config.public_file_server.headers = {
"Cache-Control" => "public, max-age=#{2.days.to_i}",
"Cache-Control" => "public, max-age=#{2.days.to_i}"
}
else
config.action_controller.perform_caching = false
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true
config.public_file_server.headers = {
"Cache-Control" => "public, max-age=#{1.hour.to_i}",
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
}

# Show full error reports and disable caching.
Expand Down
6 changes: 3 additions & 3 deletions spec/helpers/base_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def parse_request(_contents, _request_params)
reply = {
"user" => {
"name" => "truc",
"entities" => { "url" => { "urls" => [{ "expanded_url" => "an url" }] } },
},
"entities" => { "url" => { "urls" => [{ "expanded_url" => "an url" }] } }
}
}
expect(get_reply_context_url(reply)).to eq '<a href="an url">truc</a>'
end
Expand All @@ -116,7 +116,7 @@ def parse_request(_contents, _request_params)
"created_at" => "Thu Jan 23 13:47:00 +0000 2014",
"user" => {
"screen_name" => "a_screen_name",
"entities" => { "url" => { "urls" => [{ "expanded_url" => "an url" }] } },
"entities" => { "url" => { "urls" => [{ "expanded_url" => "an url" }] } }
} }
end

Expand Down
2 changes: 1 addition & 1 deletion spec/models/archives_sidebar_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

expected_structure = [
{ name: "February 2015", month: 2, year: 2015, article_count: 2 },
{ name: "March 2014", month: 3, year: 2014, article_count: 1 },
{ name: "March 2014", month: 3, year: 2014, article_count: 1 }
]

expect(sidebar.archives).to eq expected_structure
Expand Down

0 comments on commit f39643d

Please sign in to comment.