diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 3b29d7584..b57d304d4 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -110,7 +110,7 @@ before committing your change. That will run our autoformatters: - ``rustfmt`` for Rust - ``fish_indent`` (shipped with fish) for fish script -- ``black`` for python +- ``ruff format`` for python If you’ve already committed your changes that’s okay since it will then check the files in the most recent commit. This can be useful after diff --git a/build_tools/style.fish b/build_tools/style.fish index 707246825..6f6b18c16 100755 --- a/build_tools/style.fish +++ b/build_tools/style.fish @@ -44,7 +44,7 @@ if test $all = yes end end set fish_files $workspace_root/{benchmarks,build_tools,etc,share}/**.fish - set python_files {doc_src,share,tests}/**.py + set python_files . else # Format the files specified as arguments. set -l files $argv @@ -76,19 +76,19 @@ if set -q fish_files[1] end if set -q python_files[1] - if not type -q black + if not type -q ruff echo - echo $yellow'Please install `black` to style python'$normal + echo $yellow'Please install `ruff` to style python'$normal exit 127 end - echo === Running "$green"black"$normal" + echo === Running "$green"ruff format"$normal" if set -l -q _flag_check - if not black --check $python_files + if not ruff format --check $python_files echo $red"Python files are not formatted correctly."$normal exit 1 end else - black $python_files + ruff format $python_files end end diff --git a/share/tools/web_config/webconfig.py b/share/tools/web_config/webconfig.py index f8538501a..117344509 100755 --- a/share/tools/web_config/webconfig.py +++ b/share/tools/web_config/webconfig.py @@ -1423,7 +1423,7 @@ fish_bin_path = None fish_bin_name = "fish.exe" if is_windows() else "fish" if not fish_bin_dir: - print("The $__fish_bin_dir environment variable is not set. " "Looking in $PATH...") + print("The $__fish_bin_dir environment variable is not set. Looking in $PATH...") fish_bin_path = find_executable(fish_bin_name) if not fish_bin_path: print("fish could not be found. Is fish installed correctly?") diff --git a/tests/pexpects/torn_escapes.py b/tests/pexpects/torn_escapes.py index a528ef81e..1ab25b783 100644 --- a/tests/pexpects/torn_escapes.py +++ b/tests/pexpects/torn_escapes.py @@ -38,9 +38,7 @@ sendline( echo Got SIGUSR1 $sigusr1_count; commandline -f repaint; end -""".strip().replace( - "\n", os.linesep - ) +""".strip().replace("\n", os.linesep) ) expect_prompt() @@ -51,9 +49,7 @@ sendline( set wacky_count (math $wacky_count + 1); echo Wacky Handler $wacky_count end -""".strip().replace( - "\n", os.linesep - ) +""".strip().replace("\n", os.linesep) ) expect_prompt()