Skip to content

Commit 69e6255

Browse files
authored
Releasing 1.0.3 (#1644)
1 parent 7c2afef commit 69e6255

File tree

3 files changed

+82
-7
lines changed

3 files changed

+82
-7
lines changed

CHANGELOG.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,77 @@
1+
# 1.0.3
2+
## What's Changed
3+
### Switch block case with conditionals adding newlines [#1630](https://github.com/belav/csharpier/issues/1630)
4+
Switch blocks were breaking on conditions within patterns.
5+
```c#
6+
// input and expected output
7+
switch ("")
8+
{
9+
case "" or "":
10+
break;
11+
}
12+
13+
// 1.0.2
14+
switch ("")
15+
{
16+
case ""
17+
or "":
18+
break;
19+
}
20+
```
21+
### switch expression formatting adds odd newlines [#1620](https://github.com/belav/csharpier/issues/1620)
22+
CSharpier was breaking after a discard with a when, resulting in extra new lines
23+
```c#
24+
// input and expected output
25+
_ = someValue switch
26+
{
27+
_ when KeepWhenWithDiscard() => "",
28+
_ when KeepWhenWithDiscard_________________(
29+
SomeObject_______________________________________________
30+
) => "",
31+
_ when KeepWhenWithDiscard_________________(
32+
SomeObject_______________________________________________
33+
) => "LongString_____________________________________________________________________",
34+
};
35+
36+
// 1.0.2
37+
_ = someValue switch
38+
{
39+
_ when KeepWhenWithDiscard() => "",
40+
_
41+
when KeepWhenWithDiscard_________________(
42+
SomeObject_______________________________________________
43+
) => "",
44+
_
45+
when KeepWhenWithDiscard_________________(
46+
SomeObject_______________________________________________
47+
) => "LongString_____________________________________________________________________",
48+
};
49+
50+
```
51+
### multi-line raw string in linq query causes a subsequent linq query to be printed on one line [#1617](https://github.com/belav/csharpier/issues/1617)
52+
If a query syntax linq expression contained a raw string, it could result in method invocations not breaking.
53+
```c#
54+
// input and expected output
55+
(
56+
from x in SomeMethod()
57+
select """
58+
someString
59+
"""
60+
)
61+
.CallMethod_____________________________________________()
62+
.CallMethod_____________________________________________();
63+
64+
// 1.0.2
65+
(
66+
from x in SomeMethod()
67+
select """
68+
someString
69+
"""
70+
).CallMethod_____________________________________________().CallMethod_____________________________________________();
71+
72+
```
73+
74+
**Full Changelog**: https://github.com/belav/csharpier/compare/1.0.2...1.0.3
175
# 1.0.2
276
## What's Changed
377
### Performance issues when supporting .gitignore. [#1588](https://github.com/belav/csharpier/issues/1588)
@@ -3266,5 +3340,6 @@ Thanks go to @pingzing
32663340
32673341
32683342
3343+
32693344
32703345

Nuget/Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>1.0.2</Version>
3+
<Version>1.0.3</Version>
44
<PackageLicenseExpression>MIT</PackageLicenseExpression>
55
<RepositoryUrl>https://github.com/belav/csharpier</RepositoryUrl>
66
<RepositoryType>git</RepositoryType>

Src/Website/docs/Pre-commit.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ dotnet husky install
6262
Modify the file at `.husky/task-runner.json`. Include any file extensions that you want to be formatted by CSharpier.
6363
```json
6464
{
65-
"tasks": [{
66-
"name": "Run csharpier",
67-
"command": "dotnet",
68-
"args": [ "csharpier", "format", "${staged}" ],
69-
"include": [ "**/*.{cs,csx,csproj,props,targets,xml,config}" ]
70-
}]
65+
"tasks": [{
66+
"name": "Run csharpier",
67+
"command": "dotnet",
68+
"args": [ "csharpier", "format", "${staged}" ],
69+
"include": [ "**/*.{cs,csx,csproj,props,targets,xml,config}" ]
70+
}]
7171
}
7272
```
7373

0 commit comments

Comments
 (0)