From d4e6db4153fc6de495707f60ffbb6a537bbda8d4 Mon Sep 17 00:00:00 2001 From: Zakir Dzhamaliddinov Date: Mon, 21 Oct 2024 13:12:59 +0300 Subject: [PATCH] Review fixes --- lib/core/terraform_config/generator.rb | 8 ++------ lib/core/terraform_config/policy.rb | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/core/terraform_config/generator.rb b/lib/core/terraform_config/generator.rb index b3212c04..5636a5cb 100644 --- a/lib/core/terraform_config/generator.rb +++ b/lib/core/terraform_config/generator.rb @@ -9,8 +9,7 @@ def initialize(config:, template:) @template = template.deep_underscore_keys.deep_symbolize_keys end - # rubocop:disable Metrics/MethodLength - def filename + def filename # rubocop:disable Metrics/MethodLength case kind when "gvc" "gvc.tf" @@ -24,7 +23,6 @@ def filename raise "Unsupported template kind - #{kind}" end end - # rubocop:enable Metrics/MethodLength def tf_config method_name = :"#{kind}_config" @@ -39,8 +37,7 @@ def kind @kind ||= template[:kind] end - # rubocop:disable Metrics/MethodLength - def gvc_config + def gvc_config # rubocop:disable Metrics/MethodLength TerraformConfig::Gvc.new( **template .slice(:name, :description, :tags) @@ -53,7 +50,6 @@ def gvc_config ) ) end - # rubocop:enable Metrics/MethodLength def identity_config TerraformConfig::Identity.new(**template.slice(:name, :description, :tags).merge(gvc: gvc)) diff --git a/lib/core/terraform_config/policy.rb b/lib/core/terraform_config/policy.rb index 09cdbff9..65d0692a 100644 --- a/lib/core/terraform_config/policy.rb +++ b/lib/core/terraform_config/policy.rb @@ -1,8 +1,7 @@ # frozen_string_literal: true module TerraformConfig - # rubocop:disable Metrics/ClassLength - class Policy < Base + class Policy < Base # rubocop:disable Metrics/ClassLength TARGET_KINDS = %w[ agent auditctx cloudaccount domain group gvc identity image ipset kubernetes location org policy quota secret serviceaccount task user volumeset workload @@ -12,8 +11,7 @@ class Policy < Base attr_reader :name, :description, :tags, :target_kind, :gvc, :target, :target_links, :target_query, :bindings - # rubocop:disable Metrics/ParameterLists, Metrics/MethodLength - def initialize( + def initialize( # rubocop:disable Metrics/ParameterLists, Metrics/MethodLength name:, description: nil, tags: nil, @@ -42,7 +40,6 @@ def initialize( @target_query = target_query&.deep_underscore_keys&.deep_symbolize_keys @bindings = bindings&.map { |data| data.deep_underscore_keys.deep_symbolize_keys } end - # rubocop:enable Metrics/ParameterLists, Metrics/MethodLength def to_tf block :resource, :cpln_policy, name do @@ -143,5 +140,4 @@ def validate_term!(term) "`property`, `rel`, or `tag`." end end - # rubocop:enable Metrics/ClassLength end