peteroupc / CBOR

A C# implementation of Concise Binary Object Representation (RFC 8949).
The Unlicense
206 stars 29 forks source link

Apply code suggestions and formatting from VS2022 #63

Closed charlesroddie closed 1 year ago

charlesroddie commented 2 years ago

The changes are very good in my opinion and as an F# user I find the code analysis that C# users get is pretty nice.

The diff is huge because of the auto-formatting so this would mess with any other active branches if any. Formatting rules could be changed in .editorconfig to reduce this diff.

Fixes https://github.com/peteroupc/CBOR/issues/62

peteroupc commented 1 year ago

You should update this pull request with indent_size = 2 and, in general, any other formatting rule that follows the existing code style and minimizes the size of this pull request.

charlesroddie commented 1 year ago

I assume the current format is based on customization on your system? Can you export an .editorconfig file for this? For example from VS via https://stackoverflow.com/a/56954297/4903561 . That would allow me and others to contribute to the project. Currently if you for example delete a closing curly bracket and re-add it, a large and incompatible formatting change results since VS assumes standard formatting.

peteroupc commented 1 year ago

I have created an .editorconfig that is the same as the one from this pull request, but with the changes indent_size = 2, tab_width = 2, and dotnet_diagnostic.SA1210.severity = none (to disable enforcing alphabetical order on using directives). Rebase this pull request with these changes, please.

charlesroddie commented 1 year ago

Redone PR in https://github.com/peteroupc/CBOR/pull/67