Skip to content

Conversation

@SwagDevOps
Copy link

Description

Add shell comments support in .yardopts file.

For example you can write a .yardopts like this :

# vim: ft=sh

lib/**/*.rb                                   \
    --no-progress                             \
    --markup-provider 'redcarpet'             \
    --markup 'markdown'                       \
    --charset 'utf-8'                         \
    --protected --private --embed-mixins      \
    --tag type:'type' --hide-tag 'type'       \
    --readme README.md                        \
    --exclude '/\\.#'

# Local Variables:
# mode: sh
# End:

Before modifications, comments are split as arguments, for example in:

files.delete_if {|x| x =~ /\A\s*\Z/ } # remove empty ones

They are seen as:

["vim:", "ft=sh", "lib/**/*.rb", "#", "Local", "Variables:", "#", "mode:", "sh", "#", "End:"]

Instead of:

[ "lib/**/*.rb"]

Completed Tasks

  • I have read the Contributing Guide.
  • The pull request is complete (implemented / written).
  • Git commits have been cleaned up (squash WIP / revert commits).
  • I wrote tests and ran bundle exec rake locally (if code is attached to PR).

ATM I don't know how to write a test (in this present context). Cuse there is no example IMHO :

grep -FRin 'yardopts(' spec/

@coveralls
Copy link

coveralls commented Jun 6, 2020

Coverage Status

Coverage remained the same at 93.439% when pulling c4b8a61 on SwagDevOps:add-yardopts-comments-support into 84c983d on lsegal:master.

@lsegal lsegal closed this Jun 20, 2020
@lsegal lsegal reopened this Jun 20, 2020
@lsegal lsegal changed the base branch from master to main June 20, 2020 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants