Commit 85c4f079 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'clang-format-6.0'

1b65e041 clang-format: add formatter for version 6.0
705a43cc

 format.all: exclude clang-format-* since they are version-specific
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !11
parents 3fff801d 1b65e041
Pipeline #105170 failed with stage
in 0 seconds
......@@ -31,6 +31,8 @@ function (add_formatter name type)
PROPERTY "formatter_${name}_tools" "${tools_exist}")
set_property(GLOBAL APPEND
PROPERTY "formatter_${name}_script" "${script}")
set_property(GLOBAL
PROPERTY "formatter_${name}_exclude_from_all" "0")
option("ENABLE_${name}" "Install the ${tool} formatter script" "${tools_exist}")
......@@ -82,6 +84,13 @@ if (formatters)
continue ()
endif ()
# Skip explicitly excluded formatters.
get_property(formatter_exclude_from_all GLOBAL
PROPERTY "formatter_${formatter}_exclude_from_all")
if (formatter_exclude_from_all)
continue ()
endif ()
# Do not reformat with check-only tools.
get_property(formatter_type GLOBAL
PROPERTY "formatter_${formatter}_type")
......
foreach(v
3.8
6.0
)
set(ver ${v})
configure_file(format.clang-format.in format.clang-format-${v} @ONLY)
configure_file(clang-format.yaml.in clang-format-${v}.yaml.in COPYONLY)
add_formatter(clang-format-${v} reformat clang-format-${v})
set_property(GLOBAL PROPERTY "formatter_clang-format-${v}_exclude_from_all" "1")
endforeach()
add_formatter(clang-format-kwsys reformat clang-format-3.8)
set_property(GLOBAL PROPERTY "formatter_clang-format-kwsys_exclude_from_all" "1")
add_formatter_test(clang-format-6.0 pass format.c pass)
add_formatter_test(clang-format-6.0 format format.c format)
add_formatter_test(clang-format-6.0 no-config-file format.c fail)
int main(int argc, char *argv[]) {
return 0;
}
int main(int argc, char *argv[]) {
return 0;
}
int main(int argc, char *argv[]) { return 0; }
int main(int argc, char *argv[]) { return 0; }
int main(int argc, char *argv[]) { return 0; }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment