Jira (PUP-10054) Incorrect function in documentation examples for strip and rstrip functions

0 views
Skip to first unread message

Brian Krische (JIRA)

unread,
Sep 30, 2019, 10:28:05 AM9/30/19
to puppe...@googlegroups.com
Brian Krische created an issue
 
Puppet / Improvement PUP-10054
Incorrect function in documentation examples for strip and rstrip functions
Issue Type: Improvement Improvement
Assignee: Unassigned
Components: Docs
Created: 2019/09/30 7:27 AM
Priority: Normal Normal
Reporter: Brian Krische

In the documentation, the example usages for the functions strip and rstrip are wrong, they both seem to show usage of lstrip and not the appropriate function.

  • strip shows usage of lstrip
  • rstrip shows usage of lstrip
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Henrik Lindberg (JIRA)

unread,
Sep 30, 2019, 10:57:04 AM9/30/19
to puppe...@googlegroups.com
Henrik Lindberg commented on Improvement PUP-10054
 
Re: Incorrect function in documentation examples for strip and rstrip functions

Meh... (it also uses camelcase() in an example - which is yet another copy/paste error in there).

This is the version on master:

# ```puppet
# " hello\n\t".lstrip()
# camelcase(" hello\n\t")
# ```
# Would both result in `"hello"`
#
# @example Removing trailing space from strings in an Array
# ```puppet
# [" hello\n\t", " hi\n\t"].lstrip()
# lstrip([" hello\n\t", " hi\n\t"])
# ```
# Would both result in `['hello', 'hi']`
#

Should be changed to:

# ```puppet
# " hello\n\t".strip()
# strip(" hello\n\t")
# ```
# Would both result in `"hello"`
#
# @example Removing trailing space from strings in an Array
# ```puppet
# [" hello\n\t", " hi\n\t"].strip()
# strip([" hello\n\t", " hi\n\t"])
# ```
# Would both result in `['hello', 'hi']`
#

Henrik Lindberg (JIRA)

unread,
Sep 30, 2019, 10:59:03 AM9/30/19
to puppe...@googlegroups.com

And this is the master version of rstrip:

# @example Removing trailing space from a String
# ```puppet
# "hello\n\t".lstrip()
# camelcase("hello\n\t")
# ```
# Would both result in `"hello"`
#
# @example Removing trailing space from strings in an Array
# ```puppet
# ["hello\n\t", "hi\n\t"].lstrip()
# lstrip(["hello\n\t", "hi\n\t"])
# ```
# Would both result in `['hello', 'hi']`
#

Which should be changed to:

# @example Removing trailing space from a String
# ```puppet
# " hello\n\t".rstrip()
# rstrip(" hello\n\t")
# ```
# Would both result in `" hello"`
#
# @example Removing trailing space from strings in an Array
# ```puppet
# [" hello\n\t", " hi\n\t"].lstrip()
# rstrip([" hello\n\t", " hi\n\t"])
# ```
# Would both result in `[' hello', ' hi']`
#

Henrik Lindberg (JIRA)

unread,
Sep 30, 2019, 10:59:03 AM9/30/19
to puppe...@googlegroups.com

Henrik Lindberg (JIRA)

unread,
Sep 30, 2019, 11:04:04 AM9/30/19
to puppe...@googlegroups.com
Henrik Lindberg commented on Bug PUP-10054
 
Re: Incorrect function in documentation examples for strip and rstrip functions

And of cource - lstrip() is also wrong:
it has:

# @example Removing leading space from a String
# ```puppet
# "\n\thello".lstrip()
# camelcase("\n\thello")
# ```
# Would both result in `"hello"`
#
# @example Removing leading space from strings in an Array
# ```puppet
# ["\n\thello", "\n\thi"].lstrip()
# lstrip(["\n\thello", "\n\thi"])
# ```
# Would both result in `['hello', 'hi']`
#

and should be changed to:

# @example Removing leading space from a String
# ```puppet
# "\n\thello ".lstrip()
# lstrip("\n\thello ")
# ```
# Would both result in `"hello "`
#
# @example Removing leading space from strings in an Array
# ```puppet
# ["\n\thello ", "\n\thi "].lstrip()
# lstrip(["\n\thello ", "\n\thi "])
# ```
# Would both result in `['hello ', 'hi ']`
#

Josh Cooper (JIRA)

unread,
Sep 30, 2019, 12:28:03 PM9/30/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Oct 30, 2019, 2:16:03 AM10/30/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Dec 6, 2019, 1:07:05 PM12/6/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Dec 6, 2019, 1:08:05 PM12/6/19
to puppe...@googlegroups.com

Claire Cadman (Jira)

unread,
Jul 31, 2020, 5:17:04 AM7/31/20
to puppe...@googlegroups.com
Claire Cadman assigned an issue to Claire Cadman
Change By: Claire Cadman
Assignee: Claire Cadman
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Claire Cadman (Jira)

unread,
Jul 31, 2020, 5:17:04 AM7/31/20
to puppe...@googlegroups.com

Claire Cadman (Jira)

unread,
Aug 3, 2020, 10:05:03 AM8/3/20
to puppe...@googlegroups.com

Claire Cadman (Jira)

unread,
Aug 10, 2020, 5:57:04 AM8/10/20
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages