diff --git a/doc_src/conf.py b/doc_src/conf.py index 2ac442154..a105fdfcd 100644 --- a/doc_src/conf.py +++ b/doc_src/conf.py @@ -31,16 +31,16 @@ def issue_role(name, rawtext, text, lineno, inliner, options=None, content=None) if issue_num <= 0: raise ValueError except ValueError: - msg = inliner.reporter.error( - 'Invalid issue number: "%s"' % text, line=lineno) + msg = inliner.reporter.error('Invalid issue number: "%s"' % text, line=lineno) prb = inliner.problematic(rawtext, rawtext, msg) return [prb], [msg] - template=issue_url + "/{n}" + template = issue_url + "/{n}" ref = template.format(n=issue_num) issue_text = "#{issue_no}".format(issue_no=issue_num) link = nodes.reference(text=issue_text, refuri=ref, **options) return [link], [] + # -- Load our extensions ------------------------------------------------- def setup(app): # Our own pygments lexer diff --git a/share/tools/web_config/webconfig.py b/share/tools/web_config/webconfig.py index 07e17183c..a46aacbaa 100755 --- a/share/tools/web_config/webconfig.py +++ b/share/tools/web_config/webconfig.py @@ -532,7 +532,11 @@ def append_html_for_ansi_escape(full_val, result, span_open): if match is not None: close_span() # Just use the rgb values directly - html_color = "#%02x%02x%02x" % (int(match.group(1)), int(match.group(2)), int(match.group(3))) + html_color = "#%02x%02x%02x" % ( + int(match.group(1)), + int(match.group(2)), + int(match.group(3)), + ) result.append('') return True # span now open diff --git a/src/builtin_math.cpp b/src/builtin_math.cpp index 2bf6514d1..7a878b70a 100644 --- a/src/builtin_math.cpp +++ b/src/builtin_math.cpp @@ -72,8 +72,8 @@ static int parse_cmd_opts(math_cmd_opts_t &opts, int *optind, //!OCLINT(high nc } else { opts.base = fish_wcstoi(w.woptarg); if (errno || (opts.base != 8 && opts.base != 16)) { - streams.err.append_format(_(L"%ls: '%ls' is not a valid base value\n"), - cmd, w.woptarg); + streams.err.append_format(_(L"%ls: '%ls' is not a valid base value\n"), cmd, + w.woptarg); return STATUS_INVALID_ARGS; } } @@ -99,8 +99,8 @@ static int parse_cmd_opts(math_cmd_opts_t &opts, int *optind, //!OCLINT(high nc } } if (opts.have_scale && opts.scale != 0 && opts.base != 10) { - streams.err.append_format(_(L"%ls: Bases other than 10 can only do scale=0 output currently\n"), - cmd, w.woptarg); + streams.err.append_format( + _(L"%ls: Bases other than 10 can only do scale=0 output currently\n"), cmd, w.woptarg); return STATUS_INVALID_ARGS; } @@ -197,7 +197,6 @@ static wcstring format_double(double v, const math_cmd_opts_t &opts) { return format_string(L"%.*f", opts.scale, v); } - wcstring ret = format_string(L"%.*f", opts.scale, v); // If we contain a decimal separator, trim trailing zeros after it, and then the separator // itself if there's nothing after it. Detect a decimal separator as a non-digit. diff --git a/src/builtin_string.cpp b/src/builtin_string.cpp index 234a9d1f7..bc3b0144a 100644 --- a/src/builtin_string.cpp +++ b/src/builtin_string.cpp @@ -1058,7 +1058,7 @@ class pcre2_matcher_t : public string_matcher_t { // See pcre2demo.c for an explanation of this logic. PCRE2_SIZE arglen = arg.length(); auto rc = report_match(arg, pcre2_match(regex.code, PCRE2_SPTR(arg.c_str()), arglen, 0, 0, - regex.match, nullptr)); + regex.match, nullptr)); // We only import variables for the *first matching argument* bool had_match = false; if (rc == match_result_t::match && !imported_vars) { diff --git a/src/complete.cpp b/src/complete.cpp index 7fffa70b4..c321f3989 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -244,9 +244,7 @@ bool completion_receiver_t::add(completion_t &&comp) { return true; } -bool completion_receiver_t::add(wcstring &&comp) { - return this->add(std::move(comp), wcstring{}); -} +bool completion_receiver_t::add(wcstring &&comp) { return this->add(std::move(comp), wcstring{}); } bool completion_receiver_t::add(wcstring &&comp, wcstring desc, complete_flags_t flags, string_fuzzy_match_t match) { diff --git a/src/fish_test_helper.cpp b/src/fish_test_helper.cpp index 13e1ecc45..1270772db 100644 --- a/src/fish_test_helper.cpp +++ b/src/fish_test_helper.cpp @@ -127,7 +127,6 @@ static void print_stop_cont() { exit(0); } } - } static void show_help(); diff --git a/src/reader.cpp b/src/reader.cpp index f594d877c..8e4b6a44e 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -3694,7 +3694,7 @@ maybe_t reader_data_t::readline(int nchars_or_0) { history_search.reset(); // Get the current terminal modes. These will be restored when the function returns. - struct termios old_modes{}; + struct termios old_modes {}; if (tcgetattr(conf.in, &old_modes) == -1 && errno == EIO) redirect_tty_output(); // Set the new modes. diff --git a/src/tinyexpr.cpp b/src/tinyexpr.cpp index f6b11c3fd..d858bf284 100644 --- a/src/tinyexpr.cpp +++ b/src/tinyexpr.cpp @@ -222,7 +222,8 @@ static const te_builtin *find_builtin(const char *name, int len) { return std::strncmp(lhs.name, rhs, len) < 0; }); // We need to compare again because we might have gotten the first "larger" element. - if (found != end && std::strncmp(found->name, name, len) == 0 && found->name[len] == 0) return found; + if (found != end && std::strncmp(found->name, name, len) == 0 && found->name[len] == 0) + return found; return nullptr; } diff --git a/tests/pexpects/fg2.py b/tests/pexpects/fg2.py index a02d5429e..a01b94bd7 100644 --- a/tests/pexpects/fg2.py +++ b/tests/pexpects/fg2.py @@ -41,7 +41,7 @@ send("\x1A") sleep(0.1) expect_prompt("has stopped") sendline("fg") -sleep(0.1) # allow tty to transfer +sleep(0.1) # allow tty to transfer send("\x03") # control-c to cancel it expect_prompt() @@ -51,13 +51,13 @@ expect_prompt("jobs: There are no jobs") # Regression test for #2214: foregrounding from a key binding works! sendline(r"bind \cr 'fg >/dev/null 2>/dev/null'") expect_prompt() -sendline("$fish_test_helper print_stop_cont"); +sendline("$fish_test_helper print_stop_cont") sleep(0.2) -send("\x1A") # ctrl-z +send("\x1A") # ctrl-z expect_prompt("SIGTSTP") sleep(0.1) -send("\x12") # ctrl-r, placing fth in foreground +send("\x12") # ctrl-r, placing fth in foreground expect_str("SIGCONT") # Do it again. diff --git a/tests/pexpects/pipeline.py b/tests/pexpects/pipeline.py index 0afec9187..129bc2411 100644 --- a/tests/pexpects/pipeline.py +++ b/tests/pexpects/pipeline.py @@ -2,7 +2,12 @@ from pexpect_helper import SpawnedProc sp = SpawnedProc() -send, sendline, expect_prompt, expect_str = sp.send, sp.sendline, sp.expect_prompt, sp.expect_str +send, sendline, expect_prompt, expect_str = ( + sp.send, + sp.sendline, + sp.expect_prompt, + sp.expect_str, +) expect_prompt() sendline("function echo_wrap ; /bin/echo $argv ; sleep 0.1; end")