Skip to content

Commit 278e203

Browse files
committed
style(_quote_readline_by_ref): lint fixes
1 parent 91d3b26 commit 278e203

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

bash_completion

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,10 +552,10 @@ _quote_readline_by_ref()
552552
# to drop the additional quoting. See also:
553553
# https://www.mail-archive.com/[email protected]/msg01942.html
554554
if [[ ${!2} == \$\'*\' ]]; then
555-
local value=${!2:2:-1} # Strip beginning $' and ending '.
556-
value=${value//'%'/%%} # Escape % for printf format.
555+
local value=${!2:2:-1} # Strip beginning $' and ending '.
556+
value=${value//'%'/%%} # Escape % for printf format.
557557
# shellcheck disable=SC2059
558-
printf -v value "$value" # Decode escape sequences of \....
558+
printf -v value "$value" # Decode escape sequences of \....
559559
local "$2" && _upvars -v "$2" "$value"
560560
fi
561561
fi

test/t/unit/test_unit_quote_readline.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def test_github_issue_492_3(self, bash):
7676
assert_bash_exec(bash, "quote_readline $'\\'$*' >/dev/null")
7777

7878
def test_github_issue_526_1(self, bash):
79-
"""Regression tests for unprocessed escape sequences after quotes
79+
r"""Regression tests for unprocessed escape sequences after quotes
8080
8181
Ref [1] https://github.com/scop/bash-completion/pull/492#discussion_r637213822
8282
Ref [2] https://github.com/scop/bash-completion/pull/526
@@ -91,7 +91,13 @@ def test_github_issue_526_1(self, bash):
9191
9292
"""
9393
os.mkdir("./alpha\tbeta")
94-
assert assert_complete(bash, "echo alpha\\\026\tb", rendered_cmd="echo alpha\\ b") == "eta/"
94+
assert (
95+
assert_complete(
96+
bash, "echo alpha\\\026\tb", rendered_cmd="echo alpha\\ b"
97+
)
98+
== "eta/"
99+
)
100+
95101

96102
@pytest.mark.bashcomp(cmd=None, temp_cwd=True, pre_cmds=("shopt -s failglob",))
97103
class TestUnitQuoteReadlineWithFailglob:

0 commit comments

Comments
 (0)