Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8e252ac
dotnet format
juner May 26, 2026
6239b67
feat(generator): add FG0011 partial method constraint
juner May 26, 2026
44f36fa
dotnet format
juner May 26, 2026
f35dd67
docs: add diagnostic rule descriptions for Funge generator
juner May 26, 2026
87fc8aa
docs: add rule links to Funge README
juner May 26, 2026
a6490fd
build: include Rules/*.md in nuget package
juner May 26, 2026
097e112
refactor(funge-interpreter): convert to top-level statements and add …
juner May 26, 2026
4fa3524
fix(funge-interpreter): restore original test and add entrypoint test
juner May 26, 2026
467182c
fix(funge-interpreter): update tests to use static Run helper
juner May 26, 2026
3823955
fix(funge-interpreter): restore original test cases with Run helper
juner May 26, 2026
28d0c5a
fix(funge-interpreter): restore full test suite and format
juner May 26, 2026
42ed0a9
test: update help option exit code expectation to 0
juner May 26, 2026
ba6d65f
csproj の整理
juner May 28, 2026
4368c1b
Esolang.Abstractions を持ってきて対応の準備を行う
juner May 30, 2026
0fa59b7
feat(generator): integrate Esolang.Generator.Abstractions for method …
juner May 30, 2026
aecd9a2
実装途中
juner May 31, 2026
967f19b
refactor(processor): migrate FungeProcessor to event-based I/O
juner Jun 1, 2026
5eaea98
Esolang.Abstractions update
juner Jun 1, 2026
1f3b33b
Refactor: Remove obsolete method input/output/return kind enums and s…
juner Jun 3, 2026
0c84f1d
feat(interpreter): add --source/--path CLI inputs
juner Jun 3, 2026
51a9679
ci: align interpreter workflow with piet
juner Jun 3, 2026
2dfa336
docs: align generator releases and changelog
juner Jun 3, 2026
2b71f60
docs: remove redundant 'Added' section from unreleased changelog
juner Jun 3, 2026
ad3031b
fix: correct Tool E2E tests (remove Piet-specific hello-world.png and…
juner Jun 4, 2026
e20f36c
fix: restructure release.yml to AOT matrix pattern (align with Piet/B…
juner Jun 4, 2026
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
81 changes: 77 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ dotnet_style_parentheses_in_other_operators = never_if_unnecessary:warning
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning

# Accessibility modifier settings
dotnet_style_require_accessibility_modifiers = for_non_interface_members

# Expression-level preferences
dotnet_style_coalesce_expression = true:warning
Expand Down Expand Up @@ -236,7 +235,81 @@ dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_property = false:warning
dotnet_style_qualification_for_method = false:warning
dotnet_style_qualification_for_event = false:warning
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning
# 関係演算子の優先順位が明確な場合は、かっこを使用しない
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:warning
# 関係演算子の優先順位が明確な場合は、かっこを使用しない
dotnet_style_parentheses_in_other_binary_operators = never_if_unnecessary:warning
# 関係演算子の優先順位が明確な場合は、かっこを使用しない
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:warning
# 算術演算子の優先順位が明確な場合はかっこを使用しない
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:warning
# IEnumerable<int> list = new List<int>() { 1, 2 };など、型が緩やかに一致する場合でもコレクション式を使用することを好みます。 対象となる型は、右側の型と一致するか、IEnumerable<T>、ICollection<T>、IList<T>、IReadOnlyCollection<T>、IReadOnlyList<T>のいずれかの型である必要があります。
dotnet_style_prefer_collection_expression = when_types_loosely_match:warning
# 不要な using ディレクティブを削除する (IDE0005)
dotnet_diagnostic.IDE0005.severity = warning
# is 式と型キャストの代わりにパターン マッチングを使用します。
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
# 既定の修飾子である場合を除き、アクセシビリティ修飾子を優先します。
dotnet_style_require_accessibility_modifiers = omit_if_default:warning
# 未使用のプライベート メンバーを削除する (IDE0051)
dotnet_diagnostic.IDE0051.severity = warning

#region
# CA2012: ValueTask を正しく使用する必要があります
dotnet_diagnostic.CA2012.severity = warning
# CA2016: CancellationToken パラメーターを受け取るメソッドに渡す
dotnet_diagnostic.CA2016.severity = warning
# CA2200: スタックの詳細を保持するために再スローします。
dotnet_diagnostic.CA2200.severity = warning
# CA2217: 列挙型に FlagsAttributeを付与しないでください。
dotnet_diagnostic.CA2217.severity = warning
#endregion

#region MSTest Analyzers

# MSTEST0017: アサーション引数は正しい順序で渡す必要があります
dotnet_diagnostic.MSTEST0017.severity = warning
# MSTEST0020: TestInitialize メソッドよりもコンストラクターを優先する
dotnet_diagnostic.MSTEST0020.severity = warning
# MSTEST0021: TestCleanup メソッドよりも Dispose を優先する
dotnet_diagnostic.MSTEST0021.severity = warning
# MSTEST0022: Dispose メソッドよりも TestCleanup を優先する
dotnet_diagnostic.MSTEST0022.severity = warning
# MSTEST0023: ブール アサーションを否定しないこと
dotnet_diagnostic.MSTEST0023.severity = warning
# MSTEST0024: TestContext を静的メンバーに格納しない
dotnet_diagnostic.MSTEST0024.severity = warning
# MSTEST0025: 常に失敗するアサートではなく 'Assert.Fail' を使う
dotnet_diagnostic.MSTEST0025.severity = warning
# MSTEST0026: アサーションでの条件付きアクセスを回避する
dotnet_diagnostic.MSTEST0026.severity = warning
# MSTEST0029: パブリック メソッドをテスト メソッドにする必要がある
dotnet_diagnostic.MSTEST0029.severity = warning
# MSTEST0032: 条件が常に真であることがわかっているため、アサーションを確認するか削除してください
dotnet_diagnostic.MSTEST0032.severity = warning
# MSTEST0036: テスト クラス内でシャドウイングを使用しない
dotnet_diagnostic.MSTEST0036.severity = warning
# MSTEST0037: 適切な 'Assert' メソッドを使用する
dotnet_diagnostic.MSTEST0037.severity = warning
# MSTEST0038: 値型では 'Assert.AreSame' または 'Assert.AreNotSame' を使用しない
dotnet_diagnostic.MSTEST0038.severity = warning
# MSTEST0040: 'async void' コンテキスト内でアサートしない
dotnet_diagnostic.MSTEST0040.severity = warning
# MSTEST0044: DataTestMethod よりも TestMethod を優先する
dotnet_diagnostic.MSTEST0044.severity = warning
# MSTEST0045: タイムアウトに協調キャンセルを使用する
dotnet_diagnostic.MSTEST0045.severity = warning
# MSTEST0046: StringAssertではなくAssertを使います
dotnet_diagnostic.MSTEST0046.severity = warning
# MSTEST0049: Flow TestContext キャンセル トークンを使用する
dotnet_diagnostic.MSTEST0049.severity = warning
# MSTEST0051: Assert.Throws には 1 つのステートメントのみを含める必要があります
dotnet_diagnostic.MSTEST0051.severity = warning
# MSTEST0054: TestContext.CancellationToken からのキャンセル トークンを使用する
dotnet_diagnostic.MSTEST0054.severity = warning
# MSTEST0058: catch ブロック内の assert を避ける
dotnet_diagnostic.MSTEST0058.severity = warning
# MSTEST0061: ランタイム チェックの代わりに OSCondition 属性を使用する
dotnet_diagnostic.MSTEST0061.severity = warning

#endregion
61 changes: 61 additions & 0 deletions .github/workflows/aot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: native-aot-ci

on:
push:
branches: [ main ]
paths:
- 'Interpreter/**'
- 'Processor/**'
- '.github/workflows/aot.yml'
pull_request:
branches: [ main ]
paths:
- 'Interpreter/**'
- 'Processor/**'

env:
DOTNET_VERSION: '10.0.x'
PROJECT_PATH: 'Interpreter/Esolang.Funge.Interpreter.csproj'

jobs:
build:
name: build-aot-${{ matrix.rid }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
rid: win-x64
- os: ubuntu-latest
rid: linux-x64
- os: macos-latest
rid: osx-x64
- os: macos-latest
rid: osx-arm64
- os: ubuntu-latest
rid: any

steps:
- uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install dependencies (Linux)
if: runner.os == 'Linux' && matrix.rid != 'any'
run: |
sudo apt-get update
sudo apt-get install -y clang zlib1g-dev

- name: Pack
run: |
dotnet pack ${{ env.PROJECT_PATH }} -r ${{ matrix.rid }} -c Release -o artifacts/

- name: Upload Artifact (CI)
uses: actions/upload-artifact@v7
with:
name: nupkg-ci-${{ matrix.rid }}
path: artifacts/*
retention-days: 1
167 changes: 100 additions & 67 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,82 +3,115 @@ name: build and test
on:
push:
pull_request:
branches: [ master ]
branches: [ main ]
paths:
- '**.cs'
- '**.csproj'
- '**.slnx'
- '.github/workflows/**'
- '**.cs'
- '**.csproj'
- '**.slnx'
- '**.props'
- '**.targets'
- 'global.json'
- '.github/workflows/**'

env:
DOTNET_VERSION: '10.0.x'
NUGET_SOURCE: 'https://api.nuget.org/v3/index.json'

jobs:
build-and-test:

name: build-and-test-${{matrix.os}}
name: build-and-test-${{ matrix.rid }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
include:
- os: ubuntu-latest
rid: linux-x64
- os: windows-latest
rid: win-x64
- os: macOS-latest
rid: osx-arm64

steps:
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install dependencies
run: dotnet restore --source "${{ env.NUGET_SOURCE }}"

- name: Build
run: dotnet build --no-restore

- name: Test
run: dotnet test --no-restore --verbosity normal

- name: Tool E2E (pack/install/run)
if: ${{ matrix.os == 'ubuntu-latest' }}
shell: bash
run: |
set -euo pipefail
rm -rf .artifacts/tool-e2e
mkdir -p .artifacts/tool-e2e

dotnet pack Interpreter/Esolang.Funge.Interpreter.csproj -o .artifacts/tool-e2e

nupkg_path=$(find .artifacts/tool-e2e -maxdepth 1 -type f -name 'dotnet-funge.*.nupkg' | head -n 1)
if [ -z "$nupkg_path" ]; then
echo "Failed to find dotnet-funge nupkg in .artifacts/tool-e2e"
exit 1
fi
nupkg_name=$(basename "$nupkg_path")
tool_version=${nupkg_name#dotnet-funge.}
tool_version=${tool_version%.nupkg}
echo "Detected tool version: $tool_version"

dotnet tool install dotnet-funge \
--tool-path .artifacts/tool-e2e/path \
--add-source .artifacts/tool-e2e \
--version "$tool_version"

./.artifacts/tool-e2e/path/dotnet-funge --help

output=$(./.artifacts/tool-e2e/path/dotnet-funge "samples/Generator.UseConsole/Programs/hello.b98")
echo "$output"
test "$output" = "Hello, World!"

dotnet tool uninstall dotnet-funge --tool-path .artifacts/tool-e2e/path

- name: Pack
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
dotnet pack -o artifacts/

- uses: actions/upload-artifact@v4
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
name: artifacts
path: artifacts
- uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y clang zlib1g-dev

- name: Restore
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Test
run: dotnet test --no-build --verbosity normal

- name: Tool E2E (pack/install/run)
shell: bash
run: |
set -euo pipefail
rid="${{ matrix.rid }}"
rm -rf .artifacts/tool-e2e
mkdir -p .artifacts/tool-e2e

dotnet pack Interpreter/Esolang.Funge.Interpreter.csproj -r "$rid" -p:ToolPackageRuntimeIdentifiers= -o .artifacts/tool-e2e

nupkg_path=$(find .artifacts/tool-e2e -maxdepth 1 -type f -name "dotnet-funge.*.nupkg" ! -name "*.snupkg" | head -n 1)
if [ -z "$nupkg_path" ]; then
echo "Failed to find dotnet-funge nupkg in .artifacts/tool-e2e"
exit 1
fi
nupkg_name=$(basename "$nupkg_path")
tool_version=${nupkg_name#dotnet-funge.}
tool_version=${tool_version%.nupkg}
echo "Detected tool version: $tool_version"

dotnet new tool-manifest --force
dotnet tool install dotnet-funge \
--add-source .artifacts/tool-e2e \
--version "$tool_version"

dotnet tool run dotnet-funge -- --help

# hello.b98 ファイルで実行 → "Hello, World!" を検証
output1=$(dotnet tool run dotnet-funge -- --path samples/Generator.UseConsole/Programs/hello.b98)
echo "$output1"
test "$output1" = "Hello, World!"

# inline funge テキストで実行
output2=$(dotnet tool run dotnet-funge -- --source "64+\"!dlroW ,olleH\">:#,_@")
echo "$output2"
test "$output2" = "Hello, World!"

# 改行を含む inline funge テキストで実行
inline_source=$(cat <<'EOF'
v
>25*"!dlroW ,olleH",,,,@
EOF
)
output3=$(dotnet tool run dotnet-funge -- --source "$inline_source")
echo "$output3"

dotnet tool uninstall dotnet-funge

- name: Pack
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
dotnet pack Generator/Esolang.Funge.Generator.csproj -o artifacts/
dotnet pack Parser/Esolang.Funge.Parser.csproj -o artifacts/
dotnet pack Processor/Esolang.Funge.Processor.csproj -o artifacts/
dotnet pack Interpreter/Esolang.Funge.Interpreter.csproj -p:ToolPackageRuntimeIdentifiers= -o artifacts/
dotnet pack Interpreter/Esolang.Funge.Interpreter.csproj -p:PublishAot=false -p:ToolPackageRuntimeIdentifiers="" -o artifacts/

- uses: actions/upload-artifact@v7
if: ${{ matrix.os == 'ubuntu-latest' }}
with:
name: artifacts
path: artifacts/
Loading
Loading