-
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bumping version, updating change log, updating readme
closes #172
- Loading branch information
Showing
10 changed files
with
160 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,32 @@ | ||
# 0.9.3 | ||
|
||
[diff](https://github.com/belav/csharpier/compare/0.9.2...0.9.3) | ||
|
||
- RecordDeclaration with Generics produces invalid code [#201](https://github.com/belav/csharpier/issues/201) | ||
- Formatting of auto implemented properties with access modifiers [#188](https://github.com/belav/csharpier/issues/188) | ||
- Verbatim string literals take into account EndOfLine configuration [#183](https://github.com/belav/csharpier/issues/183) | ||
- CSharpierIgnore & CSharpierRC from parent directories should be respected. [#181](https://github.com/belav/csharpier/issues/181) | ||
- Break apart readme [#172](https://github.com/belav/csharpier/issues/172) | ||
- PatternMatching includes extra spaces [#167](https://github.com/belav/csharpier/issues/167) | ||
- Re-add async file reads [#127](https://github.com/belav/csharpier/issues/127) | ||
- Dictionary Initializer inserts extra new line [#103](https://github.com/belav/csharpier/issues/103) | ||
|
||
#0.9.2 | ||
[diff](https://github.com/belav/csharpier/compare/0.9.1...0.9.2) | ||
|
||
- Support "auto" for endOfLine [#147](https://api.github.com/repos/belav/csharpier/issues/147) | ||
- Long Parameter Attribute should break after ending brace [#174](https://api.github.com/repos/belav/csharpier/issues/174) | ||
- Attribute on parameter should have space [#104](https://api.github.com/repos/belav/csharpier/issues/104) | ||
|
||
- Support "auto" for endOfLine [#147](https://github.com/belav/csharpier/issues/147) | ||
- Long Parameter Attribute should break after ending brace [#174](https://github.com/belav/csharpier/issues/174) | ||
- Attribute on parameter should have space [#104](https://github.com/belav/csharpier/issues/104) | ||
|
||
# 0.9.1 | ||
|
||
[diff](https://github.com/belav/csharpier/compare/0.9.0...0.9.1) | ||
|
||
- Add support for .csharpierignore [#159](https://api.github.com/repos/belav/csharpier/issues/159) | ||
- Break before BinaryOperator [#152](https://api.github.com/repos/belav/csharpier/issues/152) | ||
- LeadingComments affect breaking [#149](https://api.github.com/repos/belav/csharpier/issues/149) | ||
- Ignore generated files by default [#140](https://api.github.com/repos/belav/csharpier/issues/140) | ||
- Return with BinaryExpression [#137](https://api.github.com/repos/belav/csharpier/issues/137) | ||
- IsPattern breaking inside of IfStatement [#130](https://api.github.com/repos/belav/csharpier/issues/130) | ||
- SpaceBrace causing breaking when it shouldn't [#100](https://api.github.com/repos/belav/csharpier/issues/100) | ||
- Implement Formatting Options with Configuration File [#10](https://api.github.com/repos/belav/csharpier/issues/10) | ||
- Add support for .csharpierignore [#159](https://github.com/belav/csharpier/issues/159) | ||
- Break before BinaryOperator [#152](https://github.com/belav/csharpier/issues/152) | ||
- LeadingComments affect breaking [#149](https://github.com/belav/csharpier/issues/149) | ||
- Ignore generated files by default [#140](https://github.com/belav/csharpier/issues/140) | ||
- Return with BinaryExpression [#137](https://github.com/belav/csharpier/issues/137) | ||
- IsPattern breaking inside of IfStatement [#130](https://github.com/belav/csharpier/issues/130) | ||
- SpaceBrace causing breaking when it shouldn't [#100](https://github.com/belav/csharpier/issues/100) | ||
- Implement Formatting Options with Configuration File [#10](https://github.com/belav/csharpier/issues/10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
|
||
### Command Line Options | ||
```console | ||
Usage: | ||
dotnet-csharpier [options] [<directoryOrFile>] | ||
|
||
Arguments: | ||
<directoryOrFile> A path to a directory containing files to format or a file to format. If a path is not specified the current directory is used | ||
|
||
Options: | ||
--check Check that files are formatted. Will not write any changes. | ||
--fast Skip comparing syntax tree of formatted file to original file to validate changes. | ||
--skip-write Skip writing changes. Generally used for testing to ensure csharpier doesn't throw any errors or cause syntax tree validation failures. | ||
--version Show version information | ||
-?, -h, --help Show help and usage information | ||
|
||
|
||
``` | ||
|
||
### \<directoryOrFile\> | ||
Currently CSharpier only supports being passed a directory to recursively scan for .cs files or a single file to format. | ||
If a directory is not supplied, it will use the current directory. | ||
|
||
### --check | ||
Used to check if your files are already formatted. Outputs any files that have not already been formatted. | ||
This will return exit code 1 if there are unformatted files which is useful for CI pipelines. | ||
|
||
### --fast | ||
CSharpier validates the changes it makes to a file. | ||
It does this by comparing the syntax tree before and after formatting, but ignoring any whitespace trivia in the syntax tree. | ||
If a file fails validation, CSharpier will output the lines that differ. If this happens it indicates a bug in CSharpier's code. | ||
This validation may be skipped by passing the --fast argument. Validation appears to increase the formatting time by ~50%. | ||
|
||
An example of CSharpier finding a file that failed validation. | ||
``` | ||
\src\[Snip]\AbstractReferenceFinder_GlobalSuppressions.cs - failed syntax tree validation | ||
Original: Around Line 280 | ||
} | ||
if (prefix.Span[^2] is < 'A' or > 'Z') | ||
{ | ||
return false; | ||
} | ||
if (prefix.Span[^1] is not ':') | ||
Formatted: Around Line 330 | ||
} | ||
if (prefix.Span[^2] is ) | ||
{ | ||
return false; | ||
} | ||
if (prefix.Span[^1] is not ':') | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
CSharpier has support for a configuration file. You can use any of the following files | ||
- A ```.csharpierrc``` file in JSON or YAML. | ||
- A ```.csharpierrc.json``` or ```.csharpierrc.yaml``` file. | ||
|
||
### Configuration Options | ||
JSON | ||
```json | ||
{ | ||
"printWidth": 100, | ||
"useTabs": false, | ||
"tabWidth": 4, | ||
"endOfLine": "auto" | ||
} | ||
``` | ||
YAML | ||
```json | ||
printWidth: 100 | ||
useTabs: false | ||
tabWidth: 4 | ||
endOfLine: auto | ||
``` | ||
|
||
#### Print Width | ||
Specify at what point the printer will wrap content. This is not a hard limit. Some lines will be shorter or longer. | ||
|
||
Default 100 | ||
#### Use Tabs | ||
Indent lines with tabs instead of spaces. | ||
|
||
Default false | ||
#### Tab Width | ||
Specify the number of spaces used per indentation level. | ||
|
||
Default 4 | ||
#### End of Line | ||
Specify what type of line endings will be printed in files. | ||
Options | ||
- "auto" - Detects which type of line ending to used based on the first one it encounters in the file **Default** | ||
- "lf" - Line feed only (\n) | ||
- "crlf" Carriage return and line feed (\r\n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
### Ignoring Files | ||
Csharpier will ignore the following files | ||
- Any file that begins with ```TemporaryGeneratedFile_``` | ||
- Any file that ends with ```.designer.cs``` | ||
- Any file that ends with ```.generated.cs``` | ||
- Any file that ends with ```.g.cs``` | ||
- Any file that ends with ```.g.i.cs``` | ||
- Any file that begins with a comment that contains ```<autogenerated``` or ```<auto-generated``` | ||
|
||
Add a ```.csharpierignore``` file to ignore additional files and folders. The file uses [gitignore syntax](https://git-scm.com/docs/gitignore#_pattern_format) | ||
|
||
Example | ||
``` | ||
Uploads/ | ||
**/App_Data/*.cs | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters