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: 0 additions & 11 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
{
"extraKnownMarketplaces": {
"unicli": {
"source": {
"source": "github",
"repo": "yucchiy/UniCli"
}
}
},
"enabledPlugins": {
"unicli@unicli": true
},
"hooks": {
"PostToolUse": [
{
Expand Down
8 changes: 8 additions & 0 deletions Aspid.FastTools/Assets/DevTests/CliCommands.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Aspid.FastTools/Assets/DevTests/CliCommands/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Aspid.FastTools.DevTests.CliCommands.Editor",
"references": [
"Aspid.FastTools.Unity.Editor",
"Aspid.FastTools.Unity.Editor.SerializeReferences.Yaml",
"Unity.Pipeline"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": false,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using System.Linq;
using Unity.Pipeline.Commands;
using Aspid.FastTools.SerializeReferences.Editors;

// ReSharper disable once CheckNamespace
namespace Aspid.FastTools.DevTests.Editors
{
/// <summary>
/// Dev-only Unity CLI wrapper over the SerializeReference gate scanner: <c>unity command sr_gate</c> returns the
/// violations as structured JSON without a batchmode Editor relaunch, unlike <see cref="SerializeReferenceCiGate"/>.
/// </summary>
internal static class SerializeReferenceGateCommands
{
[CliCommand("sr_gate", "Scan the project for SerializeReference gate violations (missing types / unset Required fields)")]
internal static object Run(
[CliArg("scope", "What to scan: missing | required | full")] string scope = "missing",
[CliArg("warn_only", "Force Warn severity: report but exit code 0")] bool warnOnly = false,
[CliArg("fail", "Force Fail severity: exit code 1 on violations")] bool fail = false)
{
var options = scope?.ToLowerInvariant() switch
{
"missing" => GateOptions.MissingOnly,
"required" => GateOptions.RequiredOnly,
"full" => GateOptions.Full,
_ => default,
};

if (options.Equals(default(GateOptions)))
return new { success = false, error = $"Unknown scope '{scope}'. Use: missing | required | full." };

var severity = SerializeReferenceCiGate.ResolveSeverity(SerializeReferenceSettings.BuildSeverity, warnOnly, fail);
var violations = SerializeReferenceGateScanner.Scan(options);

return new
{
success = true,
scope,
severity = severity.ToString(),
violationCount = violations.Count,
exitCode = SerializeReferenceCiGate.ComputeExitCode(violations.Count, severity),
violations = violations.Select(violation => new
{
kind = violation.Kind.ToString(),
assetPath = violation.AssetPath,
fieldPath = violation.FieldPath,
storedType = violation.StoredType.Class,
fileId = violation.FileId,
rid = violation.Rid,
}).ToArray(),
};
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Aspid.FastTools/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"com.unity.timeline": "1.8.11",
"com.unity.ugui": "2.0.0",
"com.unity.visualscripting": "1.9.10",
"com.yucchiy.unicli-server": "https://github.com/yucchiy/UniCli.git?path=src/UniCli.Unity/Packages/com.yucchiy.unicli-server",
"com.unity.modules.accessibility": "1.0.0",
"com.unity.modules.adaptiveperformance": "1.0.0",
"com.unity.modules.ai": "1.0.0",
Expand Down Expand Up @@ -47,7 +46,8 @@
"com.unity.modules.video": "1.0.0",
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.wind": "1.0.0",
"com.unity.modules.xr": "1.0.0"
"com.unity.modules.xr": "1.0.0",
"com.unity.pipeline": "0.3.1-exp.1"
},
"testables": [
"tech.aspid.fasttools"
Expand Down
21 changes: 14 additions & 7 deletions Aspid.FastTools/Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,20 @@
},
"url": "https://packages.unity.com"
},
"com.unity.pipeline": {
"version": "0.3.1-exp.1",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.test-framework": "1.1.33",
"com.unity.nuget.mono-cecil": "1.11.6",
"com.unity.modules.uielements": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.screencapture": "1.0.0",
"com.unity.nuget.newtonsoft-json": "3.0.2"
},
"url": "https://packages.unity.com"
},
"com.unity.render-pipelines.core": {
"version": "17.4.0",
"depth": 1,
Expand Down Expand Up @@ -225,13 +239,6 @@
},
"url": "https://packages.unity.com"
},
"com.yucchiy.unicli-server": {
"version": "https://github.com/yucchiy/UniCli.git?path=src/UniCli.Unity/Packages/com.yucchiy.unicli-server",
"depth": 0,
"source": "git",
"dependencies": {},
"hash": "be0abbd15c319e1fd6c1843f4d57acbe90eedfce"
},
"tech.aspid.fasttools": {
"version": "file:tech.aspid.fasttools",
"depth": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
[assembly: InternalsVisibleTo(assemblyName: "Aspid.MVVM.StarterKit.Unity.Editor")]
[assembly: InternalsVisibleTo(assemblyName: "Aspid.FastTools.Unity.Editor.Tests")]
[assembly: InternalsVisibleTo(assemblyName: "Aspid.FastTools.Unity.Editor.SerializeReferences.Tests")]
[assembly: InternalsVisibleTo(assemblyName: "Aspid.FastTools.DevTests.CliCommands.Editor")]
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
[assembly: InternalsVisibleTo("Aspid.FastTools.Unity.Editor")]
[assembly: InternalsVisibleTo("Aspid.FastTools.Unity.Editor.SerializeReferences.Tests")]
[assembly: InternalsVisibleTo("Aspid.FastTools.Unity.Editor.Tests")]
[assembly: InternalsVisibleTo("Aspid.FastTools.DevTests.CliCommands.Editor")]
Loading