diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-02 15:09:07 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-02 15:09:07 -0700 |
commit | 7a1a6c8ef26c787e4b6dd1602f3d158b37e81720 (patch) | |
tree | 1e390cd535b38368d091cbb33e5d419408d5ce00 /tasks | |
parent | 77f8739a4741e2370e40ec39345a92a6ea393a1a (diff) | |
download | chef-7a1a6c8ef26c787e4b6dd1602f3d158b37e81720.tar.gz |
fix Layout/EmptyLineAfterGuardClause
i like this one, gives visual priority to returns or raises that are
buried in the middle of things.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'tasks')
-rwxr-xr-x | tasks/docs.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tasks/docs.rb b/tasks/docs.rb index 0adebce0b6..71e0e83bdc 100755 --- a/tasks/docs.rb +++ b/tasks/docs.rb @@ -14,6 +14,7 @@ namespace :docs_site do # @return [String, nil] a pretty defaul value string or nil if we want to skip it def pretty_default(default) return nil if default.nil? || default == "" || default == "lazy default" + if default.is_a?(String) return default.inspect unless default[0] == ":" end @@ -91,11 +92,13 @@ namespace :docs_site do # @return String def bolded_description(name, description) return nil if description.nil? # handle resources missing descriptions + description.gsub( "#{name} ", "**#{name}** ").split("Note: ").first.strip end def note_text(description) return nil if description.nil? + note = description.split("Note: ")[1] if note <<-HEREDOC @@ -316,6 +319,7 @@ namespace :docs_site do resources = Chef::JSONCompat.parse(ResourceInspector.inspect) resources.each do |resource, data| next if ["scm", "whyrun_safe_ruby_block", "l_w_r_p_base", "user_resource_abstract_base_class", "linux_user", "pw_user", "aix_user", "dscl_user", "solaris_user", "windows_user", ""].include?(resource) + puts "Writing out #{resource}." @name = resource @description = data["description"] |