diff --git a/.editorconfig b/.editorconfig index 1a8151bc..f672364e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,6 +14,11 @@ trim_trailing_whitespace = true charset = utf-8-bom end_of_line = crlf +# リソースファイル +[*.resx] +end_of_line = crlf +indent_size = 2 + # Visual Studio ソリューションファイル [*.sln] indent_style = tab @@ -23,9 +28,9 @@ indent_style = tab end_of_line = crlf indent_size = 2 -# C#プロジェクトファイル -# EditorConfigなしだとUTF-8(WPFプロジェクトはBOM付き)のCRLFになる。 -[*.csproj] +# Visual Studioプロジェクトファイル +# .csprojは、EditorConfigなしだとUTF-8(WPFプロジェクトはBOM付き)のCRLFになる。 +[*.{csproj,esproj}] end_of_line = crlf indent_size = 2 diff --git a/.gitattributes b/.gitattributes index 0b0405fd..b9627cdd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,7 +5,9 @@ *.axaml text eol=crlf *.razor text eol=crlf *.cshtml text eol=crlf +*.resx text eol=crlf *.csproj text eol=crlf +*.esproj text eol=crlf *.sln text eol=crlf *.slnx text eol=crlf PSScriptAnalyzerSettings.psd1 linguist-vendored diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7a9f6596..16359478 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,6 +5,8 @@ updates: open-pull-requests-limit: 99 schedule: interval: daily + cooldown: + default-days: 7 labels: - dependencies @@ -12,5 +14,7 @@ updates: directory: / schedule: interval: daily + cooldown: + default-days: 7 labels: - dependencies diff --git a/.github/dotfiles.json b/.github/dotfiles.json index ea96a369..250d1004 100644 --- a/.github/dotfiles.json +++ b/.github/dotfiles.json @@ -1,3 +1,3 @@ { - "hash": "1d9452885b956e5279ce6ebc2167c56d0a5fce0c" + "hash": "4ce991898f091323e6219a2d07a302972c2bca8c" } diff --git a/.github/workflows/build-dotnet.yml b/.github/workflows/build-dotnet.yml index a9cbe5d6..9bdaecd7 100644 --- a/.github/workflows/build-dotnet.yml +++ b/.github/workflows/build-dotnet.yml @@ -23,3 +23,4 @@ jobs: main: name: Main uses: finphie/Actions/.github/workflows/build-dotnet.yml@main + permissions: {} diff --git a/.github/workflows/build-markdown.yml b/.github/workflows/build-markdown.yml index fb0549a5..791e421e 100644 --- a/.github/workflows/build-markdown.yml +++ b/.github/workflows/build-markdown.yml @@ -12,3 +12,4 @@ jobs: main: name: Main uses: finphie/Actions/.github/workflows/build-markdown.yml@main + permissions: {} diff --git a/.github/workflows/build-powershell.yml b/.github/workflows/build-powershell.yml index beb81c44..4ac995f9 100644 --- a/.github/workflows/build-powershell.yml +++ b/.github/workflows/build-powershell.yml @@ -13,3 +13,4 @@ jobs: main: name: Main uses: finphie/Actions/.github/workflows/build-powershell.yml@main + permissions: {} diff --git a/.github/workflows/build-python.yml b/.github/workflows/build-python.yml index d241e17a..f162c341 100644 --- a/.github/workflows/build-python.yml +++ b/.github/workflows/build-python.yml @@ -11,3 +11,4 @@ jobs: main: name: Main uses: finphie/Actions/.github/workflows/build-python.yml@main + permissions: {} diff --git a/.github/workflows/build-yaml.yml b/.github/workflows/build-yaml.yml index a29778a8..b5ccaaa9 100644 --- a/.github/workflows/build-yaml.yml +++ b/.github/workflows/build-yaml.yml @@ -11,3 +11,4 @@ jobs: main: name: Main uses: finphie/Actions/.github/workflows/build-yaml.yml@main + permissions: {} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e4ddec94..9b00c090 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,6 +12,7 @@ jobs: check: name: Check uses: finphie/Actions/.github/workflows/get-version.yml@main + permissions: {} release: name: Release @@ -35,13 +36,14 @@ jobs: needs: check if: needs.check.outputs.dotnet == 'true' && needs.check.outputs.version != '' uses: finphie/Actions/.github/workflows/deploy-dotnet.yml@main + permissions: {} with: version: ${{ needs.check.outputs.version }} - release: ${{ needs.check.outputs.release == 'true' }} + release: ${{ needs.check.outputs.release == 'true' && !startsWith(github.repository, 'finphie/FToolkit') }} suffix: ${{ needs.check.outputs.tag }} secrets: - AZURE_ARTIFACT_PAT: ${{ secrets.AZURE_ARTIFACT_PAT }} NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + AZURE_ARTIFACT_PAT: ${{ secrets.AZURE_ARTIFACT_PAT }} docker: name: Deploy(Docker) diff --git a/.github/workflows/normalize.yml b/.github/workflows/normalize.yml deleted file mode 100644 index 0642401b..00000000 --- a/.github/workflows/normalize.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Normalize line endings - -on: - pull_request: - -permissions: - contents: write - -jobs: - main: - name: Main - if: github.event.pull_request.user.login == 'dependabot[bot]' - uses: finphie/Actions/.github/workflows/normalize.yml@main diff --git a/.gitignore b/.gitignore index f2a6a869..da568469 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ bin/ obj/ *.user +artifacts/ # MSBuild log *.binlog @@ -21,3 +22,6 @@ Assembly-CSharp*.csproj # Package File *.zip + +# JavaScript +node_modules/ diff --git a/.globalconfig b/.globalconfig index ff7e6bdc..d1e32411 100644 --- a/.globalconfig +++ b/.globalconfig @@ -1,5 +1,15 @@ is_global = true +### .NET コード アクション ### + +# 型メンバー +dotnet_hide_advanced_members = false +dotnet_member_insertion_location = with_other_members_of_the_same_kind +dotnet_property_generation_behavior = prefer_throwing_properties + +# シンボルの検索 +dotnet_search_reference_assemblies = true + ### .NET コーディング規則 ### # using の整理 @@ -43,6 +53,7 @@ dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed dotnet_style_prefer_inferred_anonymous_type_member_names = true dotnet_style_prefer_inferred_tuple_names = true dotnet_style_prefer_is_null_check_over_reference_equality_method = true +dotnet_style_prefer_non_hidden_explicit_cast_in_source = true dotnet_style_prefer_simplified_boolean_expressions = true dotnet_style_prefer_simplified_interpolation = true @@ -89,6 +100,7 @@ csharp_style_prefer_switch_expression = true csharp_style_conditional_delegate_call = true # 修飾子設定 +csharp_prefer_static_anonymous_function = true csharp_prefer_static_local_function = true csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async csharp_style_prefer_readonly_struct = true @@ -97,9 +109,11 @@ csharp_style_prefer_readonly_struct_member = true # コード ブロックの設定 csharp_prefer_braces = true csharp_prefer_simple_using_statement = true +csharp_prefer_system_threading_lock = true csharp_style_namespace_declarations = file_scoped csharp_style_prefer_method_group_conversion = true csharp_style_prefer_primary_constructors = true +csharp_style_prefer_simple_property_accessors = true csharp_style_prefer_top_level_statements = true # 式レベルの設定 @@ -351,6 +365,11 @@ dotnet_diagnostic.CA1040.severity = none # 構造体ではプロパティではなくフィールドにしたい場合がある。 dotnet_code_quality.CA1051.exclude_structs = true +# パブリック メソッドの引数の検証 +# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1062 +# 理由: 拡張メソッドのthisパラメーターは検証しない。 +dotnet_code_quality.CA1062.exclude_extension_method_this_parameter = true + # 識別子には型名を含めないでください # https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1720 # 理由: 内部では識別子に型名を利用したい場合がある。 @@ -367,6 +386,12 @@ dotnet_diagnostic.CA1715.severity = none # 理由: キーワードと重複しても逐語的・エスケープ識別子を使用すれば問題ない。 dotnet_diagnostic.CA1716.severity = none +# スコープを失う前にオブジェクトを破棄 +# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2000 +# 理由: 例外パスでもDisposeを呼び出す必要がある。 +dotnet_code_quality.CA2000.dispose_analysis_kind = AllPaths +dotnet_code_quality.CA2000.excluded_type_names_with_derived_types = T:System.Net.Http.HttpClient|T:System.Net.Http.HttpRequestMessage + # タスクを直接待機しないでください # https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2007 # 理由: デフォルトで有効にならない規則。 @@ -385,6 +410,11 @@ dotnet_diagnostic.CA3009.severity = none ## Microsoft.VisualStudio.Threading.Analyzers ## +# Avoid legacy thread switching methods +# https://microsoft.github.io/vs-threading/analyzers/VSTHRD001.html +# 理由: 不要。 +dotnet_diagnostic.VSTHRD001.severity = none + # Call async methods when in an async method # https://github.com/Microsoft/vs-threading/blob/main/doc/analyzers/VSTHRD103.md # 理由: CA1849と重複。 @@ -971,6 +1001,43 @@ roslynator_blank_line_between_switch_sections = omit # https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2000 dotnet_diagnostic.IDISP001.severity = none +# Dispose member +# https://github.com/DotNetAnalyzers/IDisposableAnalyzers/blob/master/documentation/IDISP002.md +# 理由: CA2213と重複しているが、デフォルトで無効。 +# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2213 +# dotnet_diagnostic.IDISP002.severity = none + +# Don't ignore created IDisposable +# https://github.com/DotNetAnalyzers/IDisposableAnalyzers/blob/master/documentation/IDISP004.md +# 理由: CA2000と重複しておりProcessクラスなどでは診断が出ないが、その他にも誤検知が多い。 +# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2000 +# https://github.com/dotnet/roslyn-analyzers/issues/6688 +dotnet_diagnostic.IDISP004.severity = none + +# Call SuppressFinalize +# https://github.com/DotNetAnalyzers/IDisposableAnalyzers/blob/master/documentation/IDISP018.md +# 理由: CA1816と重複。 +# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1816 +dotnet_diagnostic.IDISP018.severity = none + +# Call SuppressFinalize +# https://github.com/DotNetAnalyzers/IDisposableAnalyzers/blob/master/documentation/IDISP019.md +# 理由: CA1063と重複。 +# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1063 +dotnet_diagnostic.IDISP019.severity = none + +# Call SuppressFinalize(this) +# https://github.com/DotNetAnalyzers/IDisposableAnalyzers/blob/master/documentation/IDISP020.md +# 理由: CA1816と重複。 +# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1816 +dotnet_diagnostic.IDISP020.severity = none + +# Class with no virtual dispose method should be sealed +# https://github.com/DotNetAnalyzers/IDisposableAnalyzers/blob/master/documentation/IDISP025.md +# 理由: CA1063と重複。 +# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1063 +dotnet_diagnostic.IDISP025.severity = none + ## DotNetAnalyzers.DocumentationAnalyzers ## # Render documentation as Markdown. diff --git a/.markdownlint.yml b/.markdownlint.yml index 5b60855f..5fe64b52 100644 --- a/.markdownlint.yml +++ b/.markdownlint.yml @@ -1,4 +1,4 @@ -$schema: "https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json" +$schema: https://raw.githubusercontent.com/DavidAnson/markdownlint/main/schema/markdownlint-config-schema.json heading-style: style: atx diff --git a/.yamllint.yml b/.yamllint.yml index aabda5f0..cabea70d 100644 --- a/.yamllint.yml +++ b/.yamllint.yml @@ -8,5 +8,8 @@ rules: empty-lines: max: 1 line-length: false + quoted-strings: + quote-type: single + required: only-when-needed truthy: check-keys: false diff --git a/Build/Common/Exe.props b/Build/Common/Exe.props index b0e4a1b9..7cced588 100644 --- a/Build/Common/Exe.props +++ b/Build/Common/Exe.props @@ -1,11 +1,24 @@ + + + false + + + + + true + + diff --git a/Build/Common/Exe.targets b/Build/Common/Exe.targets index 0d220b65..92c618ac 100644 --- a/Build/Common/Exe.targets +++ b/Build/Common/Exe.targets @@ -21,9 +21,8 @@ そこで、DebugTypeを使用せずにコピー対象のファイル一覧から削除する。 これにより、リリース先ディレクトリ内にはシンボルファイルが生成されるが、発行先ディレクトリにはコピーされなくなる。 - PrepareForPublishターゲットは、パッケージ作成と発行時に実行される。 このファイル自体は、発行対象プロジェクトでのみインポートされる。 - .NETツールではシンボルを含めたいため、発行時のみに限定する必要がある + .NETツールではシンボルを含めたいため、発行時のみに限定する必要がある。 _IsPublishingは、発行時に発行対象プロジェクトでのみtrueとなるプロパティ。(参照されているプロジェクトでは、発行時でもtrueにならない。) 本来は参照するべきではないプロパティだが、他に良い方法がないため妥協している。 https://github.com/dotnet/sdk/issues/26324 @@ -35,4 +34,16 @@ + + + + + + + + diff --git a/Build/Common/Pack/NuGet.targets b/Build/Common/Pack/NuGet.targets index 93a8a892..16ed0714 100644 --- a/Build/Common/Pack/NuGet.targets +++ b/Build/Common/Pack/NuGet.targets @@ -4,14 +4,23 @@ <_BuildFilePathWithoutExtension>$(BuildDirectory)$(MSBuildProjectName) <_BuildPropsFilePath>$(_BuildFilePathWithoutExtension).props <_BuildTargetsFilePath>$(_BuildFilePathWithoutExtension).targets + <_IsSnupkg Condition="$(MSBuildProjectName.StartsWith('FToolkit'))">false + + true + + + + true snupkg + - - true + + + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb diff --git a/Build/Common/Platform/Gui/Android.props b/Build/Common/Platform/Gui/Android.props index fc0d20e8..ec437dbc 100644 --- a/Build/Common/Platform/Gui/Android.props +++ b/Build/Common/Platform/Gui/Android.props @@ -2,13 +2,13 @@ true - Trimming + + NativeAot + true $(MajorVersion)$(MinorVersion)$(BuildVersion) @@ -16,31 +16,11 @@ 28 + + false + true - - - true - - - - - true - - - true - - - true - - - Full - - - true - - - true diff --git a/Build/Common/Platform/Gui/Avalonia.props b/Build/Common/Platform/Gui/Avalonia.props index 368cecef..b93e0c10 100644 --- a/Build/Common/Platform/Gui/Avalonia.props +++ b/Build/Common/Platform/Gui/Avalonia.props @@ -14,9 +14,6 @@ https://docs.avaloniaui.net/docs/data-binding/compiled-bindings --> true - - - x86-x64-v3 diff --git a/Build/Common/Platform/Gui/Maui.props b/Build/Common/Platform/Gui/Maui.props index 2b3f91c9..1b8d1673 100644 --- a/Build/Common/Platform/Gui/Maui.props +++ b/Build/Common/Platform/Gui/Maui.props @@ -17,6 +17,9 @@ --> true + + SourceGen + true @@ -32,4 +35,13 @@ $(TargetPlatformMinVersion) + + + + + diff --git a/Build/Common/Platform/Gui/WinUi.Shared.props b/Build/Common/Platform/Gui/WinUi.Shared.props index 64997623..8210b0f6 100644 --- a/Build/Common/Platform/Gui/WinUi.Shared.props +++ b/Build/Common/Platform/Gui/WinUi.Shared.props @@ -7,31 +7,45 @@ NativeAot true + false 10.0.19041.0 - - x86-x64-v3 - true + - + + None - + false + + + true + + + + + + + diff --git a/Build/Common/Platform/Resource.props b/Build/Common/Platform/Resource.props new file mode 100644 index 00000000..010c341c --- /dev/null +++ b/Build/Common/Platform/Resource.props @@ -0,0 +1,14 @@ + + + + + + false + + + + + + + + diff --git a/Build/Common/Publish/NativeAot.props b/Build/Common/Publish/NativeAot.props index dc4b3cec..0a9cd6d2 100644 --- a/Build/Common/Publish/NativeAot.props +++ b/Build/Common/Publish/NativeAot.props @@ -11,9 +11,6 @@ true - - false - true diff --git a/Build/Common/Publish/Publish.props b/Build/Common/Publish/Publish.props index 55f21a8a..f1492155 100644 --- a/Build/Common/Publish/Publish.props +++ b/Build/Common/Publish/Publish.props @@ -16,6 +16,7 @@ + @@ -24,6 +25,7 @@ + diff --git a/Build/Common/Publish/SelfContained.False.props b/Build/Common/Publish/SelfContained.False.props new file mode 100644 index 00000000..cd0d9754 --- /dev/null +++ b/Build/Common/Publish/SelfContained.False.props @@ -0,0 +1,9 @@ + + + + + + false + + + diff --git a/Build/Common/Publish/SelfContained.props b/Build/Common/Publish/SelfContained.props new file mode 100644 index 00000000..a44ffa9f --- /dev/null +++ b/Build/Common/Publish/SelfContained.props @@ -0,0 +1,9 @@ + + + + + + true + + + diff --git a/Build/Common/Publish/SingleFile.props b/Build/Common/Publish/SingleFile.props index 76b23621..5ac06b35 100644 --- a/Build/Common/Publish/SingleFile.props +++ b/Build/Common/Publish/SingleFile.props @@ -4,12 +4,9 @@ https://learn.microsoft.com/dotnet/core/deploying/single-file/overview --> - + true - - - true diff --git a/Build/Common/Publish/Trimming.props b/Build/Common/Publish/Trimming.props index 5d6db543..f88da8ac 100644 --- a/Build/Common/Publish/Trimming.props +++ b/Build/Common/Publish/Trimming.props @@ -9,14 +9,14 @@ false - - false - - - true - false + + + true @@ -25,10 +25,21 @@ false + + + + + true true + + false + + + false + false diff --git a/Directory.Build.props b/Directory.Build.props index 4ba5647d..1cfe8aa0 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,6 +2,7 @@ preview + true enable enable true @@ -10,6 +11,12 @@ true + + + true + $(MSBuildThisFileDirectory)artifacts + + true @@ -36,12 +43,8 @@ $([System.String]::Format("{0:D3}", $([System.Version]::Parse("$(Version)").Build))) - - - - - + diff --git a/Directory.Packages.props b/Directory.Packages.props index 40f46032..7bc8145b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -10,8 +10,8 @@ - - + + @@ -22,7 +22,7 @@ - + @@ -36,10 +36,10 @@ - + - - + + diff --git a/Settings.XamlStyler b/Settings.XamlStyler index 06403c1c..c0ff69f6 100644 --- a/Settings.XamlStyler +++ b/Settings.XamlStyler @@ -12,7 +12,7 @@ "EnableAttributeReordering": true, "AttributeOrderingRuleGroups": [ "x:Class", - "xmlns, xmlns:x, xmlns:mc, xmlns:d, xmlns:i, xmlns:ui", + "xmlns, xmlns:x, xmlns:mc, xmlns:d, xmlns:b, xmlns:i, xmlns:ui", "xmlns:*", "x:Key, Key, x:Name, Name, x:Uid, Uid, Title", "Grid.Row, Grid.RowSpan, Grid.Column, Grid.ColumnSpan, Canvas.Left, Canvas.Top, Canvas.Right, Canvas.Bottom", @@ -21,7 +21,9 @@ "*:*, *", "PageSource, PageIndex, Offset, Color, TargetName, Property, Value, StartPoint, EndPoint", "mc:Ignorable, d:DataContext, d:IsDataSource, d:LayoutOverrides, d:IsStaticText, d:DesignWidth, d:DesignHeight", - "Storyboard.*, From, To, Duration" + "Storyboard.*, From, To, Duration", + "Start, End", + "*Command, CommandParameter" ], "FirstLineAttributes": "", "OrderAttributesByName": true, diff --git a/Source/.editorconfig b/Source/.editorconfig index 9db19e7d..88a50302 100644 --- a/Source/.editorconfig +++ b/Source/.editorconfig @@ -1,3 +1,55 @@ +[*.cs] + +## Microsoft.CodeAnalysis.NetAnalyzers ## + +# URI パラメーターを文字列にすることはできません +# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1054 +# 理由: Uri関連の拡張メソッドでは、文字列を使用する場合があるため。 +dotnet_code_quality.CA1054.excluded_type_names_with_derived_types = UriExtensions + +# インスタンス化されていない内部クラスを使用しません +# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1812 +# 理由: Microsoft.Extensions.DependencyInjectionなどで、型をジェネリックとして使用すると誤検知するため。 +# https://github.com/dotnet/roslyn-analyzers/issues/6561 +dotnet_diagnostic.CA1812.severity = none + +[*{Helpers,Extensions,Factory}.cs] + +## Microsoft.CodeAnalysis.NetAnalyzers ## + +# インスタンス化されていない内部クラスを使用しません +# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1812 +# 理由: 有効化したいクラスのため。 +dotnet_diagnostic.CA1812.severity = warning + +[*Extensions.cs] + +## Microsoft.CodeAnalysis.NetAnalyzers ## + +# 入れ子にされた型を参照可能にすることはできません +# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1034 +# 理由: 拡張メンバーで誤検知するため。 +# https://github.com/dotnet/roslyn/issues/78858 +# https://github.com/dotnet/roslyn-analyzers/issues/7734 +dotnet_diagnostic.CA1034.severity = none + +[*{ViewModel,ViewModelBase}.cs] + +## Microsoft.CodeAnalysis.NetAnalyzers ## + +# 識別子は、大文字と小文字の区別以外にも相違していなければなりません +# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1708 +# 理由: CommunityToolkit.Mvvmの仕様。 +# https://github.com/CommunityToolkit/dotnet/issues/1045 +dotnet_diagnostic.CA1708.severity = none + +## IDisposableAnalyzers ## + +# Don't ignore created IDisposable +# https://github.com/DotNetAnalyzers/IDisposableAnalyzers/blob/master/documentation/IDISP003.md +# 理由: IDisposable.AddTo(ref DisposableBuilder)で誤検知するため。 +dotnet_diagnostic.IDISP003.severity = none + # C#ベンチマークファイル(プロジェクト全体) [*.Benchmarks/**.cs] @@ -108,12 +160,3 @@ dotnet_diagnostic.SA1132.severity = none # https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1402.md # 理由: 1ファイルに収めたい場合がある。 dotnet_diagnostic.SA1402.severity = none - -[Program.cs] - -## StyleCop.Analyzers ## - -# The file name of a C# code file does not match the first type declared in the file. -# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1649.md -# 理由: トップレベルステートメントでは、ファイル名と型名が異なる場合がある。 -dotnet_diagnostic.SA1649.severity = none diff --git a/Source/Common/ValidatedNotNullAttribute.cs b/Source/Common/ValidatedNotNullAttribute.cs new file mode 100644 index 00000000..c5e6a962 --- /dev/null +++ b/Source/Common/ValidatedNotNullAttribute.cs @@ -0,0 +1,10 @@ +using System.Diagnostics; + +namespace FToolkit.Analyzers; + +/// +/// メソッドパラメーターがnullではないことを検証済みとマークします。 +/// +[Conditional("VALIDATED_NOT_NULL_KEEP_ATTRIBUTES")] +[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] +sealed class ValidatedNotNullAttribute : Attribute; diff --git a/Source/Directory.Build.props b/Source/Directory.Build.props index cce04861..bb210995 100644 --- a/Source/Directory.Build.props +++ b/Source/Directory.Build.props @@ -1,3 +1,12 @@ + + + + + false + diff --git a/Source/Source.props b/Source/Source.props index a29de993..296a30ab 100644 --- a/Source/Source.props +++ b/Source/Source.props @@ -7,6 +7,9 @@ + + + diff --git a/Tests/Tests.props b/Tests/Tests.props index 1b8fdf2c..3f1698d9 100644 --- a/Tests/Tests.props +++ b/Tests/Tests.props @@ -13,29 +13,12 @@ 理由: テストプロジェクトではドキュメンテーションコメントは必要ない。 --> $(NoWarn);SA0001 - - - true - true - - - true - + diff --git a/global.json b/global.json new file mode 100644 index 00000000..3140116d --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "test": { + "runner": "Microsoft.Testing.Platform" + } +} diff --git a/nuget.config b/nuget.config index 77ad409d..f1f84108 100644 --- a/nuget.config +++ b/nuget.config @@ -16,6 +16,9 @@ + + +