Skip to content

Commit

Permalink
Releasing 0.29.2 (#1347)
Browse files Browse the repository at this point in the history
  • Loading branch information
belav committed Sep 15, 2024
1 parent 861f281 commit 57c3ca1
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 5 deletions.
80 changes: 79 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,81 @@
# 0.29.1
# 0.29.2
## What's Changed
### Comments don't follow tabs indent style [#1343](https://github.com/belav/csharpier/issues/1343)
Prior to `0.29.2` CSharpier was converting any tabs within the block of a multiline comment to spaces.
```c#
public void SomeFunction()
{
/*
The following line is an example with an indent:
This line is indented by one tab. (prior to 0.29.2 this would end up as a tab followed by 4 spaces)
*/
/*
The following line is an example with an indent:
This line is indented by 4 spaces but will be converted to 1 tab (prior to 0.29.2 this would end up as a tab followed by 4 spaces)
*/
/*
The following line is an example with an indent:
This line is indented by 3 spaces but will be left as 3 spaces
*/
}
```
### `csharpier-ignore-start` now supported in object initializers [#1342](https://github.com/belav/csharpier/issues/1342)
```c#
// input & expected output
return new SomeClass
{
// csharpier-ignore-start
SomeProperty = someValue,
SomeProperty2 = someValue
// csharpier-ignore-end
};

// 0.29.1
return new SomeClass
{
// csharpier-ignore-start
SomeProperty = someValue,
SomeProperty2 = someValue
// csharpier-ignore-end
};

```
### Fixed extra new line between cast and collection expression. [#1334](https://github.com/belav/csharpier/issues/1334)
```c#
// input & expected output
CallMethod(
(string[])
[
longerValue_____________________________________________,
longerValue_____________________________________________,
]
);

// 0.29.1
CallMethod(
(string[])

[
longerValue_____________________________________________,
longerValue_____________________________________________,
]
);

```

### Support custom extensions in .editorconfig [#1273](https://github.com/belav/csharpier/issues/1273)
As of `0.29.0` CSharpier could format non-standard file extensions, but only if configured in the `csharpierrc` file. This is now supported with an `.editorconfig`

```ini
[*.cst]
csharpier_formatter = csharp
indent_style = space
indent_size = 2
max_line_length = 80
```

**Full Changelog**: https://github.com/belav/csharpier/compare/0.29.1...0.29.2
# 0.29.1
## What's Changed
### Sorting of usings with underscore differs from Visual Studio [#1327](https://github.com/belav/csharpier/issues/1327)
CSharpier now sorts `_` to the bottom of usings.
Expand Down Expand Up @@ -2575,3 +2652,4 @@ Thanks go to @pingzing
2 changes: 1 addition & 1 deletion Nuget/Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>0.29.1</Version>
<Version>0.29.2</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/belav/csharpier</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand Down
16 changes: 14 additions & 2 deletions Src/Website/docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ The long term plan is to improve Csharpier's ability to determine the symbol set

### Configuration Overrides ###
_First available in 0.29.0_

Overrides allows you to specify different configuration options based on glob patterns. This can be used to format non-standard extensions, or to change options based on file path. Top level options will apply to `**/*.{cs,csx}`

```json
Expand Down Expand Up @@ -114,7 +115,7 @@ _First available in 0.26.0_
CSharpier supports configuration via an `.editorconfig` file. A `.csharpierrc*` file in the same directory will take priority.

```ini
[*]
[*.{cs|csx}]
# Non-configurable behaviors
charset = utf-8
insert_final_newline = true
Expand All @@ -123,9 +124,20 @@ dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false
# Configurable behaviors
# end_of_line = lf - there is no 'auto' with a .editorconfig
# end_of_line = lf - there is no 'auto' with an .editorconfig
indent_style = space
indent_size = 4
max_line_length = 100
```

_First available in 0.29.2_

Formatting non-standard file extensions using csharpier can be accomplished with the `csharpier_formatter` option
```ini
[*.cst]
csharpier_formatter = csharp
indent_style = space
indent_size = 2
max_line_length = 80
```

8 changes: 7 additions & 1 deletion Src/Website/docs/Ignore.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class ClassName

```

Use a ranged ignore to exclude multiple lines from formatting. A range is valid around statements and members.
Use a ranged ignore to exclude multiple lines from formatting. A range is not valid in all contexts. Currently it works with statements, members and object initializer expressions.
```csharp
// csharpier-ignore-start
public class Unformatted1 { }
Expand Down Expand Up @@ -104,6 +104,12 @@ public class ClassName
var formatted = true;
}

return new SomeClass
{
// csharpier-ignore-start
SomeProperty = true
// csharpier-ignore-end
}
}
```
Expand Down

0 comments on commit 57c3ca1

Please sign in to comment.