8000 Use clang-format for auto-format (replaces libastyle) by cmaglie · Pull Request #11543 · arduino/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Use clang-format for auto-format (replaces libastyle) #11543

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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fixed tests for new autoformat style
  • Loading branch information
cmaglie committed May 21, 2021
commit 7754b7fc8a127b46ee099fbea8e8a71b70d3486d
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,10 @@ public class AutoformatProducesOneUndoActionTest extends AbstractGUITest {
"}";
public static final String SOURCE_AFTER = "void setup() {\n" +
" // put your setup code here, to run once:\n" +
"\n" +
"}\n" +
"\n" +
"void loop() {\n" +
" // put your main code here, to run repeatedly:\n" +
"\n" +
"}";

@Test
Expand Down
2 changes: 0 additions & 2 deletions app/test/processing/app/AutoformatSavesCaretPositionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ public void shouldSaveCaretPositionAfterAutoformat() {
String formattedText = editor.getText();
assertEquals("void setup() {\n" +
" // put your setup code here, to run once:\n" +
"\n" +
"}\n" +
"\n" +
"void loop() {\n" +
" // put your main code here, to run repeatedly:\n" +
"\n" +
"}", formattedText);

// Autoformat with clang-format keeps cursor relative to source code
Expand Down
4 changes: 2 additions & 2 deletions app/test/processing/app/AutoformatTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public void shouldProduceNicelyFormattedCode() throws Exception {
String formattedText = editor.getText();
assertEquals("void setup() {\n" +
" // put your setup code here, to run once:\n" +
" int foo[] = { 1, 2, 3, 4, 5};\n" +
" int foo[2][5] = {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}};\n" +
" int foo[] = { 1, 2, 3, 4, 5 };\n" +
" int foo[2][5] = { { 1, 2, 3, 4, 5 }, { 6, 7, 8, 9, 10 } };\n" +
"}\n" +
"\n" +
"void loop() {\n" +
Expand Down
0