Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

Commit

Permalink
(GH-43) Use Svg or Png for icons
Browse files Browse the repository at this point in the history
  • Loading branch information
gep13 committed Dec 5, 2015
1 parent 6891e67 commit 629b1ab
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
Expand Up @@ -163,6 +163,7 @@
<Compile Include="infrastructure.app\rules\TitleNotEmptyGuideline.cs" />
<Compile Include="infrastructure.app\rules\TitleNotSameAsPackageIdGuideline.cs" />
<Compile Include="infrastructure.app\rules\UninstallAutomationScriptNamedCorrectlyRequirement.cs" />
<Compile Include="infrastructure.app\rules\UsePngOrSvgForIconSuggestion.cs" />
<Compile Include="infrastructure.app\services\IPackageValidationService.cs" />
<Compile Include="infrastructure.app\services\PackageValidationService.cs" />
<Compile Include="infrastructure.app\tasks\PrepareValidationResultsTask.cs" />
Expand Down
@@ -0,0 +1,36 @@
// Copyright © 2015 - Present RealDimensions Software, LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
//
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace chocolatey.package.validator.infrastructure.app.rules
{
using NuGet;
using infrastructure.rules;

public class UsePngOrSvgForIconSuggestion : BasePackageRule
{
public override string ValidationFailureMessage
{
get
{
return "As per the [packaging guidelines]() icons should be either a png or svg file. Please see [here](https://github.com/chocolatey/package-validator/wiki/UsePngOrSvgForPackageIcons) for further information and guidance.";
}
}

protected override PackageValidationOutput is_valid(IPackage package)
{
return package.IconUrl.ToString().EndsWith(".png") || package.IconUrl.ToString().EndsWith(".svg");
}
}
}

0 comments on commit 629b1ab

Please sign in to comment.