Mostly line breaks, one instance of tabs!

For some reason clang-format insists on two spaces before a same-line comment?

(I continue to be unimpressed with super-strict line length limits,
but I continue to believe in automatic styling, so it is what it is)

[ci skip]
This commit is contained in:
Fabian Homborg 2020-02-17 14:12:27 +01:00
parent 4cefcd4327
commit 65883e0e40
11 changed files with 44 additions and 31 deletions

View File

@ -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):

View File

@ -1,6 +1,6 @@
function __fish_get_vmctl_vms
for line in (vmctl status | string match -e -v "MAXMEM");
for line in (vmctl status | string match -e -v "MAXMEM")
set a (string split " " $line)
and printf "%s " $a[-1]
end

View File

@ -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

View File

@ -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()

View File

@ -17,8 +17,8 @@
#include <procfs.h>
#endif
#if __APPLE__
#include <sys/time.h> // Required to build with old SDK versions
#include <sys/proc.h>
#include <sys/time.h> // Required to build with old SDK versions
#else
#include <dirent.h>
#include <sys/stat.h>

View File

@ -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;
}

View File

@ -375,7 +375,8 @@ maybe_t<pipe_or_redir_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> 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.