Skip to content

Commit

Permalink
Merge pull request #12 from s2quake/revert-11-revert-8-style/code-style
Browse files Browse the repository at this point in the history
Revert "Revert "Apply code style""
  • Loading branch information
s2quake authored Jun 15, 2024
2 parents 74f73d0 + 8326af6 commit 0694a64
Show file tree
Hide file tree
Showing 125 changed files with 2,501 additions and 3,421 deletions.
99 changes: 80 additions & 19 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,28 +1,89 @@
[*.{cs,vb}]
# https://editorconfig.org/
root = true

# IDE0060: 사용하지 않는 매개 변수를 제거하세요.
dotnet_code_quality_unused_parameters = non_public:none
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
tab_width = 8
trim_trailing_whitespace = true
max_line_length = 80
indent_style = space
continuation_indent_size = 4
indent_size = 4

# IDE0003: 한정자 제거
dotnet_style_qualification_for_event = false:none
[*.{json,ps1,sh,yaml,yml}]
indent_size = 2
continuation_indent_size = 2

# IDE0003: 한정자 제거
dotnet_style_qualification_for_field = false:none
[*.{csproj,xml}]
indent_size = 2
quote_type = double

# IDE0003: 한정자 제거
dotnet_style_qualification_for_method = false:none
[*.cs]
max_line_length = 100
curly_bracket_next_line = true
spaces_around_operators = true
indent_brace_style = Allman
dotnet_naming_rule.public_members_must_be_capitalized.symbols = public_symbols
dotnet_naming_symbols.public_symbols.applicable_kinds = property,method,field,event,delegate
dotnet_naming_symbols.public_symbols.applicable_accessibilities = public
dotnet_naming_rule.public_members_must_be_capitalized.style = first_word_upper_case_style
dotnet_naming_style.first_word_upper_case_style.capitalization = first_word_upper
dotnet_naming_rule.public_members_must_be_capitalized.severity = warning

# IDE0003: 한정자 제거
dotnet_style_qualification_for_property = false:none
# SA0001: XML comment analysis is disabled due to project configuration
dotnet_diagnostic.SA0001.severity = none

# IDE0059: 불필요한할당
csharp_style_unused_value_assignment_preference = unused_local_variable:suggestion
# SA1101: Prefix local calls with this
dotnet_diagnostic.SA1101.severity = none

# IDE0056: 인덱스 연산자 사용
csharp_style_prefer_index_operator = true:silent
# SA1309: Field names should not begin with underscore
dotnet_diagnostic.SA1309.severity = none

# IDE0032: auto 속성 사용
dotnet_style_prefer_auto_properties = true:suggestion
# SA1600: Elements should be documented
dotnet_diagnostic.SA1600.severity = none

# IDE0057: 범위 연산자 사용
csharp_style_prefer_range_operator = false
# S1133: Deprecated code should be removed
dotnet_diagnostic.S1133.severity = none

# S1125: Boolean literals should not be redundant
dotnet_diagnostic.S1125.severity = none

# S2372: Exceptions should not be thrown from property getters
dotnet_diagnostic.S2372.severity = none

# S3881: "IDisposable" should be implemented correctly
dotnet_diagnostic.S3881.severity = none

# S3971: "GC.SuppressFinalize" should not be called
dotnet_diagnostic.S3971.severity = none

# S4143: Collection elements should not be replaced unconditionally
dotnet_diagnostic.S4143.severity = none

# S6605: Collection-specific "Exists" method should be used instead of the "Any" extension
dotnet_diagnostic.S6605.severity = none

# S6608: Prefer indexing instead of "Enumerable" methods on types implementing "IList"
dotnet_diagnostic.S6608.severity = none

# MEN007: Use a single return
dotnet_diagnostic.MEN007.severity = none

# MEN016: Avoid top-level statements
dotnet_diagnostic.MEN016.severity = none

[*.csproj]
quote_type = double

[*.sln]
indent_style = tab
indent_size = 2

[hooks/*]
indent_size = 2
continuation_indent_size = 2

[stylecop.json]
max_line_length =
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"[csharp]": {
"editor.rulers": [
100
]
},
"files.exclude": {
".vs": true,
"**/bin": true,
Expand Down
26 changes: 26 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,31 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. -->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Import Condition="'$(SolutionDir)' != '' and '$(SolutionDir)' != '$(MSBuildThisFileDirectory)' and $([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../')) != ''" Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />

<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>
runtime; build; native; contentfiles; analyzers
</IncludeAssets>
</PackageReference>
<PackageReference Include="Menees.Analyzers" Version="3.2.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.27.0.93347">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>

<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" />
<AdditionalFiles Include="$(MSBuildThisFileDirectory)Menees.Analyzers.Settings.xml">
<Link>Menees.Analyzers.Settings.xml</Link>
</AdditionalFiles>
</ItemGroup>

<PropertyGroup>
<TargetFrameworks Condition="'$(_IsPacking)'=='true'">net6.0;net7.0;net8.0;netstandard2.1</TargetFrameworks>
<TargetFramework Condition="'$(_IsPacking)'!='true'">net8.0</TargetFramework>
Expand Down Expand Up @@ -51,8 +75,10 @@ SOFTWARE. -->
<PublishGroup>communication</PublishGroup>
<AssemblyOriginatorKeyFile Condition="Exists('$(MSBuildThisFileDirectory).build/public.snk')">$(MSBuildThisFileDirectory).build/public.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<None Include="$(SolutionDir)LICENSE.md" Pack="true" PackagePath="" />
<None Include="$(SolutionDir)README.md" Pack="true" PackagePath="" />
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions Menees.Analyzers.Settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<Menees.Analyzers.Settings>
<MaxLineColumns>100</MaxLineColumns>
<MaxMethodLines>200</MaxMethodLines>
</Menees.Analyzers.Settings>
29 changes: 6 additions & 23 deletions src/JSSoft.Communication.Client/ClientContext.cs
Original file line number Diff line number Diff line change
@@ -1,32 +1,15 @@
// MIT License
//
// Copyright (c) 2024 Jeesu Choi
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// <copyright file="ClientContext.cs" company="JSSoft">
// Copyright (c) 2024 Jeesu Choi. All Rights Reserved.
// Licensed under the MIT License. See LICENSE.md in the project root for license information.
// </copyright>

using System.ComponentModel.Composition;

namespace JSSoft.Communication.ConsoleApp;
namespace JSSoft.Communication.Client;

[Export(typeof(IServiceContext))]
[method: ImportingConstructor]
sealed class ClientContext([ImportMany] IService[] services)
internal sealed class ClientContext([ImportMany] IService[] services)
: Communication.ClientContext(services)
{
}
25 changes: 4 additions & 21 deletions src/JSSoft.Communication.Client/Program.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,7 @@
// MIT License
//
// Copyright (c) 2024 Jeesu Choi
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// <copyright file="Program.cs" company="JSSoft">
// Copyright (c) 2024 Jeesu Choi. All Rights Reserved.
// Licensed under the MIT License. See LICENSE.md in the project root for license information.
// </copyright>

using System;
using JSSoft.Communication.ConsoleApp;
Expand Down
33 changes: 9 additions & 24 deletions src/JSSoft.Communication.Client/Services/DataService.cs
Original file line number Diff line number Diff line change
@@ -1,37 +1,22 @@
// MIT License
//
// Copyright (c) 2024 Jeesu Choi
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// <copyright file="DataService.cs" company="JSSoft">
// Copyright (c) 2024 Jeesu Choi. All Rights Reserved.
// Licensed under the MIT License. See LICENSE.md in the project root for license information.
// </copyright>

using System;
using System.ComponentModel.Composition;
using System.Threading;
using System.Threading.Tasks;
using JSSoft.Communication.Services;

namespace JSSoft.Communication.Services;
namespace JSSoft.Communication.Client.Services;

[Export(typeof(IService))]
[Export(typeof(IDataService))]
sealed class DataService : ClientService<IDataService>, IDataService
internal sealed class DataService : ClientService<IDataService>, IDataService
{
public Task<DateTime> CreateDataBaseAsync(string dataBaseName, CancellationToken cancellationToken)
public Task<DateTime> CreateDataBaseAsync(
string dataBaseName, CancellationToken cancellationToken)
{
return Server.CreateDataBaseAsync(dataBaseName, cancellationToken);
}
Expand Down
Loading

0 comments on commit 0694a64

Please sign in to comment.