Skip to content
Closed
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
58 changes: 1 addition & 57 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2026-03-01 05:17:50 UTC using RuboCop version 1.85.0.
# on 2026-03-01 05:32:16 UTC using RuboCop version 1.85.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand Down Expand Up @@ -71,15 +71,7 @@ FactoryBot/ExcessiveCreateList:
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
Layout/HashAlignment:
Exclude:
- 'app/helpers/application_helper.rb'
- 'app/helpers/crops_helper.rb'
- 'app/models/concerns/search_harvests.rb'
- 'app/models/concerns/search_plantings.rb'
- 'app/models/crop.rb'
- 'config/sitemap.rb'
- 'lib/tasks/import.rake'
- 'spec/requests/api/v1/activities_request_spec.rb'
- 'spec/requests/api/v1/members_request_spec.rb'

# Offense count: 6
# This cop supports safe autocorrection (--autocorrect).
Expand All @@ -94,12 +86,6 @@ Layout/LineLength:
- 'db/seeds.rb'
- 'spec/requests/api/v1/activities_request_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Lint/AmbiguousOperatorPrecedence:
Exclude:
- 'app/controllers/activities_controller.rb'

# Offense count: 4
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: RequireParenthesesForMethodChains.
Expand Down Expand Up @@ -254,12 +240,6 @@ RSpec/ContextMethod:
RSpec/ContextWording:
Enabled: false

# Offense count: 1
# Configuration parameters: IgnoredMetadata.
RSpec/DescribeClass:
Exclude:
- 'spec/tasks/import_spec.rb'

# Offense count: 36
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
Expand Down Expand Up @@ -287,13 +267,6 @@ RSpec/EmptyExampleGroup:
- 'spec/views/photos/edit.html.haml_spec.rb'
- 'spec/views/posts/_single.html.haml_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowConsecutiveOneLiners.
RSpec/EmptyLineAfterExample:
Exclude:
- 'spec/models/ability_spec.rb'

# Offense count: 146
# Configuration parameters: CountAsOne.
RSpec/ExampleLength:
Expand All @@ -312,20 +285,6 @@ RSpec/ExpectInHook:
- 'spec/features/plantings/planting_a_crop_spec.rb'
- 'spec/features/shared_examples/append_date.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: implicit, each, example
RSpec/HookArgument:
Exclude:
- 'spec/requests/api/v1/plantings_request_spec.rb'

# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
RSpec/HooksBeforeExamples:
Exclude:
- 'spec/features/crops/creating_a_crop_spec.rb'

# Offense count: 53
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/IncludeExamples:
Expand Down Expand Up @@ -371,12 +330,6 @@ RSpec/InstanceVariable:
RSpec/LetSetup:
Enabled: false

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
RSpec/MatchArray:
Exclude:
- 'spec/models/post_spec.rb'

# Offense count: 2
RSpec/MessageChain:
Exclude:
Expand Down Expand Up @@ -656,15 +609,6 @@ Rails/RootPathnameMethods:
- 'lib/tasks/import.rake'
- 'spec/rails_helper.rb'

# Offense count: 4
# Configuration parameters: ForbiddenMethods, AllowedMethods.
# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all
Rails/SkipsModelValidations:
Exclude:
- 'db/migrate/20240101010102_populate_crop_fields_from_openfarm_data.rb'
- 'db/migrate/20240810160538_set_default_language_for_existing_alternate_names.rb'
- 'db/migrate/20251128200506_add_description_to_crops.rb'

# Offense count: 21
Rails/ThreeStateBooleanColumn:
Enabled: false
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/activities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def create

repeat_times.times do |i|
new_activity = @activity.dup
new_activity.due_date = @activity.due_date + (i + 1) * repeat_weeks.weeks
new_activity.due_date = @activity.due_date + ((i + 1) * repeat_weeks.weeks)
new_activity.save
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ def github_releases
doc = Nokogiri::XML(response.body)
doc.xpath('//xmlns:entry').first(2).map do |entry|
{
title: entry.xpath('xmlns:title').text,
title: entry.xpath('xmlns:title').text,
content: entry.xpath('xmlns:content').text,
link: entry.xpath('xmlns:link/@href').text,
link: entry.xpath('xmlns:link/@href').text,
updated: entry.xpath('xmlns:updated').text
}
end
Expand Down
8 changes: 4 additions & 4 deletions app/helpers/crops_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ def crop_jsonld_data(crop, full_attributes: true)

crop.posts.each do |post|
subject_of_entities << {
'@type': "SocialMediaPosting",
url: post_url(post),
author: {
'@type': "SocialMediaPosting",
url: post_url(post),
author: {
'@type': 'Person',
name: post.author.login_name
name: post.author.login_name
},
'datePublished': post.created_at
}
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/search_harvests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def self.homepage_records(limit)
# Disabled for now so that more relevant harvests are
# surfaced; even if we're falling back to crop photos.
# photos_count: { gt: 0 },
owner_id: { not: owners }
owner_id: { not: owners }
}
one_record = search('*',
limit: 1,
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/search_plantings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def self.homepage_records(limit)
# Disabled for now so that more relevant plantings are
# surfaced; even if we're falling back to crop photos.
# photos_count: { gt: 0 },
owner_id: { not: owners }
owner_id: { not: owners }
}
one_record = search('*',
limit: 1,
Expand Down
4 changes: 2 additions & 2 deletions config/sitemap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

SitemapGenerator::Sitemap.adapter = SitemapGenerator::AwsSdkAdapter.new(
ENV['S3_SITEMAP_BUCKET'],
access_key_id: ENV['S3_ACCESS_KEY'],
access_key_id: ENV['S3_ACCESS_KEY'],
secret_access_key: ENV['S3_SECRET_KEY'],
region: ENV.fetch('S3_AWS_REGION', 'us-east-1')
region: ENV.fetch('S3_AWS_REGION', 'us-east-1')
)

SitemapGenerator::Sitemap.create do
Expand Down
Loading
Loading