Skip to content

Commit

Permalink
Editorconfig applied #38
Browse files Browse the repository at this point in the history
  • Loading branch information
Kieranties committed Apr 10, 2019
1 parent 6430d4a commit 8e805ca
Show file tree
Hide file tree
Showing 73 changed files with 2,602 additions and 2,525 deletions.
75 changes: 75 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
root = true

[*]
end_of_line = crlf
indent_style = tab
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.cs]
indent_size = 4
dotnet_sort_system_directives_first = false
dotnet_style_coalesce_expression = true : warning
dotnet_style_collection_initializer = true : warning
dotnet_style_explicit_tuple_names = true : warning
dotnet_style_null_propagation = true : warning
dotnet_style_object_initializer = true : warning
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity : warning
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity : warning
dotnet_style_parentheses_in_other_operators = always_for_clarity : warning
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity : warning
dotnet_style_predefined_type_for_locals_parameters_members = true : error
dotnet_style_predefined_type_for_member_access = true : error
dotnet_style_prefer_auto_properties = true : error
dotnet_style_prefer_conditional_expression_over_assignment = true
dotnet_style_prefer_conditional_expression_over_return = true
dotnet_style_prefer_inferred_anonymous_type_member_names = true : warning
dotnet_style_prefer_is_null_check_over_reference_equality_method = true : warning
dotnet_style_qualification_for_event = false : none
dotnet_style_qualification_for_field = false : none
dotnet_style_qualification_for_method = false : none
dotnet_style_qualification_for_property = false : none
dotnet_style_readonly_field = true : warning
dotnet_style_require_accessibility_modifiers = always : warning
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_switch_labels = true
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true
csharp_prefer_braces = true : silent
csharp_prefer_simple_default_expression = true : warning
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_around_binary_operators = before_and_after
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_style_conditional_delegate_call = true : warning
csharp_style_deconstructed_variable_declaration = true : warning
csharp_style_expression_bodied_accessors = when_on_single_line : suggestion
csharp_style_expression_bodied_constructors = false : none
csharp_style_expression_bodied_indexers = when_on_single_line : suggestion
csharp_style_expression_bodied_methods = false : none
csharp_style_expression_bodied_operators = when_on_single_line : suggestion
csharp_style_expression_bodied_properties = when_on_single_line : suggestion
csharp_style_inlined_variable_declaration = true : warning
csharp_style_pattern_local_over_anonymous_function = true : warning
csharp_style_pattern_matching_over_as_with_null_check = true : warning
csharp_style_pattern_matching_over_is_with_cast_check = true : warning
csharp_style_throw_expression = true : warning
csharp_style_var_elsewhere = true : warning
csharp_style_var_for_built_in_types = true : warning
csharp_style_var_when_type_is_apparent = true : warning
40 changes: 20 additions & 20 deletions .simpleversion.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"version": "0.2.0",
"label": ["alpha1"],
"branches": {
"release": [
"^refs/heads/master$",
"^refs/heads/preview/.+$",
"^refs/heads/release/.+$"
],
"overrides": [
{
"match": "^refs/heads/feature/.+$",
"metadata": [ "{shortbranchname}" ]
},
{
"match": "^refs/heads/release/.+$",
"label": [],
"metadata": [ "*" ]
}
]
}
"version": "0.2.0",
"label": [ "alpha1" ],
"branches": {
"release": [
"^refs/heads/master$",
"^refs/heads/preview/.+$",
"^refs/heads/release/.+$"
],
"overrides": [
{
"match": "^refs/heads/feature/.+$",
"metadata": [ "{shortbranchname}" ]
},
{
"match": "^refs/heads/release/.+$",
"label": [],
"metadata": [ "*" ]
}
]
}
}
76 changes: 38 additions & 38 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
<Project>
<PropertyGroup Label="Local build version">
<Version Condition="'$(Version)' == ''">1.0.0</Version>
<PackageVersion>$(Version)</PackageVersion>
<MajorMinorPatchVersion>$([System.Text.RegularExpressions.Regex]::Match($(Version), '\d+\.\d+\.\d+').Value)</MajorMinorPatchVersion>
</PropertyGroup>
<PropertyGroup Label="Local build version">
<Version Condition="'$(Version)' == ''">1.0.0</Version>
<PackageVersion>$(Version)</PackageVersion>
<MajorMinorPatchVersion>$([System.Text.RegularExpressions.Regex]::Match($(Version), '\d+\.\d+\.\d+').Value)</MajorMinorPatchVersion>
</PropertyGroup>

<PropertyGroup Label="All package targets">
<TargetFramework>net461</TargetFramework>
</PropertyGroup>
<PropertyGroup Label="All package targets">
<TargetFramework>net461</TargetFramework>
</PropertyGroup>

<!-- Meta properties: https://docs.microsoft.com/en-us/dotnet/core/tools/csproj -->
<PropertyGroup Label="Assembly Meta">
<Company>Kieranties</Company>
<Copyright>(c) Kieranties</Copyright>
<Description>SimpleVersion - A simple tool to version your code</Description>
<FileVersion>$(MajorMinorPatchVersion).0</FileVersion>
<AssemblyVersion>$([System.Text.RegularExpressions.Regex]::Match($(Version), '\d+\.\d+').Value).0.0</AssemblyVersion>
<InformationalVersion>$(Version)$(VersionSuffix)</InformationalVersion>
</PropertyGroup>
<!-- Meta properties: https://docs.microsoft.com/en-us/dotnet/core/tools/csproj -->
<PropertyGroup Label="Assembly Meta">
<Company>Kieranties</Company>
<Copyright>(c) Kieranties</Copyright>
<Description>SimpleVersion - A simple tool to version your code</Description>
<FileVersion>$(MajorMinorPatchVersion).0</FileVersion>
<AssemblyVersion>$([System.Text.RegularExpressions.Regex]::Match($(Version), '\d+\.\d+').Value).0.0</AssemblyVersion>
<InformationalVersion>$(Version)$(VersionSuffix)</InformationalVersion>
</PropertyGroup>

<PropertyGroup Label="Package Meta">
<Authors>Kieran@Kieranties.com</Authors>
<PackageProjectUrl>https://github.com/Kieranties/SimpleVersion</PackageProjectUrl>
<PackageTags>semver;versioning;git</PackageTags>
<RepositoryUrl>https://github.com/Kieranties/SimpleVersion</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageIconUrl>https://raw.github.com/Kieranties/SimpleVersion/master/docs/img/logo.png</PackageIconUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>
<PropertyGroup Label="Package Meta">
<Authors>Kieran@Kieranties.com</Authors>
<PackageProjectUrl>https://github.com/Kieranties/SimpleVersion</PackageProjectUrl>
<PackageTags>semver;versioning;git</PackageTags>
<RepositoryUrl>https://github.com/Kieranties/SimpleVersion</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageIconUrl>https://raw.github.com/Kieranties/SimpleVersion/master/docs/img/logo.png</PackageIconUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>

<PropertyGroup Label="Build Attributes">
<WarningsAsErrors>true</WarningsAsErrors>
<MSBuildTreatWarningsAsErrors>true</MSBuildTreatWarningsAsErrors>
<!-- NU5105 - Usage of semver 2 versioning -->
<NoWarn>$(NoWarn);NU5105</NoWarn>
</PropertyGroup>
<PropertyGroup Label="Build Attributes">
<WarningsAsErrors>true</WarningsAsErrors>
<MSBuildTreatWarningsAsErrors>true</MSBuildTreatWarningsAsErrors>
<!-- NU5105 - Usage of semver 2 versioning -->
<NoWarn>$(NoWarn);NU5105</NoWarn>
</PropertyGroup>

<ItemGroup Label="Shared Assets">
<AdditionalFiles Include="$(MSBuildThisFileDirectory)shared/stylecop.json" Link="stylecop.json" />
</ItemGroup>
<ItemGroup Label="Shared Assets">
<AdditionalFiles Include="$(MSBuildThisFileDirectory)shared/stylecop.json" Link="stylecop.json" />
</ItemGroup>

<PropertyGroup Label="Shared properties">
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)shared/SimpleVersion.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Label="Shared properties">
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)shared/SimpleVersion.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
</Project>
38 changes: 19 additions & 19 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<Project>

<PropertyGroup>
<GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);SetReleaseNotes</GenerateNuspecDependsOn>
</PropertyGroup>

<Target Name="SetReleaseNotes">

<ItemGroup>
<ReleaseNotesSources Include="$(MSBuildThisFileDirectory)docs\releasenotes\$(MajorMinorPatchVersion).md" />
</ItemGroup>

<ReadLinesFromFile File="@(ReleaseNotesSources)" >
<Output TaskParameter="Lines" ItemName="ReleaseNotes"/>
</ReadLinesFromFile>

<PropertyGroup>
<PackageReleaseNotes>@(ReleaseNotes->'%(Identity)', '%0a')</PackageReleaseNotes>
</PropertyGroup>

</Target>
<PropertyGroup>
<GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);SetReleaseNotes</GenerateNuspecDependsOn>
</PropertyGroup>

<Target Name="SetReleaseNotes">

<ItemGroup>
<ReleaseNotesSources Include="$(MSBuildThisFileDirectory)docs\releasenotes\$(MajorMinorPatchVersion).md" />
</ItemGroup>

<ReadLinesFromFile File="@(ReleaseNotesSources)" >
<Output TaskParameter="Lines" ItemName="ReleaseNotes"/>
</ReadLinesFromFile>

<PropertyGroup>
<PackageReleaseNotes>@(ReleaseNotes->'%(Identity)', '%0a')</PackageReleaseNotes>
</PropertyGroup>

</Target>
</Project>
50 changes: 25 additions & 25 deletions Packages.props
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
<Project>
<!--
<!--
https://github.com/Microsoft/MSBuildSdks/tree/master/src/CentralPackageVersions
Centrally managed packages for all projects in the solution
-->
<ItemGroup Label="Source library packages">
<PackageReference Update="Cake.Core" Version="0.30.*" />
<PackageReference Update="LibGit2Sharp" Version="0.25.3" />
<PackageReference Update="LibGit2Sharp.NativeBinaries" Version="1.0.235" />
<PackageReference Update="Newtonsoft.Json" Version="11.0.*" />
<PackageReference Update="Microsoft.Packaging.Tools.Trimming" Version="1.1.0-*" PrivateAssets="All"/>
</ItemGroup>
<ItemGroup Label="Source library packages">
<PackageReference Update="Cake.Core" Version="0.30.*" />
<PackageReference Update="LibGit2Sharp" Version="0.25.3" />
<PackageReference Update="LibGit2Sharp.NativeBinaries" Version="1.0.235" />
<PackageReference Update="Newtonsoft.Json" Version="11.0.*" />
<PackageReference Update="Microsoft.Packaging.Tools.Trimming" Version="1.1.0-*" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup Label="Test library packages">
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.0.*" />
<PackageReference Update="xunit" Version="2.4.*" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.*" />
<PackageReference Update="FluentAssertions" Version="5.6.*" />
<PackageReference Update="GitTools.Testing" Version="1.2.*" />
<PackageReference Update="NSubstitute" Version="4.0.*" />
</ItemGroup>
<ItemGroup Label="Test library packages">
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.0.*" />
<PackageReference Update="xunit" Version="2.4.*" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.*" />
<PackageReference Update="FluentAssertions" Version="5.6.*" />
<PackageReference Update="GitTools.Testing" Version="1.2.*" />
<PackageReference Update="NSubstitute" Version="4.0.*" />
</ItemGroup>

<ItemGroup Label="Global project tooling">
<GlobalPackageReference Include="Microsoft.CodeAnalysis.FXCopAnalyzers" Version="2.9.*" />
<!--<GlobalPackageReference Include="StyleCop.Analyzers" Version="1.1.1-*" />-->
</ItemGroup>
<ItemGroup Label="Test only tooling"
Condition="$(MSBuildProjectName.EndsWith('Tests'))">
<GlobalPackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.*" />
</ItemGroup>
<ItemGroup Label="Global project tooling">
<GlobalPackageReference Include="Microsoft.CodeAnalysis.FXCopAnalyzers" Version="2.9.*" />
<!--<GlobalPackageReference Include="StyleCop.Analyzers" Version="1.1.1-*" />-->
</ItemGroup>

<ItemGroup Label="Test only tooling"
Condition="$(MSBuildProjectName.EndsWith('Tests'))">
<GlobalPackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.*" />
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions SimpleVersion.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ VisualStudioVersion = 16.0.28729.10
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D5992CB5-3542-41C8-BE85-F52699729C57}"
ProjectSection(SolutionItems) = preProject
src\App.props = src\App.props
src\Directory.Build.props = src\Directory.Build.props
EndProjectSection
EndProject
Expand All @@ -19,6 +20,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{9EEF54AE-E
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0F190AA6-731C-425E-894B-F4A63A86200A}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
.simpleversion.json = .simpleversion.json
azure-pipelines.yml = azure-pipelines.yml
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ jobs:
packagesToPush: $(DistDir)/**/*.nupkg
nuGetFeedType: internal
publishVstsFeed: SimpleVersion
feedsToUse: nuget.config
feedsToUse: nuget.config
6 changes: 3 additions & 3 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"msbuild-sdks": {
"Microsoft.Build.CentralPackageVersions": "2.0.26"
}
"msbuild-sdks": {
"Microsoft.Build.CentralPackageVersions": "2.0.26"
}
}
16 changes: 8 additions & 8 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="globalPackagesFolder" value="packages" />
</config>
<packageSources>
<clear />
<add key="Nuget" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
<config>
<add key="globalPackagesFolder" value="packages" />
</config>
<packageSources>
<clear />
<add key="Nuget" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
8 changes: 4 additions & 4 deletions shared/Tests.GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Licensed under the MIT license. See https://kieranties.mit-license.org/ for full license information.
// Licensed under the MIT license. See https://kieranties.mit-license.org/ for full license information.

[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(
"Naming",
"CA1707:Identifiers should not contain underscores",
Justification = "Use underscores for readability in tests")]
"Naming",
"CA1707:Identifiers should not contain underscores",
Justification = "Use underscores for readability in tests")]
Loading

0 comments on commit 8e805ca

Please sign in to comment.