https://github.com/zeyi2 updated https://github.com/llvm/llvm-project/pull/167269
>From 85c41652d2256af9861d66598c991430cf70979a Mon Sep 17 00:00:00 2001 From: mtx <[email protected]> Date: Mon, 10 Nov 2025 13:29:27 +0800 Subject: [PATCH 1/7] [clang-tidy][NFC] Add `.editorconfig` for `.rst` files --- clang-tools-extra/docs/.editorconfig | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 clang-tools-extra/docs/.editorconfig diff --git a/clang-tools-extra/docs/.editorconfig b/clang-tools-extra/docs/.editorconfig new file mode 100644 index 0000000000000..74f96cdf09b79 --- /dev/null +++ b/clang-tools-extra/docs/.editorconfig @@ -0,0 +1,8 @@ +[clang-tidy/checks/**/*.rst] +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +end_of_line = lf +indent_style = space +indent_size = 2 +max_line_length = 80 >From 56729ed872f3aa485ec94e58de691ea180d0494e Mon Sep 17 00:00:00 2001 From: mtx <[email protected]> Date: Mon, 10 Nov 2025 18:08:41 +0800 Subject: [PATCH 2/7] Tiny fix --- .../docs/{ => clang-tidy/checks}/.editorconfig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename clang-tools-extra/docs/{ => clang-tidy/checks}/.editorconfig (71%) diff --git a/clang-tools-extra/docs/.editorconfig b/clang-tools-extra/docs/clang-tidy/checks/.editorconfig similarity index 71% rename from clang-tools-extra/docs/.editorconfig rename to clang-tools-extra/docs/clang-tidy/checks/.editorconfig index 74f96cdf09b79..08694705c38d8 100644 --- a/clang-tools-extra/docs/.editorconfig +++ b/clang-tools-extra/docs/clang-tidy/checks/.editorconfig @@ -1,8 +1,10 @@ -[clang-tidy/checks/**/*.rst] +[{**/*.rst,*.rst}] charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true end_of_line = lf indent_style = space -indent_size = 2 max_line_length = 80 + +[list.rst] +max_line_length = unset >From d2114c82276bd7e46299f71d1dd051191413fa58 Mon Sep 17 00:00:00 2001 From: mtx <[email protected]> Date: Tue, 11 Nov 2025 20:01:27 +0800 Subject: [PATCH 3/7] Add editor config for clang-tidy files --- clang-tools-extra/clang-tidy/.editorconfig | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 clang-tools-extra/clang-tidy/.editorconfig diff --git a/clang-tools-extra/clang-tidy/.editorconfig b/clang-tools-extra/clang-tidy/.editorconfig new file mode 100644 index 0000000000000..6060bb1115017 --- /dev/null +++ b/clang-tools-extra/clang-tidy/.editorconfig @@ -0,0 +1,7 @@ +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true + +[**/*.{cpp,h}] +max_line_length = 80 \ No newline at end of file >From dc9c11172bb812b371f27774a507eb4d895b2122 Mon Sep 17 00:00:00 2001 From: mtx <[email protected]> Date: Tue, 11 Nov 2025 20:03:19 +0800 Subject: [PATCH 4/7] ~ --- clang-tools-extra/clang-tidy/.editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang-tools-extra/clang-tidy/.editorconfig b/clang-tools-extra/clang-tidy/.editorconfig index 6060bb1115017..380ccf1fd93ec 100644 --- a/clang-tools-extra/clang-tidy/.editorconfig +++ b/clang-tools-extra/clang-tidy/.editorconfig @@ -4,4 +4,4 @@ end_of_line = lf insert_final_newline = true [**/*.{cpp,h}] -max_line_length = 80 \ No newline at end of file +max_line_length = 80 >From 0184f6234f6753b26bbdac1f0ab0be8048f67809 Mon Sep 17 00:00:00 2001 From: mtx <[email protected]> Date: Tue, 11 Nov 2025 20:12:16 +0800 Subject: [PATCH 5/7] ~ --- clang-tools-extra/clang-tidy/.editorconfig | 2 -- 1 file changed, 2 deletions(-) diff --git a/clang-tools-extra/clang-tidy/.editorconfig b/clang-tools-extra/clang-tidy/.editorconfig index 380ccf1fd93ec..202fd98590174 100644 --- a/clang-tools-extra/clang-tidy/.editorconfig +++ b/clang-tools-extra/clang-tidy/.editorconfig @@ -2,6 +2,4 @@ charset = utf-8 end_of_line = lf insert_final_newline = true - -[**/*.{cpp,h}] max_line_length = 80 >From 6620568a55c31ec18c23b286a79732113d1f8112 Mon Sep 17 00:00:00 2001 From: mtx <[email protected]> Date: Tue, 16 Dec 2025 11:01:56 +0800 Subject: [PATCH 6/7] Add docuemntations of doc8 --- clang-tools-extra/clang-tidy/.editorconfig | 5 ----- clang-tools-extra/docs/clang-tidy/Contributing.rst | 11 +++++++++++ .../docs/clang-tidy/checks/.editorconfig | 10 ---------- 3 files changed, 11 insertions(+), 15 deletions(-) delete mode 100644 clang-tools-extra/clang-tidy/.editorconfig delete mode 100644 clang-tools-extra/docs/clang-tidy/checks/.editorconfig diff --git a/clang-tools-extra/clang-tidy/.editorconfig b/clang-tools-extra/clang-tidy/.editorconfig deleted file mode 100644 index 202fd98590174..0000000000000 --- a/clang-tools-extra/clang-tidy/.editorconfig +++ /dev/null @@ -1,5 +0,0 @@ -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -max_line_length = 80 diff --git a/clang-tools-extra/docs/clang-tidy/Contributing.rst b/clang-tools-extra/docs/clang-tidy/Contributing.rst index 4ede4ea36c13d..f05cf9ff33d12 100644 --- a/clang-tools-extra/docs/clang-tidy/Contributing.rst +++ b/clang-tools-extra/docs/clang-tidy/Contributing.rst @@ -451,6 +451,17 @@ your build tree. Make sure that your check is correctly shown in the release no list of checks. Make sure that the formatting and structure of your check's documentation look correct. +Clang-tidy uses `doc8 <https://pypi.org/project/doc8/>`_ to check ``.rst`` +files for formatting consistency. You can install ``doc8`` with ``pip``: + +.. code-block:: console + $ pip install doc8 + +To run ``doc8`` on the modified documentations: + +.. code-block:: console + $ git diff --name-only HEAD -- clang-tools-extra/docs/clang-tidy/ | grep "\.rst$" | xargs -r doc8 + Registering your Check ---------------------- diff --git a/clang-tools-extra/docs/clang-tidy/checks/.editorconfig b/clang-tools-extra/docs/clang-tidy/checks/.editorconfig deleted file mode 100644 index 08694705c38d8..0000000000000 --- a/clang-tools-extra/docs/clang-tidy/checks/.editorconfig +++ /dev/null @@ -1,10 +0,0 @@ -[{**/*.rst,*.rst}] -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -end_of_line = lf -indent_style = space -max_line_length = 80 - -[list.rst] -max_line_length = unset >From dd40530acc34a13e61d25684275a17e745a9985b Mon Sep 17 00:00:00 2001 From: mtx <[email protected]> Date: Tue, 16 Dec 2025 11:06:58 +0800 Subject: [PATCH 7/7] Fix --- clang-tools-extra/docs/clang-tidy/Contributing.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang-tools-extra/docs/clang-tidy/Contributing.rst b/clang-tools-extra/docs/clang-tidy/Contributing.rst index f05cf9ff33d12..b387af36b82ff 100644 --- a/clang-tools-extra/docs/clang-tidy/Contributing.rst +++ b/clang-tools-extra/docs/clang-tidy/Contributing.rst @@ -451,10 +451,11 @@ your build tree. Make sure that your check is correctly shown in the release no list of checks. Make sure that the formatting and structure of your check's documentation look correct. -Clang-tidy uses `doc8 <https://pypi.org/project/doc8/>`_ to check ``.rst`` +Clang-Tidy uses `doc8 <https://pypi.org/project/doc8/>`_ to check ``.rst`` files for formatting consistency. You can install ``doc8`` with ``pip``: .. code-block:: console + $ pip install doc8 To run ``doc8`` on the modified documentations: _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
