Skip to content

Commit 448c3db

Browse files
committed
update rubocop config
1 parent cf08c08 commit 448c3db

5 files changed

Lines changed: 6 additions & 10 deletions

File tree

.rubocop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ Metrics/AbcSize:
2424
Max: 200 # Increased from default 17
2525

2626
Metrics/CyclomaticComplexity:
27-
Max: 50 # Increased from default 7
27+
Max: 65 # Increased from default 7
2828

2929
Metrics/PerceivedComplexity:
30-
Max: 40 # Increased from default 8
30+
Max: 65 # Increased from default 8
3131

3232
# Allow longer methods for complex logic
3333
Metrics/MethodLength:

lib/code_to_query/compiler.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def compile_with_arel(intent)
197197
compile_with_string_building(intent)
198198
end
199199

200-
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity, Metrics/BlockLength
200+
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/BlockLength
201201
# NOTE: This method is intentionally monolithic for clarity and to avoid regressions in SQL assembly.
202202
# TODO: Extract EXISTS/NOT EXISTS handling and simple predicate building into small helpers.
203203
def compile_with_string_building(intent)
@@ -426,7 +426,7 @@ def compile_with_string_building(intent)
426426

427427
{ sql: sql_parts.join(' '), params: params_hash, bind_spec: bind_spec }
428428
end
429-
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity, Metrics/BlockLength
429+
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength, Metrics/BlockLength
430430

431431
def apply_policy_in_subquery(sub_where, bind_spec, related_table, placeholder_index)
432432
return [sub_where, placeholder_index] unless @config.policy_adapter.respond_to?(:call)

lib/code_to_query/planner.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ def strip_unknown_columns(intent, schema)
159159

160160
# Fill missing intent params with simple values parsed from the prompt.
161161
# Example: "student with id 17963" -> maps first integer to first missing *_id param.
162-
# rubocop:disable Metrics/PerceivedComplexity
163162
def backfill_params_from_prompt(prompt, intent, schema)
164163
return intent unless prompt.is_a?(String)
165164
return intent unless intent.is_a?(Hash)
@@ -256,7 +255,6 @@ def backfill_params_from_prompt(prompt, intent, schema)
256255
rescue StandardError
257256
intent
258257
end
259-
# rubocop:enable Metrics/PerceivedComplexity
260258

261259
def extract_enums_index(schema)
262260
index = Hash.new { |h, k| h[k] = {} }

lib/code_to_query/providers/base.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def extract_intent(prompt:, schema:, allow_tables:)
1616

1717
protected
1818

19-
# rubocop:disable Metrics/PerceivedComplexity, Metrics/BlockNesting
19+
# rubocop:disable Metrics/BlockNesting
2020
def build_system_context(schema, allow_tables)
2121
# Support passing either a raw schema hash ({'tables'=>[...]})
2222
# or a full context pack ({'schema'=>{...}, 'models'=>{...}, 'glossary'=>{...}})
@@ -96,7 +96,7 @@ def build_system_context(schema, allow_tables)
9696
constraints: build_constraints_info
9797
}
9898
end
99-
# rubocop:enable Metrics/PerceivedComplexity, Metrics/BlockNesting
99+
# rubocop:enable Metrics/BlockNesting
100100

101101
def build_constraints_info
102102
base_constraints = [

lib/code_to_query/validator.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ def preprocess_exists_filters(intent_hash)
9393
intent
9494
end
9595

96-
# rubocop:disable Metrics/PerceivedComplexity
9796
def enforce_allowlists!(intent, current_user:, allow_tables:)
9897
# Enforce table allowlist if provided (from user input)
9998
if Array(allow_tables).any?
@@ -192,7 +191,6 @@ def enforce_allowlists!(intent, current_user:, allow_tables:)
192191
# Re-raise as ArgumentError to keep validator contract
193192
raise ArgumentError, e.message
194193
end
195-
# rubocop:enable Metrics/PerceivedComplexity
196194

197195
def safe_call_policy_adapter(adapter, current_user, table:, intent:)
198196
adapter.call(current_user, table: table, intent: intent)

0 commit comments

Comments
 (0)