Class: Packwerk::Privacy::Validator

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Includes:
Validator
Defined in:
lib/packwerk/privacy/validator.rb

Constant Summary collapse

Result =
Packwerk::Validator::Result

Instance Method Summary collapse

Instance Method Details

#call(package_set, configuration) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/packwerk/privacy/validator.rb', line 13

def call(package_set, configuration)
  privacy_settings = package_manifests_settings_for(configuration, 'enforce_privacy')

  results = T.let([], T::Array[Result])

  privacy_settings.each do |config_file_path, setting|
    results << check_enforce_privacy_setting(config_file_path, setting)
  end

  results += verify_private_constants_setting(package_set, configuration)

  public_path_settings = package_manifests_settings_for(configuration, 'public_path')
  public_path_settings.each do |config_file_path, setting|
    results << check_public_path(config_file_path, setting)
  end

  merge_results(results, separator: "\n---\n")
end

#permitted_keysObject



33
34
35
# File 'lib/packwerk/privacy/validator.rb', line 33

def permitted_keys
  %w[public_path enforce_privacy private_constants ignored_private_constants strict_privacy_ignored_patterns]
end