diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-02 11:11:35 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-02 11:13:54 -0700 |
commit | 77f8739a4741e2370e40ec39345a92a6ea393a1a (patch) | |
tree | bcf3c9a12556ce1fd18a83cd5f68cd24d36a1180 /lib/chef/resource/locale.rb | |
parent | 90a74a80196725c4198b6042e8485d68c70777ac (diff) | |
download | chef-77f8739a4741e2370e40ec39345a92a6ea393a1a.tar.gz |
fix Layout/AlignArgumentslcg/new-chefstyle
this is using:
Layout/AlignArguments:
Enabled: true
EnforcedStyle: with_fixed_indentation
the default style can use really excessive whitespace. on starting
lines which are already long, it fully indents across to where the
arguments start and then begins the line there.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/resource/locale.rb')
-rw-r--r-- | lib/chef/resource/locale.rb | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/chef/resource/locale.rb b/lib/chef/resource/locale.rb index 73a67f215e..f833a4e7d3 100644 --- a/lib/chef/resource/locale.rb +++ b/lib/chef/resource/locale.rb @@ -32,27 +32,27 @@ class Chef LOCALE_PLATFORM_FAMILIES = %w{debian}.freeze property :lang, String, - description: "Sets the default system language.", - regex: [LOCALE_REGEX], - validation_message: "The provided lang is not valid. It should be a non-empty string without any leading whitespaces." + description: "Sets the default system language.", + regex: [LOCALE_REGEX], + validation_message: "The provided lang is not valid. It should be a non-empty string without any leading whitespaces." property :lc_env, Hash, - description: "A Hash of LC_* env variables in the form of ({ 'LC_ENV_VARIABLE' => 'VALUE' }).", - default: lazy { {} }, - coerce: proc { |h| - if h.respond_to?(:keys) - invalid_keys = h.keys - LC_VARIABLES - unless invalid_keys.empty? - error_msg = "Key of option lc_env must be equal to one of: \"#{LC_VARIABLES.join('", "')}\"! You passed \"#{invalid_keys.join(', ')}\"." - raise Chef::Exceptions::ValidationFailed, error_msg - end - end - unless h.values.all? { |x| x =~ LOCALE_REGEX } - error_msg = "Values of option lc_env should be non-empty string without any leading whitespaces." - raise Chef::Exceptions::ValidationFailed, error_msg - end - h - } + description: "A Hash of LC_* env variables in the form of ({ 'LC_ENV_VARIABLE' => 'VALUE' }).", + default: lazy { {} }, + coerce: proc { |h| + if h.respond_to?(:keys) + invalid_keys = h.keys - LC_VARIABLES + unless invalid_keys.empty? + error_msg = "Key of option lc_env must be equal to one of: \"#{LC_VARIABLES.join('", "')}\"! You passed \"#{invalid_keys.join(', ')}\"." + raise Chef::Exceptions::ValidationFailed, error_msg + end + end + unless h.values.all? { |x| x =~ LOCALE_REGEX } + error_msg = "Values of option lc_env should be non-empty string without any leading whitespaces." + raise Chef::Exceptions::ValidationFailed, error_msg + end + h + } # @deprecated Use {#lc_env} instead of this property. # {#lc_env} uses Hash with specific LC var as key. |