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

Update dotfiles #141

Merged
merged 4 commits into from
Mar 18, 2023
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
26 changes: 14 additions & 12 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,25 @@ indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

# C#関連ファイル
[*.{cs,tt,xaml,razor,cshtml,sln}]
charset = utf-8-bom
end_of_line = crlf

# Visual Studio ソリューションファイル
[*.sln]
indent_style = tab

# C# プロジェクトファイル
# C#プロジェクトファイル
# EditorConfigなしだとUTF-8(WPFプロジェクトはBOM付き)のCRLFになる。
[*.csproj]
end_of_line = crlf
indent_size = 2

# PowerShellファイル
[*.{ps1,psd1,psm1}]
charset = utf-8-bom

# XMLファイル
[*.{props,targets,ruleset,config,pubxml}]
indent_size = 2
Expand All @@ -37,21 +48,12 @@ indent_size = 2
[*.md]
trim_trailing_whitespace = false

# C#ファイル
[*.{cs,razor,cshtml}]
charset = utf-8-bom
[*.cs]
end_of_line = crlf

# T4テンプレートファイル
[*.tt]
charset = utf-8-bom
end_of_line = crlf

# C# 生成コード
[{*Generated,**/Generated/**}.cs]
generated_code = true

# Program.cs
# 理由: トップレベルステートメントで誤検知するため。
# https://github.com/dotnet/roslyn-analyzers/issues/6141
[Program.cs]
dotnet_diagnostic.CA1852.severity = none
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
* text=auto eol=lf
*.cs text eol=crlf
*.tt text eol=crlf
*.xaml text eol=crlf
*.razor text eol=crlf
*.cshtml text eol=crlf
*.csproj text eol=crlf
*.sln text eol=crlf
PSScriptAnalyzerSettings.psd1 linguist-vendored
Source/Common/* linguist-vendored
*/wwwroot/* linguist-vendored
17 changes: 0 additions & 17 deletions .github/Version.ps1

This file was deleted.

6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ version: 2
updates:
- package-ecosystem: nuget
directory: /
open-pull-requests-limit: 10
schedule:
interval: daily
labels:
- dependencies
ignore:
- dependency-name: Microsoft.SourceLink.GitHub
- dependency-name: StyleCop.Analyzers

- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
labels:
- dependencies
4 changes: 2 additions & 2 deletions .github/dotfiles.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"hash": "5de0e6786fa7d1b3faf7b1e51247fb11a747a284"
}
"hash": "9ba280023bd46042eaa00534ce57776471a35333"
}
13 changes: 0 additions & 13 deletions .github/pr-labeler.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/release-drafter.yml

This file was deleted.

60 changes: 7 additions & 53 deletions .github/workflows/build-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,20 @@ on:
pull_request:
paths:
- '**/*.cs'
- '**/*.tt'
- '**/*.xaml'
- '**/*.razor'
- '**/*.cshtml'
- '**/*.csproj'
- '**/*.sln'
- '**/Directory.Build.props'
- '**/Directory.Build.targets'
- '**/*.props'
- '**/*.targets'
- '**/.editorconfig'
- '**/.globalconfig'
- .github/workflows/build-dotnet.yml

env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
dotnet-version: '7.0'
permissions: {}

jobs:
test:
name: Test
if: github.event.repository.name != 'dotfiles'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macOS-latest]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Check file
id: check
shell: pwsh
run: Write-Output "::set-output name=dotnet::$(Test-Path *.sln)"

- name: Set DOTNET_INSTALL_DIR
if: steps.check.outputs.dotnet == 'True' && !startswith(matrix.os, 'mac')
shell: pwsh
run: |
$os = '${{ matrix.os }}'
$installDir = $os.StartsWith('windows') ? 'C:/Program Files/dotnet' : '/usr/share/dotnet'
Write-Output "DOTNET_INSTALL_DIR=$installDir" | Out-File $Env:GITHUB_ENV -Encoding utf8 -Append

- name: Setup .NET 7
if: steps.check.outputs.dotnet == 'True'
uses: actions/setup-dotnet@v2
with:
dotnet-version: ${{ env.dotnet-version }}
include-prerelease: true

- name: Setup .NET 6
if: steps.check.outputs.dotnet == 'True' && startswith(matrix.os, 'mac')
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x

- name: .NET Build
if: steps.check.outputs.dotnet == 'True'
run: dotnet build --configuration Release -warnAsError

- name: .NET Test
if: steps.check.outputs.dotnet == 'True'
run: dotnet test --configuration Release --no-build
main:
name: Main
uses: finphie/Actions/.github/workflows/build-dotnet.yml@main
19 changes: 5 additions & 14 deletions .github/workflows/build-markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,10 @@ on:
paths:
- '**/*.md'
- .markdownlint.yml
- .github/workflows/build-markdown.yml

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
permissions: {}

- name: Install markdownlint-cli
run: sudo npm install -g markdownlint-cli

- name: Lint markdown
run: markdownlint '**/*.md'
jobs:
main:
name: Main
uses: finphie/Actions/.github/workflows/build-markdown.yml@main
32 changes: 5 additions & 27 deletions .github/workflows/build-powershell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,10 @@ on:
- '**/*.ps1'
- '**/*.psd1'
- '**/*.psm1'
- .github/workflows/build-powershell.yml

jobs:
lint:
name: Lint
if: github.event.repository.name != 'dotfiles'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Check file
id: check
shell: pwsh
run: |
$files = Get-ChildItem . -Recurse -Name -Include '*.ps1', '*.psd1', '*.psm1' -Exclude PSScriptAnalyzerSettings.psd1
Write-Output $files
Write-Output "::set-output name=powershell::$($files.Length -gt 0)"
permissions: {}

- name: Install PSScriptAnalyzer
if: steps.check.outputs.powershell == 'True'
shell: pwsh
run: Install-Module -Name PSScriptAnalyzer -Force

- name: Lint PowerShell code
if: steps.check.outputs.powershell == 'True'
shell: pwsh
run: Invoke-ScriptAnalyzer . -EnableExit -Recurse
jobs:
main:
name: Main
uses: finphie/Actions/.github/workflows/build-powershell.yml@main
36 changes: 5 additions & 31 deletions .github/workflows/build-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,10 @@ on:
pull_request:
paths:
- '**/*.py'
- .github/workflows/build-python.yml

jobs:
lint:
name: Lint
if: github.event.repository.name != 'dotfiles'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Check file
id: check
shell: pwsh
run: |
$files = Get-ChildItem . -Recurse -Name -Include '*.py'
Write-Output $files
Write-Output "::set-output name=python::$($files.Length -gt 0)"
permissions: {}

- name: Install flake8
if: steps.check.outputs.python == 'True'
run: pip install flake8

- name: Install Pyright
if: steps.check.outputs.python == 'True'
run: sudo npm install -g pyright

- name: Lint Python code
if: steps.check.outputs.python == 'True'
run: |
flake8
pyright
jobs:
main:
name: Main
uses: finphie/Actions/.github/workflows/build-python.yml@main
18 changes: 5 additions & 13 deletions .github/workflows/build-yaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,9 @@ on:
paths:
- '**/*.yml'

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
permissions: {}

- name: Install yamllint
run: pip install yamllint

- name: Lint YAML code
run: yamllint .
jobs:
main:
name: Main
uses: finphie/Actions/.github/workflows/build-yaml.yml@main
Loading