Skip to content
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
11 changes: 8 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ updates:
open-pull-requests-limit: 99
schedule:
interval: daily
cooldown:
default-days: 7
labels:
- dependencies

- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
cooldown:
default-days: 7
labels:
- dependencies
2 changes: 1 addition & 1 deletion .github/dotfiles.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"hash": "1d9452885b956e5279ce6ebc2167c56d0a5fce0c"
"hash": "4ce991898f091323e6219a2d07a302972c2bca8c"
}
1 change: 1 addition & 0 deletions .github/workflows/build-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ jobs:
main:
name: Main
uses: finphie/Actions/.github/workflows/build-dotnet.yml@main
permissions: {}
1 change: 1 addition & 0 deletions .github/workflows/build-markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ jobs:
main:
name: Main
uses: finphie/Actions/.github/workflows/build-markdown.yml@main
permissions: {}
1 change: 1 addition & 0 deletions .github/workflows/build-powershell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ jobs:
main:
name: Main
uses: finphie/Actions/.github/workflows/build-powershell.yml@main
permissions: {}
1 change: 1 addition & 0 deletions .github/workflows/build-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ jobs:
main:
name: Main
uses: finphie/Actions/.github/workflows/build-python.yml@main
permissions: {}
1 change: 1 addition & 0 deletions .github/workflows/build-yaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ jobs:
main:
name: Main
uses: finphie/Actions/.github/workflows/build-yaml.yml@main
permissions: {}
6 changes: 4 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
check:
name: Check
uses: finphie/Actions/.github/workflows/get-version.yml@main
permissions: {}

release:
name: Release
Expand All @@ -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)
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/normalize.yml

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
bin/
obj/
*.user
artifacts/

# MSBuild log
*.binlog
Expand All @@ -21,3 +22,6 @@ Assembly-CSharp*.csproj

# Package File
*.zip

# JavaScript
node_modules/
67 changes: 67 additions & 0 deletions .globalconfig
Original file line number Diff line number Diff line change
@@ -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 の整理
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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

# 式レベルの設定
Expand Down Expand Up @@ -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
# 理由: 内部では識別子に型名を利用したい場合がある。
Expand All @@ -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
# 理由: デフォルトで有効にならない規則。
Expand All @@ -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と重複。
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 14 additions & 1 deletion Build/Common/Exe.props
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
<Project>
<!--
実行ファイル関連の設定
.NET 8以降のみ対応
.NET 10以降のみ対応
このファイルは、プロジェクトファイルの末尾で直接インポートする必要あり。
Directory.Build.propsでインポートした場合、一部のプロパティ設定が機能しない。
-->

<PropertyGroup>
<!-- 発行先ディレクトリにシンボルファイルをコピーしない。 -->
<CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<!--
パッケージのシンボルファイルをコピーする。
https://learn.microsoft.com/dotnet/core/project-sdk/msbuild-props#copydebugsymbolfilesfrompackages
-->
<CopyDebugSymbolFilesFromPackages>true</CopyDebugSymbolFilesFromPackages>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)Exe.Platform.props" />

<Import Condition="'$(IsWinUi)' == 'true'" Project="$(BuildCommonPlatformDirectory)Gui/WinUi.props" />
Expand Down
15 changes: 13 additions & 2 deletions Build/Common/Exe.targets
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
そこで、DebugTypeを使用せずにコピー対象のファイル一覧から削除する。
これにより、リリース先ディレクトリ内にはシンボルファイルが生成されるが、発行先ディレクトリにはコピーされなくなる。

PrepareForPublishターゲットは、パッケージ作成と発行時に実行される。
このファイル自体は、発行対象プロジェクトでのみインポートされる。
.NETツールではシンボルを含めたいため、発行時のみに限定する必要がある
.NETツールではシンボルを含めたいため、発行時のみに限定する必要がある
_IsPublishingは、発行時に発行対象プロジェクトでのみtrueとなるプロパティ。(参照されているプロジェクトでは、発行時でもtrueにならない。)
本来は参照するべきではないプロパティだが、他に良い方法がないため妥協している。
https://github.com/dotnet/sdk/issues/26324
Expand All @@ -35,4 +34,16 @@
</ItemGroup>
</Target>

<!--
発行時、依存パッケージのシンボルファイルをコピー対象ファイルリストから削除する。
これは、ReferenceCopyLocalPathsからシンボルファイルを除外するだけでは削除できないため。
そのため、ResolvedFileToPublishからも除外する処理が必要となる。
-->
<Target Name="_DeletePackageSymbolFiles" AfterTargets="ComputeResolvedFilesToPublishList" Condition="'$(_IsPublishing)' == 'true'">
<ItemGroup>
<FilesToExclude Condition="%('RelativePath'.EndsWith('.pdb')) == 'true'" Include="@(ResolvedFileToPublish)" />
<ResolvedFileToPublish Remove="@(FilesToExclude)" />
</ItemGroup>
</Target>

</Project>
13 changes: 11 additions & 2 deletions Build/Common/Pack/NuGet.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,23 @@
<_BuildFilePathWithoutExtension>$(BuildDirectory)$(MSBuildProjectName)</_BuildFilePathWithoutExtension>
<_BuildPropsFilePath>$(_BuildFilePathWithoutExtension).props</_BuildPropsFilePath>
<_BuildTargetsFilePath>$(_BuildFilePathWithoutExtension).targets</_BuildTargetsFilePath>
<_IsSnupkg Condition="$(MSBuildProjectName.StartsWith('FToolkit'))">false</_IsSnupkg>
</PropertyGroup>

<PropertyGroup>
<!-- パッケージ検証を有効にする。 -->
<EnablePackageValidation>true</EnablePackageValidation>
</PropertyGroup>

<!-- .snupkg有効(デフォルト) -->
<PropertyGroup Condition="'$(_IsSnupkg)' == 'true' or '$(_IsSnupkg)' == ''">
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<!-- パッケージ検証を有効にする。 -->
<EnablePackageValidation>true</EnablePackageValidation>
<!-- .snupkg無効 -->
<PropertyGroup Condition="'$(_IsSnupkg)' == 'false'">
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading
Loading