Skip to content

Commit

Permalink
# Linting
Browse files Browse the repository at this point in the history
Signed-off-by: Theo Truong <[email protected]>
  • Loading branch information
nhtruong committed Jan 16, 2025
1 parent cd7b38b commit 8b3502c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions spec-insert/lib/doc_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

# Processes a file, replacing spec-insert blocks with rendered content
class DocProcessor
START_MARKER = /<!-- spec_insert_start/
END_MARKER = /<!-- spec_insert_end -->/
START_MARKER = /<!-- spec_insert_start/.freeze
END_MARKER = /<!-- spec_insert_end -->/.freeze

def initialize(file_path, logger:)
@file_path = Pathname(file_path)
Expand Down
5 changes: 2 additions & 3 deletions spec-insert/lib/renderers/parameter_table_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,12 @@ def description(param)

# @param [Parameter] param
def valid_values(param)
enums = (extract_enum_values(param.schema))&.compact
enums = extract_enum_values(param.schema)&.compact
return '' unless enums.present?
if enums.none? { |enum| enum[:description].present? }
" <br> Valid values are: #{enums.map { |enum| "`#{enum[:value]}`" }.join(', ')}"
else
' <br> Valid values are: <br> ' +
enums.map { |enum| "- `#{enum[:value]}`: #{enum[:description]}" }.join(' </br> ')
" <br> Valid values are: <br> #{enums.map { |enum| "- `#{enum[:value]}`: #{enum[:description]}" }.join(' </br> ')}"
end
end

Expand Down

0 comments on commit 8b3502c

Please sign in to comment.