-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[clang-tidy] Remove addition of emacs tag in checks headers #153942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-clang-tools-extra Author: Baranov Victor (vbvictor) ChangesAfter #118553, emacs tag is no longer needed in LLVM files: https://llvm.org/docs/CodingStandards.html#file-headers. Full diff: https://github.com/llvm/llvm-project/pull/153942.diff 1 Files Affected:
diff --git a/clang-tools-extra/clang-tidy/add_new_check.py b/clang-tools-extra/clang-tidy/add_new_check.py
index e366f10053535..2b51a1dc40ebc 100755
--- a/clang-tools-extra/clang-tidy/add_new_check.py
+++ b/clang-tools-extra/clang-tidy/add_new_check.py
@@ -89,13 +89,9 @@ def write_header(
+ check_name_camel.upper()
+ "_H"
)
- f.write("//===--- ")
- f.write(os.path.basename(filename))
- f.write(" - clang-tidy ")
- f.write("-" * max(0, 42 - len(os.path.basename(filename))))
- f.write("*- C++ -*-===//")
f.write(
"""
+//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -145,13 +141,9 @@ def write_implementation(
filename = os.path.join(module_path, check_name_camel) + ".cpp"
print("Creating %s..." % filename)
with io.open(filename, "w", encoding="utf8", newline="\n") as f:
- f.write("//===--- ")
- f.write(os.path.basename(filename))
- f.write(" - clang-tidy ")
- f.write("-" * max(0, 51 - len(os.path.basename(filename))))
- f.write("-===//")
f.write(
"""
+//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
|
|
@llvm/pr-subscribers-clang-tidy Author: Baranov Victor (vbvictor) ChangesAfter #118553, emacs tag is no longer needed in LLVM files: https://llvm.org/docs/CodingStandards.html#file-headers. Full diff: https://github.com/llvm/llvm-project/pull/153942.diff 1 Files Affected:
diff --git a/clang-tools-extra/clang-tidy/add_new_check.py b/clang-tools-extra/clang-tidy/add_new_check.py
index e366f10053535..2b51a1dc40ebc 100755
--- a/clang-tools-extra/clang-tidy/add_new_check.py
+++ b/clang-tools-extra/clang-tidy/add_new_check.py
@@ -89,13 +89,9 @@ def write_header(
+ check_name_camel.upper()
+ "_H"
)
- f.write("//===--- ")
- f.write(os.path.basename(filename))
- f.write(" - clang-tidy ")
- f.write("-" * max(0, 42 - len(os.path.basename(filename))))
- f.write("*- C++ -*-===//")
f.write(
"""
+//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -145,13 +141,9 @@ def write_implementation(
filename = os.path.join(module_path, check_name_camel) + ".cpp"
print("Creating %s..." % filename)
with io.open(filename, "w", encoding="utf8", newline="\n") as f:
- f.write("//===--- ")
- f.write(os.path.basename(filename))
- f.write(" - clang-tidy ")
- f.write("-" * max(0, 51 - len(os.path.basename(filename))))
- f.write("-===//")
f.write(
"""
+//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
|
|
How about replacement in existing code? We should also ask for similar changes in open pull requests. |
This is a low priority task so I wouldn't bother contributors to manually correct files. For replacement - I need to write a script for bulk update and I didn't have time. So I'd do that in another PR. Maybe someone else would be interested in updating files. |
carlosgalvezp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I agree cleaning existing code shall be done in another PR, via some automated script.
After #118553, emacs tag is no longer needed in LLVM files: https://llvm.org/docs/CodingStandards.html#file-headers.
This patch removes it from
add_new_check.pylowering complexity we need to maintain.