Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Lock RuboCop extension gem versions to prevent CI failures #653

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
justin808 merged 2 commits into master from lock-rubocop-versions
Sep 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Gemfile
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ group :development, :test do
################################################################################
# Linters and Security
gem "rubocop", "1.69", require: false
gem "rubocop-performance", "~> 1.13"
gem "rubocop-rails"
gem "rubocop-rspec", "~> 3.3"
gem "rubocop-performance", "1.23.1", require: false
gem "rubocop-rails", "2.29.1", require: false
gem "rubocop-rspec", "3.4.0", require: false
# Critical that require: false be set! https://github.com/brigade/scss-lint/issues/278
gem "scss_lint", require: false

Expand Down
43 changes: 23 additions & 20 deletions Gemfile.lock
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ GEM
uri (>= 0.13.1)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.2)
ast (2.4.3)
autoprefixer-rails (10.4.16.0)
execjs (~> 2)
awesome_print (1.9.2)
Expand Down Expand Up @@ -167,8 +167,8 @@ GEM
jbuilder (2.12.0)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
json (2.7.2)
language_server-protocol (3.17.0.3)
json (2.14.1)
language_server-protocol (3.17.0.5)
launchy (3.0.1)
addressable (~> 2.8)
childprocess (~> 5.0)
Expand Down Expand Up @@ -208,14 +208,15 @@ GEM
nokogiri (1.18.10-x86_64-linux-gnu)
racc (~> 1.4)
package_json (0.1.0)
parallel (1.26.3)
parser (3.3.3.0)
parallel (1.27.0)
parser (3.3.9.0)
ast (~> 2.4.1)
racc
pg (1.5.6)
pp (0.6.2)
prettyprint
prettyprint (0.2.0)
prism (1.5.1)
protocol (2.0.0)
ruby_parser (~> 3.0)
pry (0.14.2)
Expand Down Expand Up @@ -308,7 +309,7 @@ GEM
redis-client (>= 0.22.0)
redis-client (0.22.2)
connection_pool
regexp_parser (2.9.2)
regexp_parser (2.11.3)
reline (0.6.2)
io-console (~> 0.5)
require_all (3.0.0)
Expand Down Expand Up @@ -341,16 +342,18 @@ GEM
rubocop-ast (>= 1.36.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.36.1)
parser (>= 3.3.1.0)
rubocop-performance (1.19.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.15.2)
rubocop-ast (1.47.0)
parser (>= 3.3.7.2)
prism (~> 1.4)
rubocop-performance (1.23.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.29.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-rspec (3.3.0)
rubocop (>= 1.52.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (3.4.0)
rubocop (~> 1.61)
ruby-progressbar (1.13.0)
ruby_parser (3.21.0)
Expand Down Expand Up @@ -428,9 +431,9 @@ GEM
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (3.1.2)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.1.0)
uri (1.0.3)
useragent (0.16.11)
web-console (4.2.1)
Expand Down Expand Up @@ -486,9 +489,9 @@ DEPENDENCIES
redis (~> 5.0)
rspec-rails (~> 6.0.0)
rubocop (= 1.69)
rubocop-performance (~> 1.13)
rubocop-rails
rubocop-rspec (~> 3.3)
rubocop-performance (= 1.23.1)
rubocop-rails (= 2.29.1)
rubocop-rspec (= 3.4.0)
sass-rails
scss_lint
sdoc
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/comments_controller.rb
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def inline_form
private

def set_comments
@comments = Comment.all.order("id DESC")
@comments = Comment.order("id DESC")
end

# Use callbacks to share common setup or constraints between actions.
Expand All @@ -116,6 +116,6 @@ def new_comment

# Never trust parameters from the scary internet, only allow the white list through.
def comment_params
params.require(:comment).permit(:author, :text)
params.expect(comment: %i[authortext])
end
end
2 changes: 1 addition & 1 deletion app/controllers/pages_controller.rb
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def rescript; end
private

def set_comments
@comments = Comment.all.order("id DESC")
@comments = Comment.order("id DESC")
end

def comments_json_string
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/ci.rake
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

if Rails.env.development? || Rails.env.test?
if Rails.env.local?
# See tasks/linters.rake

task js_tests: :environment do
Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/daily.rake
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

task daily: :environment do
t = 1.day.ago
older_comments = Comment.where("created_at < ?",t)
newer_comments = Comment.where("created_at >= ?",t)
older_comments = Comment.where(created_at: ...t)
newer_comments = Comment.where(created_at: t..)
puts "Deleting #{older_comments.count} comments older than #{t}"
puts "Keeping #{newer_comments.count} comments newer than #{t}"
older_comments.delete_all
Expand Down
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].sort.each { |f| require f }
Rails.root.glob("spec/support/**/*.rb").sort.each { |f| require f }

RSpec.configure do |config|
config.include FactoryBot::Syntax::Methods
Expand Down
16 changes: 8 additions & 8 deletions spec/rescript/rescript_spec.rb
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -46,41 +46,41 @@
end

it "comment count increases with successful form submission" do
initital_comment_count = Comment.all.count
initital_comment_count = Comment.count
new_comment_count = initital_comment_count + 1
fill_in author_field, with: comment.author
fill_in text_field, with: comment.text
click_button("Post")

page.driver.browser.manage.timeouts.implicit_wait = 1

expect(Comment.all.count).to equal(new_comment_count)
expect(Comment.count).to equal(new_comment_count)
end

it "comment count remains the same when author field is empty" do
initial_comment_count = Comment.all.count
initial_comment_count = Comment.count
fill_in text_field, with: comment.text
click_button("Post")

expect(page).to have_text(/Can't save the comment!/)
expect(Comment.all.count).to equal(initial_comment_count)
expect(Comment.count).to equal(initial_comment_count)
end

it "comment count remains the same when text field is empty" do
initial_comment_count = Comment.all.count
initial_comment_count = Comment.count
fill_in author_field, with: comment.author
click_button("Post")

expect(page).to have_text(/Can't save the comment!/)
expect(Comment.all.count).to equal(initial_comment_count)
expect(Comment.count).to equal(initial_comment_count)
end

it "comment count remains the same when both form fields are empty" do
initial_comment_count = Comment.all.count
initial_comment_count = Comment.count
click_button("Post")

expect(page).to have_text(/Can't save the comment!/)
expect(Comment.all.count).to equal(initial_comment_count)
expect(Comment.count).to equal(initial_comment_count)
end
end
end
16 changes: 8 additions & 8 deletions spec/stimulus/turbo_spec.rb
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -41,41 +41,41 @@
end

it "adds a new comment to the page and database" do
initital_comment_count = Comment.all.count
initital_comment_count = Comment.count
new_comment_count = initital_comment_count + 1
fill_in author_field, with: comment.author
fill_in text_field, with: comment.text
click_button("Post")

expect(page).to have_css("h2", text: comment.author)
expect(page).to have_css("p", text: comment.text)
expect(Comment.all.count).to equal(new_comment_count)
expect(Comment.count).to equal(new_comment_count)
end

it "comment count remains the same when author field is empty" do
initial_comment_count = Comment.all.count
initial_comment_count = Comment.count
fill_in text_field, with: comment.text
click_button("Post")

expect(page).to have_text("Author: can't be blank")
expect(Comment.all.count).to equal(initial_comment_count)
expect(Comment.count).to equal(initial_comment_count)
end

it "comment count remains the same when text field is empty" do
initial_comment_count = Comment.all.count
initial_comment_count = Comment.count
fill_in author_field, with: comment.author
click_button("Post")

expect(page).to have_text("Text: can't be blank")
expect(Comment.all.count).to equal(initial_comment_count)
expect(Comment.count).to equal(initial_comment_count)
end

it "comment count remains the same when both form fields are empty" do
initial_comment_count = Comment.all.count
initial_comment_count = Comment.count
click_button("Post")

expect(page).to have_text("Author: can't be blank")
expect(Comment.all.count).to equal(initial_comment_count)
expect(Comment.count).to equal(initial_comment_count)
end
end
end

AltStyle によって変換されたページ (->オリジナル) /