mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-12 14:51:16 -03:00
clang-format (since 10) can output diagnostics which indicate lines needing formatting with --dry-run and -Werror: the exit code indicates if a file is correctly formatted or not. We used to copy each .cpp file, run clang_format on the duplicate and then `cmp` to see if there were changes made, before just printing a line with the filename and moving the new ontop of the original. Now we show clang-format diagnostics which indicate which lines will be changed, prompt for confirmation and then let clang-format modify the files in-place without the juggling. Looks like this: https://user-images.githubusercontent.com/291142/184561633-c16754c8-179e-426b-ba15-345ba65b9cf9.png