Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
JoC0de committed Dec 14, 2023
1 parent 21e7bf5 commit b18e39d
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</PropertyGroup>

<ItemGroup>
<SourceRoot Include="$(MSBuildThisFileDirectory)/../"/>
<SourceRoot Include="$(MSBuildThisFileDirectory)/../" />
</ItemGroup>

<ItemGroup>
Expand Down
48 changes: 24 additions & 24 deletions src/NuGetForUnity.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,21 @@ private static void FixRoslynAnalyzerImportSettings()
File.WriteAllText(
analyzerDllMetaPath,
$"""
fileFormatVersion: 2
guid: {Guid.NewGuid():N}
labels:
- RoslynAnalyzer
PluginImporter:
platformData:
- first:
: Any
second:
enabled: 0
- first:
Any:
second:
enabled: 0
""",
fileFormatVersion: 2
guid: {Guid.NewGuid():N}
labels:
- RoslynAnalyzer
PluginImporter:
platformData:
- first:
: Any
second:
enabled: 0
- first:
Any:
second:
enabled: 0
""",
utf8NoBom);
}
}
Expand All @@ -142,18 +142,18 @@ private static int PrintUsage()
description.Split(new[] { "\n", "\r\n" }, StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries));
Console.WriteLine(
$"""
Description:
{description}
Description:
{description}
Usage:
nugetforunity restore <PROJECT_PATH> [options]
Usage:
nugetforunity restore <PROJECT_PATH> [options]
Arguments:
<PROJECT_PATH> The path to the Unity project, should be the root path where e.g. the 'ProjectSettings' folder is located. If not specified, the command will use the current directory. [default: {DefaultProjectPath}]
Arguments:
<PROJECT_PATH> The path to the Unity project, should be the root path where e.g. the 'ProjectSettings' folder is located. If not specified, the command will use the current directory. [default: {DefaultProjectPath}]
Options:
-?, -h, --help Show command line help.
""");
Options:
-?, -h, --help Show command line help.
""");
return 1;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/NuGetForUnity.Tests/Assets/Tests/Editor/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# as this is test we are not so strict -> disable most of the warnings

[*.cs]
dotnet_diagnostic.sa1600.severity=none
dotnet_diagnostic.sa1602.severity=none
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma warning disable SA1512,SA1124 // Single-line comments should not be followed by blank line

#if !NUGETFORUNITY_CLI
using JetBrains.Annotations;
#else
Expand Down
2 changes: 1 addition & 1 deletion src/NuGetForUnity/Editor/Helper/AssemblyLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace NugetForUnity.Helper
internal static class AssemblyLoader
{
/// <summary>
/// Loads the assembly for the given <paramref name="pluginId"/>.
/// Loads the assembly for the given <paramref name="pluginId" />.
/// </summary>
/// <param name="pluginId">Plugin Id to load.</param>
/// <returns>Assembly of the loaded plugin.</returns>
Expand Down
34 changes: 23 additions & 11 deletions src/NuGetForUnity/Editor/PluginAPI/NuGetForUnity.PluginAPI.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0"?>

<doc>
<assembly>
<name>NuGetForUnity.PluginAPI</name>
Expand All @@ -9,7 +10,8 @@
Implement this interface to add additional handling for each found installed package.
</summary>
</member>
<member name="M:NugetForUnity.PluginAPI.ExtensionPoints.IFoundInstalledPackageHandler.ProcessInstalledPackage(NugetForUnity.PluginAPI.Models.INugetPackage)">
<member
name="M:NugetForUnity.PluginAPI.ExtensionPoints.IFoundInstalledPackageHandler.ProcessInstalledPackage(NugetForUnity.PluginAPI.Models.INugetPackage)">
<summary>
This will be called for each found installed package in the project.
</summary>
Expand All @@ -20,7 +22,8 @@
Implement this interface to add additional buttons for each package in NugetForUnity window.
</summary>
</member>
<member name="M:NugetForUnity.PluginAPI.ExtensionPoints.IPackageButtonsHandler.DrawButtons(NugetForUnity.PluginAPI.Models.INugetPackage,NugetForUnity.PluginAPI.Models.INugetPackage,System.Boolean)">
<member
name="M:NugetForUnity.PluginAPI.ExtensionPoints.IPackageButtonsHandler.DrawButtons(NugetForUnity.PluginAPI.Models.INugetPackage,NugetForUnity.PluginAPI.Models.INugetPackage,System.Boolean)">
<summary>
This method will be called for each package that is rendered in NugetForUnity window.
</summary>
Expand All @@ -33,7 +36,8 @@
Implement this interface to add additional handling of files being extracted from nupkg during installation.
</summary>
</member>
<member name="M:NugetForUnity.PluginAPI.ExtensionPoints.IPackageInstallFileHandler.HandleFileExtraction(NugetForUnity.PluginAPI.Models.INugetPackage,System.IO.Compression.ZipArchiveEntry,System.String)">
<member
name="M:NugetForUnity.PluginAPI.ExtensionPoints.IPackageInstallFileHandler.HandleFileExtraction(NugetForUnity.PluginAPI.Models.INugetPackage,System.IO.Compression.ZipArchiveEntry,System.String)">
<summary>
This will be called for each entry that is about to be processed from nupkg that is being installed.
</summary>
Expand All @@ -47,7 +51,8 @@
Implement this interface to add additional handling when nupkg is being uninstalled.
</summary>
</member>
<member name="M:NugetForUnity.PluginAPI.ExtensionPoints.IPackageUninstallHandler.HandleUninstall(NugetForUnity.PluginAPI.Models.INugetPackage,NugetForUnity.PluginAPI.PackageUninstallReason)">
<member
name="M:NugetForUnity.PluginAPI.ExtensionPoints.IPackageUninstallHandler.HandleUninstall(NugetForUnity.PluginAPI.Models.INugetPackage,NugetForUnity.PluginAPI.PackageUninstallReason)">
<summary>
This method will be called for each package being uninstalled. Note that uninstall is also done for old version
when package is being updated.
Expand Down Expand Up @@ -90,25 +95,29 @@
Gets the methods that NugetForUnity provides to the plugin, like logging methods.
</summary>
</member>
<member name="M:NugetForUnity.PluginAPI.INugetPluginRegistry.RegisterPackageButtonDrawer(NugetForUnity.PluginAPI.ExtensionPoints.IPackageButtonsHandler)">
<member
name="M:NugetForUnity.PluginAPI.INugetPluginRegistry.RegisterPackageButtonDrawer(NugetForUnity.PluginAPI.ExtensionPoints.IPackageButtonsHandler)">
<summary>
Register a class that will be used to draw additional buttons for each package in NugetForUnity editor window.
</summary>
<param name="packageButtonsHandler">The package buttons handler to register.</param>
</member>
<member name="M:NugetForUnity.PluginAPI.INugetPluginRegistry.RegisterPackageInstallFileHandler(NugetForUnity.PluginAPI.ExtensionPoints.IPackageInstallFileHandler)">
<member
name="M:NugetForUnity.PluginAPI.INugetPluginRegistry.RegisterPackageInstallFileHandler(NugetForUnity.PluginAPI.ExtensionPoints.IPackageInstallFileHandler)">
<summary>
Register a class that will be called for each file that is extracted from the nupkg that is being installed.
</summary>
<param name="packageInstallFileHandler">The file handler to register.</param>
</member>
<member name="M:NugetForUnity.PluginAPI.INugetPluginRegistry.RegisterPackageUninstallHandler(NugetForUnity.PluginAPI.ExtensionPoints.IPackageUninstallHandler)">
<member
name="M:NugetForUnity.PluginAPI.INugetPluginRegistry.RegisterPackageUninstallHandler(NugetForUnity.PluginAPI.ExtensionPoints.IPackageUninstallHandler)">
<summary>
Register a class that will be called when uninstalling some package.
</summary>
<param name="packageUninstallHandler">The package uninstall handler to register.</param>
</member>
<member name="M:NugetForUnity.PluginAPI.INugetPluginRegistry.RegisterFoundInstalledPackageHandler(NugetForUnity.PluginAPI.ExtensionPoints.IFoundInstalledPackageHandler)">
<member
name="M:NugetForUnity.PluginAPI.INugetPluginRegistry.RegisterFoundInstalledPackageHandler(NugetForUnity.PluginAPI.ExtensionPoints.IFoundInstalledPackageHandler)">
<summary>
Register a class that will be called when installed package is found.
</summary>
Expand Down Expand Up @@ -179,7 +188,8 @@
Gets the absolute path to the directory where packages are installed.
</summary>
</member>
<member name="M:NugetForUnity.PluginAPI.Models.INugetPluginService.RegisterNuspecCustomizer(System.Action{NugetForUnity.PluginAPI.Models.INuspecFile})">
<member
name="M:NugetForUnity.PluginAPI.Models.INugetPluginService.RegisterNuspecCustomizer(System.Action{NugetForUnity.PluginAPI.Models.INuspecFile})">
<summary>
Allows plugin to register a function that will modify the contents of default new nuspec file.
</summary>
Expand Down Expand Up @@ -268,13 +278,15 @@
</member>
<member name="P:NugetForUnity.PluginAPI.Models.INuspecFile.Icon">
<summary>
Gets the path to a icon file. The path is relative to the root folder of the package. This is a alternative to using a URL <see cref="P:NugetForUnity.PluginAPI.Models.INuspecFile.IconUrl" />
Gets the path to a icon file. The path is relative to the root folder of the package. This is a alternative to using a URL
<see cref="P:NugetForUnity.PluginAPI.Models.INuspecFile.IconUrl" />
.
</summary>
</member>
<member name="P:NugetForUnity.PluginAPI.Models.INuspecFile.IconFilePath">
<summary>
Gets the full path to a icon file. This is only set if the .nuspec file contains a <see cref="P:NugetForUnity.PluginAPI.Models.INuspecFile.Icon" />. This is a alternative to using a URL
Gets the full path to a icon file. This is only set if the .nuspec file contains a
<see cref="P:NugetForUnity.PluginAPI.Models.INuspecFile.Icon" />. This is a alternative to using a URL
<see cref="P:NugetForUnity.PluginAPI.Models.INuspecFile.IconUrl" />.
</summary>
</member>
Expand Down
7 changes: 3 additions & 4 deletions src/NuGetForUnity/Editor/PluginSupport/PluginRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,20 @@ namespace NugetForUnity.PluginSupport
/// <summary>
/// Plugin Registry loads the plugins and provides methods for calling them.
/// </summary>
internal class PluginRegistry :
INugetPluginRegistry,
internal class PluginRegistry : INugetPluginRegistry,
IPackageButtonsHandler,
IPackageInstallFileHandler,
IPackageUninstallHandler,
IFoundInstalledPackageHandler
{
private readonly List<IFoundInstalledPackageHandler> foundInstalledPackageHandlers = new List<IFoundInstalledPackageHandler>();

private readonly List<IPackageButtonsHandler> packageButtonsHandlers = new List<IPackageButtonsHandler>();

private readonly List<IPackageInstallFileHandler> packageInstallFileHandlers = new List<IPackageInstallFileHandler>();

private readonly List<IPackageUninstallHandler> packageUninstallHandlers = new List<IPackageUninstallHandler>();

private readonly List<IFoundInstalledPackageHandler> foundInstalledPackageHandlers = new List<IFoundInstalledPackageHandler>();

/// <summary>
/// Gets the static instance of PluginRegistry.
/// </summary>
Expand Down
7 changes: 4 additions & 3 deletions src/NuGetForUnity/Editor/TargetFrameworkResolver.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#pragma warning disable SA1512,SA1124 // Single-line comments should not be followed by blank line

#if UNITY_2021_2_OR_NEWER
using UnityEditor.Build;
#endif

using System;
using System.Collections.Generic;
using System.Globalization;
Expand All @@ -9,9 +13,6 @@
using NugetForUnity.Models;
using UnityEditor;
using UnityEngine;
#if UNITY_2021_2_OR_NEWER
using UnityEditor.Build;
#endif

#region No ReShaper

Expand Down

0 comments on commit b18e39d

Please sign in to comment.