mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-21 17:21:14 -03:00
Run fish_indent on all our fish scripts
It's now good enough to do so.
We don't allow grid-alignment:
```fish
complete -c foo -s b -l barnanana -a '(something)'
complete -c foo -s z -a '(something)'
```
becomes
```fish
complete -c foo -s b -l barnanana -a '(something)'
complete -c foo -s z -a '(something)'
```
It's just more trouble than it is worth.
The one part I'd change:
We align and/or'd parts of an if-condition with the in-block code:
```fish
if true
and false
dosomething
end
```
becomes
```fish
if true
and false
dosomething
end
```
but it's not used terribly much and if we ever fix it we can just
reindent.
This commit is contained in:
@@ -10,37 +10,37 @@ set profile2 (cat $argv[2])
|
||||
|
||||
set line_no 0
|
||||
while set next_line_no (math $line_no + 1) && set -q profile1[$next_line_no] && set -q profile2[$next_line_no]
|
||||
set line_no $next_line_no
|
||||
set line_no $next_line_no
|
||||
|
||||
set line1 $profile1[$line_no]
|
||||
set line2 $profile2[$line_no]
|
||||
set line1 $profile1[$line_no]
|
||||
set line2 $profile2[$line_no]
|
||||
|
||||
if not string match -qr '^\d+\t\d+' $line1
|
||||
echo $line1
|
||||
continue
|
||||
end
|
||||
if not string match -qr '^\d+\t\d+' $line1
|
||||
echo $line1
|
||||
continue
|
||||
end
|
||||
|
||||
set results1 (string match -r '^(\d+)\t(\d+)\s+(.*)' $line1)
|
||||
set results2 (string match -r '^(\d+)\t(\d+)\s+(.*)' $line2)
|
||||
set results1 (string match -r '^(\d+)\t(\d+)\s+(.*)' $line1)
|
||||
set results2 (string match -r '^(\d+)\t(\d+)\s+(.*)' $line2)
|
||||
|
||||
# times from both files
|
||||
set time1 $results1[2..3]
|
||||
set time2 $results2[2..3]
|
||||
# times from both files
|
||||
set time1 $results1[2..3]
|
||||
set time2 $results2[2..3]
|
||||
|
||||
# leftover from both files
|
||||
set remainder1 $results1[4]
|
||||
set remainder2 $results2[4]
|
||||
# leftover from both files
|
||||
set remainder1 $results1[4]
|
||||
set remainder2 $results2[4]
|
||||
|
||||
if not string match -q -- $remainder1 $remainder2
|
||||
echo Mismatch on line $line_no:
|
||||
echo - $remainder1
|
||||
echo + $remainder2
|
||||
exit 1
|
||||
end
|
||||
if not string match -q -- $remainder1 $remainder2
|
||||
echo Mismatch on line $line_no:
|
||||
echo - $remainder1
|
||||
echo + $remainder2
|
||||
exit 1
|
||||
end
|
||||
|
||||
set -l diff
|
||||
set diff[1] (math $time1[1] - $time2[1])
|
||||
set diff[2] (math $time1[2] - $time2[2])
|
||||
set -l diff
|
||||
set diff[1] (math $time1[1] - $time2[1])
|
||||
set diff[2] (math $time1[2] - $time2[2])
|
||||
|
||||
echo $diff[1] $diff[2] $remainder1
|
||||
echo $diff[1] $diff[2] $remainder1
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user