Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Revert "Apply code style"" #12

Merged
merged 1 commit into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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