Skip to content

Commit

Permalink
Dv clang format (#3138)
Browse files Browse the repository at this point in the history
  • Loading branch information
daltonv authored Nov 21, 2023
1 parent a301e0f commit c03b2d4
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 9 deletions.
7 changes: 7 additions & 0 deletions .automation/test/c/c_fix_01.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <iostream>

int main()
{
std::cout << "Hello World!";
return 0;
}
7 changes: 7 additions & 0 deletions .automation/test/c/c_fix_02.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <iostream>

int main()
{
std::cout << "Hello World!";
return 0;
}
6 changes: 6 additions & 0 deletions .automation/test/cpp/cpp_fix_01.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <iostream>

int main() {
std::cout << "Hello World!"
return 0;
}
6 changes: 6 additions & 0 deletions .automation/test/cpp/cpp_fix_02.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <iostream>

int main() {
std::cout << "Hello World!"
return 0;
}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
- Media

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

- Fixes

Expand Down
12 changes: 8 additions & 4 deletions megalinter/descriptors/c.megalinter-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ linters:
cli_lint_extra_args:
- "--Werror"
- "--dry-run"
cli_lint_fix_arg_name: "-i"
cli_lint_fix_remove_args:
- "--Werror"
- "--dry-run"
config_file_name: .clang-format
cli_config_arg_name: "--style=file:"
cli_lint_errors_count: regex_count
Expand All @@ -49,8 +53,8 @@ linters:
- clang16-extra-tools
ide:
vscode:
name: Clang-Format
url: https://marketplace.visualstudio.com/items?itemName=xaver.clang-format
- name: Clang-Format
url: https://marketplace.visualstudio.com/items?itemName=xaver.clang-format
emacs:
name: clang-format
url: https://releases.llvm.org/16.0.0/tools/clang/docs/ClangFormat.html#emacs-integration
- name: clang-format
url: https://releases.llvm.org/16.0.0/tools/clang/docs/ClangFormat.html#emacs-integration
12 changes: 8 additions & 4 deletions megalinter/descriptors/cpp.megalinter-descriptor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ linters:
cli_lint_extra_args:
- "--Werror"
- "--dry-run"
cli_lint_fix_arg_name: "-i"
cli_lint_fix_remove_args:
- "--Werror"
- "--dry-run"
config_file_name: .clang-format
cli_config_arg_name: "--style=file:"
cli_lint_errors_count: regex_count
Expand All @@ -59,8 +63,8 @@ linters:
- clang16-extra-tools
ide:
vscode:
name: Clang-Format
url: https://marketplace.visualstudio.com/items?itemName=xaver.clang-format
- name: Clang-Format
url: https://marketplace.visualstudio.com/items?itemName=xaver.clang-format
emacs:
name: clang-format
url: https://releases.llvm.org/16.0.0/tools/clang/docs/ClangFormat.html#emacs-integration
- name: clang-format
url: https://releases.llvm.org/16.0.0/tools/clang/docs/ClangFormat.html#emacs-integration

0 comments on commit c03b2d4

Please sign in to comment.