diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 274e12316..af75eb141 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1 @@ -github: [belav] +github: [pisolofin] diff --git a/.github/workflows/publish_nuget.yml b/.github/workflows/publish_nuget.yml index e0ddc3a9e..40afd5dd8 100644 --- a/.github/workflows/publish_nuget.yml +++ b/.github/workflows/publish_nuget.yml @@ -1,7 +1,8 @@ name: Publish Nuget on: push: - branches: [ main ] + branches: [ build-fix ] + workflow_dispatch: jobs: test: runs-on: ubuntu-latest diff --git a/.github/workflows/validate_pull_request.yml b/.github/workflows/validate_pull_request.yml index 14fded337..e40edb002 100644 --- a/.github/workflows/validate_pull_request.yml +++ b/.github/workflows/validate_pull_request.yml @@ -2,6 +2,7 @@ name: Validate Pull Request on: pull_request: branches: [main] + workflow_dispatch: jobs: run_tests: runs-on: ubuntu-latest diff --git a/Nuget/Build.props b/Nuget/Build.props index 08808af77..abc0f3627 100644 --- a/Nuget/Build.props +++ b/Nuget/Build.props @@ -1,10 +1,10 @@ - 0.29.0 + 0.29.0.1 MIT - https://github.com/belav/csharpier + https://github.com/pisolofin/csharpier-editorconfig git - CSharpier is an opinionated code formatter for c#. + CSharpier is an not opinionated code formatter for c#. logo.png README.md false diff --git a/Nuget/README.md b/Nuget/README.md index 84f241248..985358a97 100644 --- a/Nuget/README.md +++ b/Nuget/README.md @@ -1,48 +1,21 @@ -CSharpier is an opinionated code formatter for c#. It uses Roslyn to parse your code and re-prints it using its own rules. -The printing process was ported from [prettier](https://github.com/prettier/prettier) but has evolved over time. - -CSharpier provides a few basic options that affect formatting and has no plans to add more. It follows the [Option Philosophy](https://prettier.io/docs/en/option-philosophy.html) of prettier. +This is as non opinionated version of [csharpier](https://github.com/belav/csharpier) tool created to add EditorConfig file style guide, allowing users to define and apply custom styling options. ### Quick Start -Install CSharpier globally using the following command. +Install CSharpier-Config globally using the following command. ```bash -dotnet tool install csharpier -g +dotnet tool install csharpier-config -g ``` Then format the contents of a directory and its children with the following command. ```bash -dotnet csharpier . +dotnet csharpier-config . ``` -CSharpier can also format [on save in your editor](https://csharpier.com/docs/Editors), as a [pre-commit hook](https://csharpier.com/docs/Pre-commit), as [part of your build](https://csharpier.com/docs/MSBuild) or even [programatically](https://csharpier.com/docs/API). Then you can ensure code was formatted with a [CI/CD tool](https://csharpier.com/docs/ContinuousIntegration). - ---- - -[Read the documentation](https://csharpier.com) +**This is a work in progress project** -[Try it out](https://playground.csharpier.com) +In this branch, I will set up the project with new references in the documentation, as well as handle the deployment and naming of the executable program. ---- +All documentation that you find about csharpier is also valid for csharpier-config, you have only to change command like +All documentation you find about `CSharpier` is also valid for `CSharpier-Config`. You only need to adjust the commands accordingly. -### Before -```c# -public class ClassName { - public void CallMethod() { - this.LongUglyMethod("1234567890", "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); - } -} -``` - -### After -```c# -public class ClassName -{ - public void CallMethod() - { - this.LongUglyMethod( - "1234567890", - "abcdefghijklmnopqrstuvwxyz", - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - ); - } -} -``` +- `dotnet csharpier` -> `dotnet csharpier-config` +- `dotnet-csharpier` -> `dotnet-csharpier-config` diff --git a/Nuget/csharpier-editorconfig.snk b/Nuget/csharpier-editorconfig.snk new file mode 100644 index 000000000..735ec2061 Binary files /dev/null and b/Nuget/csharpier-editorconfig.snk differ diff --git a/README.md b/README.md index 370e24b39..48416df9a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ # csharpier-config -This is as non opinionated version of [csharpier](https://github.com/belav/csharpier) tool created to add EditorConfig file style guide, -allowing users to define and apply custom styling options. +This is as non opinionated version of [csharpier](https://github.com/belav/csharpier) tool created to add EditorConfig file style guide, allowing users to define and apply custom styling options. I started implementing these options in a separate branch called [feature/brackets](https://github.com/pisolofin/csharpier-editorconfig/tree/feature/brackets). diff --git a/Scripts/RunLinuxTests.ps1 b/Scripts/RunLinuxTests.ps1 index 5dc30aeb0..67bfee834 100644 --- a/Scripts/RunLinuxTests.ps1 +++ b/Scripts/RunLinuxTests.ps1 @@ -4,4 +4,4 @@ docker run --rm -v ${pwd}:/app -e "NormalizeLineEndings=1" -w /app/tests mcr.microsoft.com/dotnet/sdk:7.0 dotnet test /app/Src/CSharpier.Tests/CSharpier.Tests.csproj --logger:trx # gross way to run csharpier against the csharpier-repos -#docker run --rm -v ${pwd}:/app -e "NormalizeLineEndings=1" -w /app mcr.microsoft.com/dotnet/sdk:5.0 dotnet ./csharpier/Src/CSharpier/bin/Debug/net6.0/dotnet-csharpier.dll csharpier-repos --skip-write +#docker run --rm -v ${pwd}:/app -e "NormalizeLineEndings=1" -w /app mcr.microsoft.com/dotnet/sdk:5.0 dotnet ./csharpier/Src/CSharpier/bin/Debug/net6.0/dotnet-csharpier-config.dll csharpier-repos --skip-write diff --git a/Shell/ReviewBranch.psm1 b/Shell/ReviewBranch.psm1 index 90b7d2bb7..ad86d4837 100644 --- a/Shell/ReviewBranch.psm1 +++ b/Shell/ReviewBranch.psm1 @@ -7,7 +7,7 @@ function CSH-ReviewBranch { $repositoryRoot = Join-Path $PSScriptRoot ".." $csProjectPath = Join-Path $repositoryRoot "Src/CSharpier.Cli/CSharpier.Cli.csproj" - $csharpierDllPath = Join-Path $repositoryRoot "Src/CSharpier.Cli/bin/release/net8.0/dotnet-csharpier.dll" + $csharpierDllPath = Join-Path $repositoryRoot "Src/CSharpier.Cli/bin/release/net8.0/dotnet-csharpier-config.dll" $location = Get-Location diff --git a/Src/CSharpier.Benchmarks/CSharpier.Benchmarks.csproj b/Src/CSharpier.Benchmarks/CSharpier.Benchmarks.csproj index dbb812bda..520125fd1 100644 --- a/Src/CSharpier.Benchmarks/CSharpier.Benchmarks.csproj +++ b/Src/CSharpier.Benchmarks/CSharpier.Benchmarks.csproj @@ -1,7 +1,7 @@ Exe - ../../Nuget/csharpier.snk + ../../Nuget/csharpier-editorconfig.snk True diff --git a/Src/CSharpier.Cli.Tests/CSharpier.Cli.Tests.csproj b/Src/CSharpier.Cli.Tests/CSharpier.Cli.Tests.csproj index ad8e6ecc2..eba3d2489 100644 --- a/Src/CSharpier.Cli.Tests/CSharpier.Cli.Tests.csproj +++ b/Src/CSharpier.Cli.Tests/CSharpier.Cli.Tests.csproj @@ -1,7 +1,7 @@ false - ../../Nuget/csharpier.snk + ../../Nuget/csharpier-editorconfig.snk True diff --git a/Src/CSharpier.Cli.Tests/CliTests.cs b/Src/CSharpier.Cli.Tests/CliTests.cs index 74d1d85e7..40416c944 100644 --- a/Src/CSharpier.Cli.Tests/CliTests.cs +++ b/Src/CSharpier.Cli.Tests/CliTests.cs @@ -557,7 +557,7 @@ private class CsharpierProcess public CsharpierProcess() { - var path = Path.Combine(Directory.GetCurrentDirectory(), "dotnet-csharpier.dll"); + var path = Path.Combine(Directory.GetCurrentDirectory(), "dotnet-csharpier-config.dll"); this.command = CliWrap .Cli.Wrap("dotnet") diff --git a/Src/CSharpier.Cli.Tests/ServerTests.cs b/Src/CSharpier.Cli.Tests/ServerTests.cs index d28eedf26..149958f6a 100644 --- a/Src/CSharpier.Cli.Tests/ServerTests.cs +++ b/Src/CSharpier.Cli.Tests/ServerTests.cs @@ -19,7 +19,7 @@ public class ServerTests [Ignore("Not working on GH, test locally on linux?")] public async Task Stuff() { - var path = Path.Combine(Directory.GetCurrentDirectory(), "dotnet-csharpier.dll"); + var path = Path.Combine(Directory.GetCurrentDirectory(), "dotnet-csharpier-config.dll"); var processStartInfo = new ProcessStartInfo("dotnet", $"{path} --server") { diff --git a/Src/CSharpier.Cli/CSharpier.Cli.csproj b/Src/CSharpier.Cli/CSharpier.Cli.csproj index deaaca2fa..e4bc069fe 100644 --- a/Src/CSharpier.Cli/CSharpier.Cli.csproj +++ b/Src/CSharpier.Cli/CSharpier.Cli.csproj @@ -2,13 +2,13 @@ Exe - CSharpier + CSharpier-Config dotnet-csharpier-config net6.0;net7.0;net8.0 true - ../../Nuget/csharpier.snk + ../../Nuget/csharpier-editorconfig.snk True - 002400000480000094000000060200000024000052534131000400000100010049d266ea1aeae09c0abfce28b8728314d4e4807126ee8bc56155a7ddc765997ed3522908b469ae133fc49ef0bfa957df36082c1c2e0ec8cdc05a4ca4dbd4e1bea6c17fc1008555e15af13a8fc871a04ffc38f5e60e6203bfaf01d16a2a283b90572ade79135801c1675bf38b7a5a60ec8353069796eb53a26ffdddc9ee1273be + 0024000004800000940000000602000000240000525341310004000001000100F1336A544482E27A7A6D9EC6DE7C91AD2BF157844B2A02CB6A4EEB11036D42A4B1FE1BC4CA11B882E3E1ACA228CD45A96F1135FD7E18E0C5C4B376244A9115BB63CBEC48884FEB75503A31B6A7B57DD972A65E0D356F589D3AE1292E6D2546B38FE33DF0D42BA71B387783DB5B5C5EA1367FD468112DDFD47FD6CA7AE004C5B2 diff --git a/Src/CSharpier.MsBuild/CSharpier.MsBuild.csproj b/Src/CSharpier.MsBuild/CSharpier.MsBuild.csproj index 7bddfd6ca..d0a99adc3 100644 --- a/Src/CSharpier.MsBuild/CSharpier.MsBuild.csproj +++ b/Src/CSharpier.MsBuild/CSharpier.MsBuild.csproj @@ -2,7 +2,7 @@ net6.0;net7.0;net8.0 - CSharpier.MsBuild + CSharpier-Config.MsBuild true ../CSharpier.Cli/bin/$(Configuration)/$(TargetFramework) diff --git a/Src/CSharpier.MsBuild/build/CSharpier.MsBuild.props b/Src/CSharpier.MsBuild/build/CSharpier-Config.MsBuild.props similarity index 100% rename from Src/CSharpier.MsBuild/build/CSharpier.MsBuild.props rename to Src/CSharpier.MsBuild/build/CSharpier-Config.MsBuild.props diff --git a/Src/CSharpier.MsBuild/build/CSharpier.MsBuild.targets b/Src/CSharpier.MsBuild/build/CSharpier-Config.MsBuild.targets similarity index 97% rename from Src/CSharpier.MsBuild/build/CSharpier.MsBuild.targets rename to Src/CSharpier.MsBuild/build/CSharpier-Config.MsBuild.targets index 4af14af55..3db8967c4 100644 --- a/Src/CSharpier.MsBuild/build/CSharpier.MsBuild.targets +++ b/Src/CSharpier.MsBuild/build/CSharpier-Config.MsBuild.targets @@ -4,7 +4,7 @@ net7.0 net6.0 net8.0 - $(MSBuildThisFileDirectory)../tools/csharpier/$(CSharpier_FrameworkVersion)/dotnet-csharpier.dll + $(MSBuildThisFileDirectory)../tools/csharpier/$(CSharpier_FrameworkVersion)/dotnet-csharpier-config.dll $(CSharpierArgs) --check $(CSharpierArgs) --loglevel $(CSharpier_LogLevel) $(TargetFramework) diff --git a/Src/CSharpier.Playground/CSharpier.Playground.csproj b/Src/CSharpier.Playground/CSharpier.Playground.csproj index 14b006bc7..efa7e7adc 100644 --- a/Src/CSharpier.Playground/CSharpier.Playground.csproj +++ b/Src/CSharpier.Playground/CSharpier.Playground.csproj @@ -7,7 +7,7 @@ false ClientApp\ $(DefaultItemExcludes);$(SpaRoot)node_modules\** - ../../Nuget/csharpier.snk + ../../Nuget/csharpier-editorconfig.snk True diff --git a/Src/CSharpier.Tests/CSharpier.Tests.csproj b/Src/CSharpier.Tests/CSharpier.Tests.csproj index c646b2636..15b08433e 100644 --- a/Src/CSharpier.Tests/CSharpier.Tests.csproj +++ b/Src/CSharpier.Tests/CSharpier.Tests.csproj @@ -3,7 +3,7 @@ false CSharpier.Tests true - ../../Nuget/csharpier.snk + ../../Nuget/csharpier-editorconfig.snk True diff --git a/Src/CSharpier/CSharpier.csproj b/Src/CSharpier/CSharpier.csproj index cf48e5cd8..10d29710d 100644 --- a/Src/CSharpier/CSharpier.csproj +++ b/Src/CSharpier/CSharpier.csproj @@ -1,13 +1,13 @@ - CSharpier.Core + CSharpier-Config.Core net6.0;net7.0;net8.0;netstandard2.0 CSharpier true - ../../Nuget/csharpier.snk + ../../Nuget/csharpier-editorconfig.snk True - 002400000480000094000000060200000024000052534131000400000100010049d266ea1aeae09c0abfce28b8728314d4e4807126ee8bc56155a7ddc765997ed3522908b469ae133fc49ef0bfa957df36082c1c2e0ec8cdc05a4ca4dbd4e1bea6c17fc1008555e15af13a8fc871a04ffc38f5e60e6203bfaf01d16a2a283b90572ade79135801c1675bf38b7a5a60ec8353069796eb53a26ffdddc9ee1273be + 0024000004800000940000000602000000240000525341310004000001000100F1336A544482E27A7A6D9EC6DE7C91AD2BF157844B2A02CB6A4EEB11036D42A4B1FE1BC4CA11B882E3E1ACA228CD45A96F1135FD7E18E0C5C4B376244A9115BB63CBEC48884FEB75503A31B6A7B57DD972A65E0D356F589D3AE1292E6D2546B38FE33DF0D42BA71B387783DB5B5C5EA1367FD468112DDFD47FD6CA7AE004C5B2 $(MSBuildProjectName)-Config @@ -34,7 +34,7 @@ <_Parameter1>CSharpier.Tests, PublicKey=$(PublicKey) - <_Parameter1>dotnet-csharpier, PublicKey=$(PublicKey) + <_Parameter1>dotnet-csharpier-config, PublicKey=$(PublicKey) diff --git a/Tests/MsBuild/Run.ps1 b/Tests/MsBuild/Run.ps1 index adb76860b..cd5f1ba6a 100644 --- a/Tests/MsBuild/Run.ps1 +++ b/Tests/MsBuild/Run.ps1 @@ -50,7 +50,7 @@ RUN dotnet build -c Release $csharpierFrameworkVersion - + all runtime; build; native; contentfiles; analyzers; buildtransitive