mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 13:14:17 +01:00
pi: some more manifest validation
This commit is contained in:
parent
68e0ef0b5d
commit
0dbc76f96f
1 changed files with 46 additions and 1 deletions
|
|
@ -80,9 +80,18 @@ internal static class PluginValidator
|
||||||
if (plugin.Manifest.Tags == null || plugin.Manifest.Tags.Count == 0)
|
if (plugin.Manifest.Tags == null || plugin.Manifest.Tags.Count == 0)
|
||||||
problems.Add(new NoTagsProblem());
|
problems.Add(new NoTagsProblem());
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(plugin.Manifest.Description) || plugin.Manifest.Description.Split(LineSeparator, StringSplitOptions.RemoveEmptyEntries).Length <= 2)
|
if (string.IsNullOrEmpty(plugin.Manifest.Description) || plugin.Manifest.Description.Split(LineSeparator, StringSplitOptions.RemoveEmptyEntries).Length <= 1)
|
||||||
problems.Add(new NoDescriptionProblem());
|
problems.Add(new NoDescriptionProblem());
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(plugin.Manifest.Punchline))
|
||||||
|
problems.Add(new NoPunchlineProblem());
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(plugin.Manifest.Name))
|
||||||
|
problems.Add(new NoNameProblem());
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(plugin.Manifest.Author))
|
||||||
|
problems.Add(new NoAuthorProblem());
|
||||||
|
|
||||||
return problems;
|
return problems;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -146,4 +155,40 @@ internal static class PluginValidator
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public string GetLocalizedDescription() => "Your plugin does not have a description in its manifest, or it is very terse. Please consider adding one to give users more information about your plugin.";
|
public string GetLocalizedDescription() => "Your plugin does not have a description in its manifest, or it is very terse. Please consider adding one to give users more information about your plugin.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Representing a problem where a plugin has no punchline in its manifest.
|
||||||
|
/// </summary>
|
||||||
|
public class NoPunchlineProblem : IValidationProblem
|
||||||
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public ValidationSeverity Severity => ValidationSeverity.Information;
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public string GetLocalizedDescription() => "Your plugin does not have a punchline in its manifest. Please consider adding one to give users a quick overview of what your plugin does.";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Representing a problem where a plugin has no name in its manifest.
|
||||||
|
/// </summary>
|
||||||
|
public class NoNameProblem : IValidationProblem
|
||||||
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public ValidationSeverity Severity => ValidationSeverity.Fatal;
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public string GetLocalizedDescription() => "Your plugin does not have a name in its manifest.";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Representing a problem where a plugin has no author in its manifest.
|
||||||
|
/// </summary>
|
||||||
|
public class NoAuthorProblem : IValidationProblem
|
||||||
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public ValidationSeverity Severity => ValidationSeverity.Fatal;
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public string GetLocalizedDescription() => "Your plugin does not have an author in its manifest.";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue