mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 18:21:16 -03:00
style: format entire repo by default
We want all Rust and Python files formatted, and making formatting behavior dependent on the directory `style.fish` is called from can be counter-intuitive, especially since `check.sh`, which also calls `style.fish` is otherwise written in a way that allows calling it from arbitrary working directories and getting the same results. Closes #11925
This commit is contained in:
committed by
Johannes Altmanninger
parent
4d52245617
commit
b5feb79a7c
@@ -44,7 +44,7 @@ if test $all = yes
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
set fish_files $workspace_root/{benchmarks,build_tools,etc,share}/**.fish
|
set fish_files $workspace_root/{benchmarks,build_tools,etc,share}/**.fish
|
||||||
set python_files .
|
set python_files $workspace_root
|
||||||
else
|
else
|
||||||
# Format the files specified as arguments.
|
# Format the files specified as arguments.
|
||||||
set -l files $argv
|
set -l files $argv
|
||||||
@@ -101,7 +101,7 @@ end
|
|||||||
echo === Running "$green"rustfmt"$normal"
|
echo === Running "$green"rustfmt"$normal"
|
||||||
if set -l -q _flag_check
|
if set -l -q _flag_check
|
||||||
if set -l -q _flag_all
|
if set -l -q _flag_all
|
||||||
if not cargo fmt --check
|
if not cargo fmt --all --check
|
||||||
echo $red"Rust files are not formatted correctly."$normal
|
echo $red"Rust files are not formatted correctly."$normal
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
@@ -115,7 +115,7 @@ if set -l -q _flag_check
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
if set -l -q _flag_all
|
if set -l -q _flag_all
|
||||||
cargo fmt
|
cargo fmt --all
|
||||||
else
|
else
|
||||||
if set -q rust_files[1]
|
if set -q rust_files[1]
|
||||||
rustfmt $rust_files
|
rustfmt $rust_files
|
||||||
|
|||||||
Reference in New Issue
Block a user