Skip to content

An space is introduced before a parenthesis when the parameter is a positive number  #1265

@mihaipopescu

Description

@mihaipopescu

format bug with c#:
expected:

5.Clamp(2, 10).ShouldBe(5);

actual:

5.Clamp (2, 10).ShouldBe(5);

(space is added before paren)

note that this only happens with positive int literals. if i use a float with a decimal, or 'c' or "abc" or whatever, or even (-5), it's ok.

Expected versus output diff:

diff --git "a/C:\\work\\external\\uncrustify\\tests\\output\\staging\\60019-UNI-18780.cs" "b/C:\\work\\external\\uncrustify\\tests\\results\\staging\\60019-UNI-18780.cs"
index 0eea713..111aab8 100644
--- "a/C:\\work\\external\\uncrustify\\tests\\output\\staging\\60019-UNI-18780.cs"
+++ "b/C:\\work\\external\\uncrustify\\tests\\results\\staging\\60019-UNI-18780.cs"
@@ -1,7 +1,7 @@
 // note that this only happens with positive int literals. if i use a float with a decimal, or 'c' or "abc" or whatever, or even `(-5)`, it's ok.
-5.Clamp(2, 10).ShouldBe(5);
-5.Clamp(-5, 10).ShouldBe(5);
-5.Clamp("a", 10).ShouldBe(5);
+5.Clamp (2, 10).ShouldBe(5);
+5.Clamp (-5, 10).ShouldBe(5);
+5.Clamp ("a", 10).ShouldBe(5);
 
 "4".Clamp(2, 10).ShouldBe(5);
 (-5).Clamp(2, 10).ShouldBe(5);

Debug support files:

60019-UNI-18780.cs
60019-UNI-18780.cs.log
60019-UNI-18780.cs.unc
Uncrustify.CSharp.cfg
UNI-18780.cs

Disclaimer:

Note: This is a generated issue from our internal issue tracker.
Expect a dry description which could be insufficient to properly understand the issue.
On the other hand, the support files should be sufficient to easily reproduce and debug the issue,
but please comment if it's still unclear and I will get back with clarifications.
See main discussion thread here #1223.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions