Skip to content

Commit

Permalink
style: Update style rules for yml and csproj files
Browse files Browse the repository at this point in the history
2 spaces are sufficient for indentation
  • Loading branch information
Crown0815 committed Oct 26, 2023
1 parent b1a50f1 commit c72d0c3
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 117 deletions.
14 changes: 8 additions & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@

[*]
charset = utf-8-bom
charset = utf-8
end_of_line = crlf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
tab_width = 4

[{*.yaml,*.yml,*.har,*.json,*.html,*.csproj,*.ps1}]
indent_size = 2

[*.cs]
max_line_length = 120

# Microsoft .NET properties
csharp_new_line_before_members_in_object_initializers = false
Expand Down Expand Up @@ -54,8 +61,3 @@ resharper_suggest_var_or_type_simple_types_highlighting = hint
resharper_web_config_module_not_resolved_highlighting = warning
resharper_web_config_type_not_resolved_highlighting = warning
resharper_web_config_wrong_module_highlighting = warning

[*.{appxmanifest,asax,ascx,aspx,axaml,build,c,c++,cc,cginc,compute,cp,cpp,cs,cshtml,cu,cuh,cxx,dtd,fx,fxh,h,hh,hlsl,hlsli,hlslinc,hpp,hxx,inc,inl,ino,ipp,ixx,master,mpp,mq4,mq5,mqh,nuspec,paml,razor,resw,resx,skin,tpp,usf,ush,vb,xaml,xamlx,xoml,xsd}]
indent_style = space
indent_size = 4
tab_width = 4
76 changes: 38 additions & 38 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
name: build and test

on:
push:
pull_request:
branches: [ main ]
paths:
- '**.cs'
- '**.csproj'
push:
pull_request:
branches: [ main ]
paths:
- '**.cs'
- '**.csproj'

jobs:
build-and-test:

name: build-and-test-${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json

- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Test
run: dotnet test --no-restore --verbosity normal

- name: Publish
run: dotnet publish src/ConventionalChangelog/ConventionalChangelog.csproj --framework net7.0 --configuration Release --output release --nologo

- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: Application_${{ matrix.os }}
path: release
build-and-test:
name: build-and-test-${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json

- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Test
run: dotnet test --no-restore --verbosity normal

- name: Publish
run: dotnet publish src/ConventionalChangelog/ConventionalChangelog.csproj --framework net7.0 --configuration Release --output release --nologo

- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: Application_${{ matrix.os }}
path: release
74 changes: 37 additions & 37 deletions .github/workflows/publish_tool.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
name: publish tool

on:
workflow_dispatch:
workflow_dispatch:

jobs:
publish_tool:

name: Publish Tool
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'

- name: Determine Version
id: version
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true

- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json

- name: Package
run: dotnet pack --configuration Release --output nuget --nologo -p:Version=${{ steps.version.outputs.nuGetVersionV2 }}

- name: Tag Repository
uses: rickstaa/action-create-tag@v1
with:
tag: "v${{ steps.version.outputs.semVer }}"

- name: Publish
run: dotnet nuget push "**/*.nupkg" --source nuget.org --api-key ${{ secrets.NUGET_API_KEY }}
publish_tool:

name: Publish Tool
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'

- name: Determine Version
id: version
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true

- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json

- name: Package
run: dotnet pack --configuration Release --output nuget --nologo -p:Version=${{ steps.version.outputs.nuGetVersionV2 }}

- name: Tag Repository
uses: rickstaa/action-create-tag@v1
with:
tag: "v${{ steps.version.outputs.semVer }}"

- name: Publish
run: dotnet nuget push "**/*.nupkg" --source nuget.org --api-key ${{ secrets.NUGET_API_KEY }}
36 changes: 18 additions & 18 deletions src/ConventionalChangelog/ConventionalChangelog.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>

<PackAsTool>true</PackAsTool>
<ToolCommandName>changelog</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackAsTool>true</PackAsTool>
<ToolCommandName>changelog</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>

<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LibGit2Sharp" Version="0.27.0-preview-0182" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="LibGit2Sharp" Version="0.27.0-preview-0182"/>
</ItemGroup>

<ItemGroup>
<None Include="..\..\LICENSE.md" Pack="true" PackagePath=""/>
<None Include="..\..\README.md" Pack="true" PackagePath=""/>
</ItemGroup>
<ItemGroup>
<None Include="..\..\LICENSE.md" Pack="true" PackagePath=""/>
<None Include="..\..\README.md" Pack="true" PackagePath=""/>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\ConventionalChangelog\ConventionalChangelog.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\ConventionalChangelog\ConventionalChangelog.csproj"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.7.0" />
<PackageReference Include="LibGit2Sharp" Version="0.27.0-preview-0182" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.7.0"/>
<PackageReference Include="LibGit2Sharp" Version="0.27.0-preview-0182"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2"/>
<PackageReference Include="xunit" Version="2.4.2"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

</Project>

0 comments on commit c72d0c3

Please sign in to comment.