From b5e9b23b150205b49afaff9d5d582801e4ffbecb Mon Sep 17 00:00:00 2001 From: Younes Aassila <47226184+younesaassila@users.noreply.github.com> Date: Tue, 2 May 2023 20:46:44 +0200 Subject: [PATCH 1/2] Fix #51 --- c_formatter_42/data/.clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c_formatter_42/data/.clang-format b/c_formatter_42/data/.clang-format index 4abcb0a..d05f774 100644 --- a/c_formatter_42/data/.clang-format +++ b/c_formatter_42/data/.clang-format @@ -92,7 +92,7 @@ BreakBeforeTernaryOperators: true # ColumnLimit (unsigned) # The column limit. -ColumnLimit: 0 +ColumnLimit: 1024 # FixNamespaceComments (bool) From 03a36c54832b0df3fcc3322977b42c00c43cf2c8 Mon Sep 17 00:00:00 2001 From: Younes Aassila <47226184+younesaassila@users.noreply.github.com> Date: Wed, 3 May 2023 13:00:37 +0200 Subject: [PATCH 2/2] Add test for #51 fix --- tests/test_run.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_run.py b/tests/test_run.py index cb47b03..e3381f5 100644 --- a/tests/test_run.py +++ b/tests/test_run.py @@ -55,6 +55,20 @@ def test_run_func_decl_single_tab_and_global_aligned(): pass +def test_run_long_aligned_func_decl(): + # This function declaration is already aligned and should not be modified + input = """ +typedef struct s_foo +{ +\tlong int\tbar; +}\t\t\t\tt_foo; + +long int\t\tfoooooooooooooooooooooooooooooo(t_foo *foooooooo1, +\t\t\t\t\tt_foo *foooooooo2, int barrrrrrrr1, int barrrrrrrr2); +""" + assert input == run_all(input) + + def test_basic(): input = """ int main(int argc, char*argv[]){