Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint/format-strings: Correctly exclude escaped percent symbols #14960

Merged
merged 1 commit into from Dec 22, 2018

Conversation

@luke-jr
Copy link
Member

@luke-jr luke-jr commented Dec 14, 2018

The current code fails to exclude correctly for patterns like "%%%X"

@practicalswift
Copy link
Contributor

@practicalswift practicalswift commented Dec 15, 2018

Concept ACK. Thanks for finding and fixing this.

@luke-jr, could you add a doctest test that fails before the fix and passes after the fix?

@@ -241,12 +241,11 @@ def count_format_specifiers(format_string):
4
"""
assert(type(format_string) is str)
format_string = format_string.replace('%%', 'X')
n = 0
in_specifier = False
for i, char in enumerate(format_string):
Copy link
Contributor

@practicalswift practicalswift Dec 16, 2018

i becomes unused after this change. Remove enumerate(...) :-)

for char in format_string:

@laanwj
Copy link
Member

@laanwj laanwj commented Dec 18, 2018

utACK, but yes no longer need i

Copy link
Member

@promag promag left a comment

tACK 5728119 — also tested @practicalswift suggestion.

@@ -241,12 +241,11 @@ def count_format_specifiers(format_string):
4
"""
Copy link
Member

@promag promag Dec 18, 2018

Could add an example here.

@MarcoFalke MarcoFalke merged commit 5728119 into bitcoin:master Dec 22, 2018
2 checks passed
MarcoFalke added a commit that referenced this issue Dec 22, 2018
…symbols

5728119 lint/format-strings: Correctly exclude escaped percent symbols (Luke Dashjr)

Pull request description:

  The current code fails to exclude correctly for patterns like `"%%%X"`

Tree-SHA512: cac6f6fb3f06a9190310cd9764ec31cd7d636f9c831057622f418ae5fd2e1d80927a88f585d18f57b279ac21e81518f714dc1a25155377b9297741a73600461e
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 27, 2021
…ercent symbols

5728119 lint/format-strings: Correctly exclude escaped percent symbols (Luke Dashjr)

Pull request description:

  The current code fails to exclude correctly for patterns like `"%%%X"`

Tree-SHA512: cac6f6fb3f06a9190310cd9764ec31cd7d636f9c831057622f418ae5fd2e1d80927a88f585d18f57b279ac21e81518f714dc1a25155377b9297741a73600461e
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 28, 2021
…ercent symbols

5728119 lint/format-strings: Correctly exclude escaped percent symbols (Luke Dashjr)

Pull request description:

  The current code fails to exclude correctly for patterns like `"%%%X"`

Tree-SHA512: cac6f6fb3f06a9190310cd9764ec31cd7d636f9c831057622f418ae5fd2e1d80927a88f585d18f57b279ac21e81518f714dc1a25155377b9297741a73600461e
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jun 29, 2021
…ercent symbols

5728119 lint/format-strings: Correctly exclude escaped percent symbols (Luke Dashjr)

Pull request description:

  The current code fails to exclude correctly for patterns like `"%%%X"`

Tree-SHA512: cac6f6fb3f06a9190310cd9764ec31cd7d636f9c831057622f418ae5fd2e1d80927a88f585d18f57b279ac21e81518f714dc1a25155377b9297741a73600461e
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jul 1, 2021
…ercent symbols

5728119 lint/format-strings: Correctly exclude escaped percent symbols (Luke Dashjr)

Pull request description:

  The current code fails to exclude correctly for patterns like `"%%%X"`

Tree-SHA512: cac6f6fb3f06a9190310cd9764ec31cd7d636f9c831057622f418ae5fd2e1d80927a88f585d18f57b279ac21e81518f714dc1a25155377b9297741a73600461e
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jul 1, 2021
…ercent symbols

5728119 lint/format-strings: Correctly exclude escaped percent symbols (Luke Dashjr)

Pull request description:

  The current code fails to exclude correctly for patterns like `"%%%X"`

Tree-SHA512: cac6f6fb3f06a9190310cd9764ec31cd7d636f9c831057622f418ae5fd2e1d80927a88f585d18f57b279ac21e81518f714dc1a25155377b9297741a73600461e
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jul 1, 2021
…ercent symbols

5728119 lint/format-strings: Correctly exclude escaped percent symbols (Luke Dashjr)

Pull request description:

  The current code fails to exclude correctly for patterns like `"%%%X"`

Tree-SHA512: cac6f6fb3f06a9190310cd9764ec31cd7d636f9c831057622f418ae5fd2e1d80927a88f585d18f57b279ac21e81518f714dc1a25155377b9297741a73600461e
UdjinM6 added a commit to UdjinM6/dash that referenced this issue Jul 5, 2021
…ercent symbols

5728119 lint/format-strings: Correctly exclude escaped percent symbols (Luke Dashjr)

Pull request description:

  The current code fails to exclude correctly for patterns like `"%%%X"`

Tree-SHA512: cac6f6fb3f06a9190310cd9764ec31cd7d636f9c831057622f418ae5fd2e1d80927a88f585d18f57b279ac21e81518f714dc1a25155377b9297741a73600461e
PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this issue Jul 8, 2021
…ercent symbols

5728119 lint/format-strings: Correctly exclude escaped percent symbols (Luke Dashjr)

Pull request description:

  The current code fails to exclude correctly for patterns like `"%%%X"`

Tree-SHA512: cac6f6fb3f06a9190310cd9764ec31cd7d636f9c831057622f418ae5fd2e1d80927a88f585d18f57b279ac21e81518f714dc1a25155377b9297741a73600461e
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants