Remove old version of relaxed styled guide

We had an old version under "contested settings" and it looks like some
of them were modified. I hope that our new, separate file will
discourage manual tweaks.

We can include the relaxed rules from a gem as well. Let's see if we
need that complexity one day.
This commit is contained in:
Maikel Linke
2022-02-25 10:51:54 +11:00
parent 1d15f35522
commit b999673dfc
6 changed files with 11 additions and 123 deletions

View File

@@ -76,117 +76,6 @@ Lint/UselessAssignment:
Exclude:
- spec/**/*
## Relaxed.Ruby.Style SETTINGS
#
# These styles are a starting point for the conversation around conventions
# They should be removed or tweaked and moved above as decisions are made
# NOTE: Cops which did not fail at the time of writing were removed
Layout/DotPosition:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styledotposition
Layout/SpaceBeforeBlockBraces:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylespacebeforeblockbraces
Layout/SpaceInsideParens:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylespaceinsideparens
Style/Alias:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylealias
Style/BlockDelimiters:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styleblockdelimiters
Style/CommentAnnotation:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylecommentannotation
Style/DoubleNegation:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styledoublenegation
Style/FormatString:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styleformatstring
Style/HashEachMethods:
Enabled: false
Style/HashTransformKeys:
Enabled: false
Style/HashTransformValues:
Enabled: false
Style/IfUnlessModifier:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styleifunlessmodifier
Style/Lambda:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylelambda
Style/MultilineBlockChain:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylemultilineblockchain
Style/NegatedIf:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylenegatedif
Style/NegatedWhile:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylenegatedwhile
Style/ParallelAssignment:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styleparallelassignment
Style/PercentLiteralDelimiters:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylepercentliteraldelimiters
Style/Semicolon:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylesemicolon
Style/SingleLineMethods:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylesinglelinemethods
Style/TrailingCommaInArguments:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styletrailingcommainarguments
Style/TrailingCommaInArrayLiteral:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styletrailingcommainliteral
Style/TrailingCommaInHashLiteral:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styletrailingcommainliteral
Style/WordArray:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylewordarray
Style/SymbolArray:
Enabled: false
StyleGuide: https://rubocop.readthedocs.io/en/latest/cops_style/#stylesymbolarray
Lint/AmbiguousRegexpLiteral:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#lintambiguousregexpliteral
Lint/AssignmentInCondition:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#lintassignmentincondition
Metrics/AbcSize:
Enabled: true
Max: 15

View File

@@ -35,7 +35,7 @@ module Spree
end
def options
preferences.each_with_object({}){ |(key, value), memo| memo[key.to_sym] = value; }
preferences.transform_keys(&:to_sym)
end
def method_missing(method, *args)

View File

@@ -93,7 +93,7 @@ module Spree
end
def clear_preferences
preferences.keys.each { |pref| preference_store.delete preference_cache_key(pref) }
preferences.each_key { |pref| preference_store.delete preference_cache_key(pref) }
end
private

View File

@@ -41,14 +41,14 @@ module OrderManagement
# This uses `deliver_now` since it's called from inside a job
def send_placement_summary_emails
@summaries.values.each do |summary|
@summaries.each_value do |summary|
SubscriptionMailer.placement_summary_email(summary).deliver_now
end
end
# This uses `deliver_now` since it's called from inside a job
def send_confirmation_summary_emails
@summaries.values.each do |summary|
@summaries.each_value do |summary|
SubscriptionMailer.confirmation_summary_email(summary).deliver_now
end
end

View File

@@ -55,7 +55,7 @@ module OpenFoodNetwork
def build_i18n_key_lookup
lookup = {}
I18n.t("inflections")&.each do |key, translations|
translations.values.each do |translation|
translations.each_value do |translation|
lookup[translation.downcase] = key
end
end

View File

@@ -43,13 +43,12 @@ module OpenFoodNetwork
hubs = variant_override_hubs
# Permissions granted by create_variant_overrides relationship from producer to hub
permissions = Hash[
EnterpriseRelationship.
permitting(hubs.select("enterprises.id")).
with_permission(:create_variant_overrides).
group_by(&:child_id).
map { |child_id, ers| [child_id, ers.map(&:parent_id)] }
]
permissions =
EnterpriseRelationship.
permitting(hubs.select("enterprises.id")).
with_permission(:create_variant_overrides).
group_by(&:child_id).
transform_values { |ers| ers.map(&:parent_id) }
# Allow a producer hub to override it's own products without explicit permission
hubs.is_primary_producer.each do |hub|