diff --git a/build_tools/littlecheck.py b/build_tools/littlecheck.py index 106478f0f..ef36c111e 100755 --- a/build_tools/littlecheck.py +++ b/build_tools/littlecheck.py @@ -117,7 +117,7 @@ class RunCmd(object): class TestFailure(object): - def __init__(self, line, check, testrun, after = None): + def __init__(self, line, check, testrun, after=None): self.line = line self.check = check self.testrun = testrun @@ -185,7 +185,7 @@ class TestFailure(object): fmtstrs += [ " additional output:", " {BOLD}{additional_output}{RESET}", - ] + ] fmtstrs += [" when running command:", " {subbed_command}"] return "\n".join(fmtstrs).format(**fields) @@ -243,7 +243,14 @@ class TestRun(object): # Failed to match. lineq.pop() # Add context, ignoring empty lines. - return TestFailure(line, check, self, after = [line.text for line in lineq[::-1] if not line.is_empty_space()]) + return TestFailure( + line, + check, + self, + after=[ + line.text for line in lineq[::-1] if not line.is_empty_space() + ], + ) # Drain empties. while lineq and lineq[-1].is_empty_space(): lineq.pop() @@ -440,14 +447,15 @@ def get_argparse(): parser.add_argument( "-p", "--progress", - action='store_true', - dest='progress', + action="store_true", + dest="progress", help="Show the files to be checked", default=False, ) parser.add_argument("file", nargs="+", help="File to check") parser.add_argument( - "-A", "--after", + "-A", + "--after", type=int, help="How many non-empty lines of output after a failure to print (default: 5)", action="store", @@ -471,7 +479,7 @@ def main(): for path in args.file: fields["path"] = path if config.progress: - print("Testing file {path} ... ".format(**fields), end='') + print("Testing file {path} ... ".format(**fields), end="") subs = def_subs.copy() subs["s"] = path if not check_path(path, subs, config, TestFailure.print_message): diff --git a/share/completions/vmctl.fish b/share/completions/vmctl.fish index ff0c3144b..0bec88108 100644 --- a/share/completions/vmctl.fish +++ b/share/completions/vmctl.fish @@ -1,9 +1,9 @@ function __fish_get_vmctl_vms - for line in (vmctl status | string match -e -v "MAXMEM"); - set a (string split " " $line) - and printf "%s " $a[-1] - end + for line in (vmctl status | string match -e -v "MAXMEM") + set a (string split " " $line) + and printf "%s " $a[-1] + end end complete -c vmctl -xa 'console create load log reload reset start status stop pause unpause send receive' -n 'not __fish_seen_subcommand_from list console create load log reload reset start status stop pause unpause send receive' diff --git a/share/functions/__fish_complete_gpg_key_id.fish b/share/functions/__fish_complete_gpg_key_id.fish index 102928783..0abdceefd 100644 --- a/share/functions/__fish_complete_gpg_key_id.fish +++ b/share/functions/__fish_complete_gpg_key_id.fish @@ -5,13 +5,13 @@ function __fish_complete_gpg_key_id -d 'Complete using gpg key ids' -a __fish_co set -l keyid $__fish_complete_gpg_command --list-keys --with-colons | while read garbage switch $garbage - # Extract user ids (note: gpg escapes colons as '\x3a') case "uid*" + # Extract user ids (note: gpg escapes colons as '\x3a') set -l __uid (string split ":" -- $garbage) set uid (string replace -a '\x3a' ':' -- $__uuid[10]) printf "%s\t%s\n" $keyid $uid - # Extract key fingerprints (no subkeys) case "pub*" + # Extract key fingerprints (no subkeys) set -l __pub (string split ":" -- $garbage) set keyid $__pub[5] end diff --git a/share/functions/__fish_make_completion_signals.fish b/share/functions/__fish_make_completion_signals.fish index 8a00de8ea..e32b1e220 100644 --- a/share/functions/__fish_make_completion_signals.fish +++ b/share/functions/__fish_make_completion_signals.fish @@ -8,11 +8,11 @@ function __fish_make_completion_signals --description 'Make list of kill signals # Just hardcode the signals. if uname | string match -q 'CYGWIN*' set -a __kill_signals "1 HUP" "2 INT" "3 QUIT" "4 ILL" "5 TRAP" "6 ABRT" \ - "6 IOT" "7 BUS" "8 FPE" "9 KILL" "10 USR1" "11 SEGV" \ - "12 USR2" "13 PIPE" "14 ALRM" "15 TERM" "16 STKFLT" "17 CHLD" \ - "17 CLD" "18 CONT" "19 STOP" "20 TSTP" "21 TTIN" "22 TTOU" \ - "23 URG" "24 XCPU" "25 XFSZ" "26 VTALRM" "27 PROF" "28 WINC" \ - "29 IO" "29 POLL" "30 PWR" "31 SYS" "34 RTMIN" "64 RTMA" + "6 IOT" "7 BUS" "8 FPE" "9 KILL" "10 USR1" "11 SEGV" \ + "12 USR2" "13 PIPE" "14 ALRM" "15 TERM" "16 STKFLT" "17 CHLD" \ + "17 CLD" "18 CONT" "19 STOP" "20 TSTP" "21 TTIN" "22 TTOU" \ + "23 URG" "24 XCPU" "25 XFSZ" "26 VTALRM" "27 PROF" "28 WINC" \ + "29 IO" "29 POLL" "30 PWR" "31 SYS" "34 RTMIN" "64 RTMA" return end diff --git a/share/functions/__fish_print_encodings.fish b/share/functions/__fish_print_encodings.fish index 3cdd5d530..28ec1d0bf 100644 --- a/share/functions/__fish_print_encodings.fish +++ b/share/functions/__fish_print_encodings.fish @@ -1,5 +1,5 @@ function __fish_print_encodings -d "Complete using available character encodings" - if iconv --usage &>/dev/null # only GNU has this flag + if iconv --usage &>/dev/null # only GNU has this flag # Note: GNU iconv changes its output to contain the forward slashes below when stdout is not a tty. iconv --list | string replace -ra '//' '' else # non-GNU diff --git a/share/tools/web_config/webconfig.py b/share/tools/web_config/webconfig.py index 702774c91..1c9e5cab8 100755 --- a/share/tools/web_config/webconfig.py +++ b/share/tools/web_config/webconfig.py @@ -1478,7 +1478,7 @@ url = "http://localhost:%d/%s/%s" % (PORT, authkey, initial_tab) # Create temporary file to hold redirect to real server. This prevents exposing # the URL containing the authentication key on the command line (see # CVE-2014-2914 or https://github.com/fish-shell/fish-shell/issues/1438). -f = tempfile.NamedTemporaryFile(prefix='web_config', suffix='.html', mode='w') +f = tempfile.NamedTemporaryFile(prefix="web_config", suffix=".html", mode="w") f.write(redirect_template_html % (url, url)) f.flush() diff --git a/src/expand.cpp b/src/expand.cpp index cbfd7c5c8..d7d1e5926 100644 --- a/src/expand.cpp +++ b/src/expand.cpp @@ -17,8 +17,8 @@ #include #endif #if __APPLE__ -#include // Required to build with old SDK versions #include +#include // Required to build with old SDK versions #else #include #include @@ -194,7 +194,7 @@ static size_t parse_slice(const wchar_t *in, wchar_t **end_ptr, std::vector -#include // for uint64_t +#include // for uint64_t #include #include diff --git a/src/proc.cpp b/src/proc.cpp index ce460b6e8..87aee9834 100644 --- a/src/proc.cpp +++ b/src/proc.cpp @@ -268,10 +268,13 @@ bool process_t::is_internal() const { case process_type_t::exec: return false; default: - assert(false && "The fish developers forgot to include a process_t. Please report a bug"); + assert(false && + "The fish developers forgot to include a process_t. Please report a bug"); return true; } - assert(false && "process_t::is_internal: Total logic failure, universe is broken. Please replace universe and retry."); + assert(false && + "process_t::is_internal: Total logic failure, universe is broken. Please replace " + "universe and retry."); return true; } diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp index 992f7b6b3..51d48a105 100644 --- a/src/tokenizer.cpp +++ b/src/tokenizer.cpp @@ -375,7 +375,8 @@ maybe_t pipe_or_redir_t::from_string(const wchar_t *buff) { : STDOUT_FILENO; // like >| } else if (try_consume(L'&')) { // This is a redirection to an fd. - // Note that we allow ">>&", but it's still just writing to the fd - "appending" to it doesn't make sense. + // Note that we allow ">>&", but it's still just writing to the fd - "appending" to + // it doesn't make sense. result.mode = redirection_mode_t::fd; result.fd = has_fd ? parse_fd(fd_start, fd_end) // like 1>&2 : STDOUT_FILENO; // like >&2 @@ -383,7 +384,8 @@ maybe_t pipe_or_redir_t::from_string(const wchar_t *buff) { // This is a redirection to a file. result.fd = has_fd ? parse_fd(fd_start, fd_end) // like 1> file.txt : STDOUT_FILENO; // like > file.txt - if (result.mode != redirection_mode_t::append) result.mode = redirection_mode_t::overwrite; + if (result.mode != redirection_mode_t::append) + result.mode = redirection_mode_t::overwrite; // Note 'echo abc >>? file' is valid: it means append and noclobber. // But here "noclobber" means the file must not exist, so appending // can be ignored. diff --git a/src/wutil.cpp b/src/wutil.cpp index ae44dc633..495b26fff 100644 --- a/src/wutil.cpp +++ b/src/wutil.cpp @@ -266,8 +266,8 @@ int fd_check_is_remote(int fd) { // these are in varying headers. Simply hard code them. // NOTE: The cast is necessary for 32-bit systems because of the 4-byte CIFS_MAGIC_NUMBER switch ((unsigned int)buf.f_type) { - case 0x6969: // NFS_SUPER_MAGIC - case 0x517B: // SMB_SUPER_MAGIC + case 0x6969: // NFS_SUPER_MAGIC + case 0x517B: // SMB_SUPER_MAGIC case 0xFF534D42u: // CIFS_MAGIC_NUMBER return 1; default: