mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +00:00
enable make style-all
doing fish scripts
I had disabled having `make style-all` restyling fish scripts because a majority of them did not conform to the style enforced by `fish_indent`. I recently restyled most of the fish scripts with the exception of the completion scripts. So this re-enables restyling all scripts with the exception of completion scripts.
This commit is contained in:
parent
9443a415bf
commit
42eaacd3a1
3 changed files with 145 additions and 141 deletions
|
@ -30,12 +30,10 @@ if test $all = yes
|
|||
exit 1
|
||||
end
|
||||
set c_files src/*.h src/*.cpp
|
||||
# For now we don't restyle all the fish scripts. That's because `fish_indent` still has some
|
||||
# problems with its output that require manual intervention. Not to mention that very few of the
|
||||
# fish scripts even conform to `fish_indent` output at this time. When `fish_indent` output is
|
||||
# deemed acceptable as a default and all the fish scripts have been restyled this comment should
|
||||
# be removed and the following statement uncommented.
|
||||
# set f_files share/***.fish
|
||||
# For now we don't restyle all fish scripts other than completion scripts. That's because people
|
||||
# really like to vertically align the elements of the `complete` command and fish_indent
|
||||
# currently does not honor that whitespace.
|
||||
set f_files (printf '%s\n' share/***.fish | grep -v /completions/)
|
||||
else
|
||||
# We haven't been asked to reformat all the source. If there are uncommitted changes reformat
|
||||
# those using `git clang-format`. Else reformat the files in the most recent commit.
|
||||
|
|
|
@ -46,7 +46,8 @@ if status --is-interactive
|
|||
or test "$COLORTERM" = truecolor -o "$COLORTERM" = 24bit # slang expects this
|
||||
end
|
||||
# Only set it if it isn't to allow override by setting to 0
|
||||
set -q fish_term24bit; or set -g fish_term24bit 1
|
||||
set -q fish_term24bit
|
||||
or set -g fish_term24bit 1
|
||||
end
|
||||
end
|
||||
else
|
||||
|
@ -134,8 +135,11 @@ function __fish_load_path_helper_paths
|
|||
end
|
||||
set __fish_tmp_path $__fish_tmp_path[-1..1]
|
||||
end
|
||||
test -r /etc/paths ; and __fish_load_path_helper_paths < /etc/paths
|
||||
for pathfile in /etc/paths.d/* ; __fish_load_path_helper_paths < $pathfile ; end
|
||||
test -r /etc/paths
|
||||
and __fish_load_path_helper_paths </etc/paths
|
||||
for pathfile in /etc/paths.d/*
|
||||
__fish_load_path_helper_paths <$pathfile
|
||||
end
|
||||
set -xg PATH $__fish_tmp_path
|
||||
set -e __fish_tmp_path
|
||||
functions -e __fish_load_path_helper_paths
|
||||
|
@ -205,11 +209,13 @@ __fish_set_locale
|
|||
set -l sourcelist
|
||||
for file in $configdir/fish/conf.d/*.fish $__fish_sysconfdir/conf.d/*.fish $__extra_confdir/*.fish
|
||||
set -l basename (string replace -r '^.*/' '' -- $file)
|
||||
contains -- $basename $sourcelist; and continue
|
||||
contains -- $basename $sourcelist
|
||||
and continue
|
||||
set sourcelist $sourcelist $basename
|
||||
# Also skip non-files or unreadable files
|
||||
# This allows one to use e.g. symlinks to /dev/null to "mask" something (like in systemd)
|
||||
[ -f $file -a -r $file ]; and source $file
|
||||
[ -f $file -a -r $file ]
|
||||
and source $file
|
||||
end
|
||||
|
||||
# Upgrade pre-existing abbreviations from the old "key=value" to the new "key value" syntax
|
||||
|
|
|
@ -11,16 +11,16 @@ function __fish_print_hostnames -d "Print a list of known hostnames"
|
|||
else if test -r /etc/hosts
|
||||
# Ignore commented lines and functionally empty lines. Strip comments.
|
||||
string match -r -v '^\s*0.0.0.0|^\s*#|^\s*$' </etc/hosts | string replace -ra '#.*$' '' | string replace -r '[0-9.]*\s*' '' | string trim | string replace -ra '\s+' '\n'
|
||||
end
|
||||
end
|
||||
|
||||
# Print nfs servers from /etc/fstab
|
||||
if test -r /etc/fstab
|
||||
# Print nfs servers from /etc/fstab
|
||||
if test -r /etc/fstab
|
||||
string match -r '^\s*[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3]:|^[a-zA-Z\.]*:' </etc/fstab | string replace -r ':.*' ''
|
||||
end
|
||||
end
|
||||
|
||||
# Check hosts known to ssh
|
||||
set -l known_hosts ~/.ssh/known_hosts{,2} /etc/ssh/known_hosts{,2} # Yes, seriously - the default specifies both with and without "2"
|
||||
for file in /etc/ssh/ssh_config ~/.ssh/config
|
||||
# Check hosts known to ssh
|
||||
set -l known_hosts ~/.ssh/known_hosts{,2} /etc/ssh/known_hosts{,2} # Yes, seriously - the default specifies both with and without "2"
|
||||
for file in /etc/ssh/ssh_config ~/.ssh/config
|
||||
if test -r $file
|
||||
# Print hosts from system wide ssh configuration file
|
||||
# Note the non-capturing group to avoid printing "name"
|
||||
|
@ -28,11 +28,11 @@ for file in /etc/ssh/ssh_config ~/.ssh/config
|
|||
set known_hosts $known_hosts (string match -ri '^\s*UserKnownHostsFile|^\s*GlobalKnownHostsFile' < $file \
|
||||
| string replace -ri '.*KnownHostsFile\s*' '')
|
||||
end
|
||||
end
|
||||
for file in $known_hosts
|
||||
end
|
||||
for file in $known_hosts
|
||||
# Ignore hosts that are hashed, commented or have custom ports (like [localhost]:2200)
|
||||
test -r $file
|
||||
and string replace -ra '(\S+) .*' '$1' <$file | string match -r '^[^#|[=]+$' | string split ","
|
||||
end
|
||||
return 0
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue