Skip to content

Commit c03b2d4

Browse files
authored
Dv clang format (#3138)
1 parent a301e0f commit c03b2d4

File tree

7 files changed

+43
-9
lines changed

7 files changed

+43
-9
lines changed

.automation/test/c/c_fix_01.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <iostream>
2+
3+
int main()
4+
{
5+
std::cout << "Hello World!";
6+
return 0;
7+
}

.automation/test/c/c_fix_02.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <iostream>
2+
3+
int main()
4+
{
5+
std::cout << "Hello World!";
6+
return 0;
7+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <iostream>
2+
3+
int main() {
4+
std::cout << "Hello World!"
5+
return 0;
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <iostream>
2+
3+
int main() {
4+
std::cout << "Hello World!"
5+
return 0;
6+
}

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
1313
- Media
1414

1515
- New linters
16-
- Add [clang-format](https://releases.llvm.org/16.0.0/tools/clang/docs/ClangFormat.html) c & cpp formatting linter
16+
- Add [clang-format](https://releases.llvm.org/16.0.0/tools/clang/docs/ClangFormat.html) c & cpp formatting linter including "apply fix" support
1717

1818
- Fixes
1919

megalinter/descriptors/c.megalinter-descriptor.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ linters:
3838
cli_lint_extra_args:
3939
- "--Werror"
4040
- "--dry-run"
41+
cli_lint_fix_arg_name: "-i"
42+
cli_lint_fix_remove_args:
43+
- "--Werror"
44+
- "--dry-run"
4145
config_file_name: .clang-format
4246
cli_config_arg_name: "--style=file:"
4347
cli_lint_errors_count: regex_count
@@ -49,8 +53,8 @@ linters:
4953
- clang16-extra-tools
5054
ide:
5155
vscode:
52-
name: Clang-Format
53-
url: https://marketplace.visualstudio.com/items?itemName=xaver.clang-format
56+
- name: Clang-Format
57+
url: https://marketplace.visualstudio.com/items?itemName=xaver.clang-format
5458
emacs:
55-
name: clang-format
56-
url: https://releases.llvm.org/16.0.0/tools/clang/docs/ClangFormat.html#emacs-integration
59+
- name: clang-format
60+
url: https://releases.llvm.org/16.0.0/tools/clang/docs/ClangFormat.html#emacs-integration

megalinter/descriptors/cpp.megalinter-descriptor.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ linters:
4848
cli_lint_extra_args:
4949
- "--Werror"
5050
- "--dry-run"
51+
cli_lint_fix_arg_name: "-i"
52+
cli_lint_fix_remove_args:
53+
- "--Werror"
54+
- "--dry-run"
5155
config_file_name: .clang-format
5256
cli_config_arg_name: "--style=file:"
5357
cli_lint_errors_count: regex_count
@@ -59,8 +63,8 @@ linters:
5963
- clang16-extra-tools
6064
ide:
6165
vscode:
62-
name: Clang-Format
63-
url: https://marketplace.visualstudio.com/items?itemName=xaver.clang-format
66+
- name: Clang-Format
67+
url: https://marketplace.visualstudio.com/items?itemName=xaver.clang-format
6468
emacs:
65-
name: clang-format
66-
url: https://releases.llvm.org/16.0.0/tools/clang/docs/ClangFormat.html#emacs-integration
69+
- name: clang-format
70+
url: https://releases.llvm.org/16.0.0/tools/clang/docs/ClangFormat.html#emacs-integration

0 commit comments

Comments
 (0)