Skip to content

Commit 3a063a1

Browse files
authored
Releasing 1.1.0 (#1671)
1 parent e9d4e75 commit 3a063a1

File tree

5 files changed

+127
-18
lines changed

5 files changed

+127
-18
lines changed

CHANGELOG.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,93 @@
1+
# 1.1.0
2+
## What's Changed
3+
### .gitignore from parent folders impacts formatting of children [#1627](https://github.com/belav/csharpier/issues/1627)
4+
CSharpier will no longer consider `.gitignore` files located above the root of the current git repository.
5+
### Changes to stdin formatting [#288](https://github.com/belav/csharpier/issues/288) [#1657](https://github.com/belav/csharpier/issues/1657)
6+
There is a new option `--stdin-filepath` that is used to specify the filepath CSharpier should use for resolving options and ignore files. \
7+
When no path is specified via `stdin-path`
8+
- No ignore files are considered.
9+
- The current directory is considered when locating options
10+
- The file is assumed to be c# unless the first non-whitespace character is `<` in which case it is assumed to be xml.
11+
### Support for C# 14 and .NET 10 [#1654](https://github.com/belav/csharpier/issues/1654) [#1646](https://github.com/belav/csharpier/issues/1646)
12+
Changes were required to support the following
13+
- Extension Declarations
14+
- File level directives in file based C# Apps
15+
### Support --ignore-path CLI option [#1585](https://github.com/belav/csharpier/issues/1585)
16+
It is now possible to specify the path to an ignore file
17+
```bash
18+
dotnet csharpier format . --ignore-path .config/.csharpierignore
19+
```
20+
### Format xaml and slnx by default [#1628](https://github.com/belav/csharpier/issues/1628) [#1604](https://github.com/belav/csharpier/issues/1604)
21+
CSharpier now formats `xaml` and `slnx` by default without the need for configuration changes.
22+
### XML formatting is not taking into account EOL configuration on multiline comments [#1660](https://github.com/belav/csharpier/issues/1660)
23+
When formatting the following XML, CSharpier would always use the system system default for ending lines within the comment instead of the respecting the configured EOL setting.
24+
```xml
25+
<Element>
26+
<!--
27+
Comment with EOL
28+
-->
29+
</Element>
30+
```
31+
32+
### Error when no read access to intermediate containing folder [#1656](https://github.com/belav/csharpier/issues/1656)
33+
In the case that CSharpier had access to a sub directory but not the parent of that sub directory, it was failing with an exception. That has been resolved.
34+
### Misleading message after "csharpier check" [#1645](https://github.com/belav/csharpier/issues/1645)
35+
Previously the `format` and `check` commands both used the same output message. The `check` command now correctly reports that it checked files and did not format them.
36+
```bash
37+
# 1.0.3
38+
dotnet csharpier check .
39+
Formatted 13226 files in 21986ms.
40+
41+
# 1.1.0
42+
dotnet csharpier check .
43+
Checked 13226 files in 21986ms.
44+
```
45+
### Multiline collection expressions should not be indented [#1635](https://github.com/belav/csharpier/issues/1635)
46+
CSharpier now formats collection expressions consistently when they are in a property
47+
```c#
48+
// input & expected output
49+
public class ClassName
50+
{
51+
public SomeObject LongValue = new
52+
{
53+
One = "One",
54+
Two = "Two",
55+
ThreeThreeThree = "ThreeThreeThree",
56+
};
57+
58+
public SomeObject LongValue { get; } = new
59+
{
60+
One = "One",
61+
Two = "Two",
62+
ThreeThreeThree = "ThreeThreeThree",
63+
};
64+
}
65+
66+
// 1.0.3
67+
public class ClassName
68+
{
69+
public SomeObject LongValue = new
70+
{
71+
One = "One",
72+
Two = "Two",
73+
ThreeThreeThree = "ThreeThreeThree",
74+
};
75+
76+
public SomeObject LongValue { get; } =
77+
new
78+
{
79+
One = "One",
80+
Two = "Two",
81+
ThreeThreeThree = "ThreeThreeThree",
82+
};
83+
}
84+
85+
```
86+
87+
### .editorconfig is not considered, when its part of the .gitignore [#1582](https://github.com/belav/csharpier/issues/1582)
88+
Previously if an `.editorconfig` was in the `.gitignore` it would not be considered when determining the configuration options for formatting a given file. That behavior has been changed so it will be considered.
89+
90+
**Full Changelog**: https://github.com/belav/csharpier/compare/1.0.3...1.1.0
191
# 1.0.3
292
## What's Changed
393
### Switch block case with conditionals adding newlines [#1630](https://github.com/belav/csharpier/issues/1630)
@@ -3341,5 +3431,6 @@ Thanks go to @pingzing
33413431
33423432
33433433
3434+
33443435
33453436

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.3</Version>
3+
<Version>1.1.0</Version>
44
<PackageLicenseExpression>MIT</PackageLicenseExpression>
55
<RepositoryUrl>https://github.com/belav/csharpier</RepositoryUrl>
66
<RepositoryType>git</RepositoryType>

Src/Website/docs/CLI.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ If a list of paths is supplied
2020
- if the path points to an existing directory, CSharpier will recursively format the contents of that directory
2121

2222
If a list of paths is not supplied, then stdin is read as a file, formatted and written to stdout
23+
- When no path is specified via `stdin-path`
24+
- No ignore files are considered.
25+
- The current directory is considered when locating options
26+
- The file is assumed to be c# unless the first non-whitespace character is `<` in which case it is assumed to be xml.
27+
2328

2429
#### Options
2530
- `--config-path`
@@ -33,9 +38,23 @@ If a list of paths is not supplied, then stdin is read as a file, formatted and
3338
dotnet csharpier format . --config-path "./config/csharpier.yaml"
3439

3540
# allows passing in a path to an editorconfig
36-
dotnet csharpier . --config-path "./config/.editorconfig"
41+
dotnet csharpier format . --config-path "./config/.editorconfig"
42+
```
43+
44+
- `--ignore-path`
45+
46+
If your ignore file lives in a location that CSharpier would not normally resolve it (such as in a config folder)
47+
you can pass the path for the ignore file to CSharpier.
48+
```bash
49+
dotnet csharpier format . --ignore-path "./config/.csharpierignore"
3750
```
3851

52+
- `--stdin-path`
53+
54+
If you are piping input to csharpier and want to specify a path to be used for resolving options and determining if a file is ignored
55+
```bash
56+
"public class Class { }" | dotnet csharpier format --stdin-path "MyFile.cs"
57+
```
3958

4059
- `--log-format`
4160

Src/Website/docs/Configuration.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ indent_style = space
9898
indent_size = 4
9999
max_line_length = 100
100100
101-
[*.{csproj,props,targets,xml,config}]
102-
# Configurable behaviors
101+
[*.{config,csproj,props,slnx,targets,xaml,xml}]
103102
indent_style = space
104103
indent_size = 2
105104
max_line_length = 100

Src/Website/docs/Pre-commit.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,20 @@ 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": [
70-
"**/*.cs",
71-
"**/*.csx",
72-
"**/*.csproj",
73-
"**/*.props",
74-
"**/*.targets",
75-
"**/*.xml",
76-
"**/*.config"
77-
]
78-
}]
65+
"tasks": [{
66+
"name": "Run csharpier",
67+
"command": "dotnet",
68+
"args": [ "csharpier", "format", "${staged}" ],
69+
"include": [
70+
"**/*.cs",
71+
"**/*.csx",
72+
"**/*.csproj",
73+
"**/*.props",
74+
"**/*.targets",
75+
"**/*.xml",
76+
"**/*.config"
77+
]
78+
}]
7979
}
8080
```
8181

0 commit comments

Comments
 (0)