mirror of
https://github.com/rizinorg/cutter
synced 2026-08-11 16:23:06 -04:00
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
25 lines
909 B
Bash
Executable file
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
|