cutter/scripts/update_clang_format.sh
Premade dc76ccf59e
Enforce coding style using clang-tidy (#3603)
Added scripts/clang-tidy.py
Updated doc to tell about clang-tidy
Added checks for clang-tidy are defined below
* cppcoreguidelines-pro-type-cstyle-cast
* misc-const-correctness
* misc-unused-parameters
* modernize-loop-convert
* modernize-use-auto
* modernize-use-nullptr
* readability-braces-around-statements
* readability-identifier-naming
* readability-make-member-function-const
* performance-for-range-copy
* performance-enum-size
* performance-move-const-arg
* performance-no-automatic-move
* performance-noexcept-destructor
* performance-noexcept-move-constructor
* performance-noexcept-swap
* performance-unnecessary-copy-initialization
* performance-unnecessary-value-param
* performance-use-std-move
* performance-move-constructor-init
2026-05-22 21:46:02 +05:00

25 lines
909 B
Bash
Executable file

#!/bin/bash
set -euo pipefail
cd $(dirname "${BASH_SOURCE[0]}")
# Do not replace with newer without dicussing! Intentionally using older clang-format-version.
tool=clang-format-15
# Using full config dumped with older clang format should produce more consistent result when some
# people have slightly newer clang-format. 15 chosen because it is newest version available in Ubuntu 22.04 official repository.
output_file=../_clang-format
# Usage:
# modify scripts/_clang_format
# run this script
# compare the generated outptu with previous version
temp_file=_clang_format_new
echo -e "# Do not edit this file! Automatically generated using scripts/udate_clang_format.sh and scripts/_clang_format\n# See update_clang_format.sh for more information." > $temp_file
echo "# generated using `$tool --version`" >> $temp_file
$tool -style=file -dump-config >> $temp_file
mv $temp_file $output_file
echo Done