Git Product home page Git Product logo

package-validator's Introduction

Chocolatey Package Validator

Validates the contents of a package against the package review process parts that can be validated by a machine. See https://docs.chocolatey.org/en-us/community-repository/moderation/ for more details.

The validator is a service that checks the quality of a package based on requirements, guidelines and suggestions for creating packages for Chocolatey’s community feed. We like to think of the validator as unit testing. It is validating that everything is as it should be and meets the minimum requirements for a package on the community feed.

What does the validator check? See the docs for more information.

Chat Room

Want quick feedback to your questions? Gitter

Requirements

  • .NET Framework 4.0

License / Credits

Apache 2.0 - see LICENSE and NOTICE files.

Contributing

If you would like to contribute code or help squash a bug or two, that's awesome. Please familiarize yourself with CONTRIBUTING.

Committers

Committers, you should be very familiar with COMMITTERS.

Compiling / Building Source

There is a build.bat/build.sh file that creates a necessary generated file named SolutionVersion.cs. It must be run at least once before Visual Studio will build.

Windows

Prerequisites:

  • .NET Framework 4.5+
  • Visual Studio is helpful for working on source.
  • ReSharper is immensely helpful (and there is a .sln.DotSettings file to help with code conventions).

Build Process:

  • Run build.bat.

Running the build on Windows should produce an artifact that is tested and ready to be used. It will also produce a Chocolatey package which requires licensed components to use. To use it ensure you are running a currently licensed version of Chocolatey For Business.

Setup

You need the following installed on a machine that you will use the validator with:

  • .NET Framework 4.5.
  • Install the service and let it run.

package-validator's People

Contributors

admiringworm avatar ferventcoder avatar gep13 avatar mkevenaar avatar pauby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

package-validator's Issues

Add All Required Rules

These are taken in part from here:

https://github.com/chocolatey/choco/wiki/Moderation

The following is a list of rules that need to be added, and these will be updated as they are implemented. New rules can be added here as they are thought of.

Requirements

  • Copyright Word Count Minimum
  • Description
  • Install Automation Script Named Correctly
  • License Url Missing When License Acceptance True
  • Package Internal Files Are Not Packaged
  • Portable Package Scripts Do Not Use Program Files
  • Project Url
  • Scripts Do Not Contain Choco Commands
  • Scripts Do Not Contain Internal Variables
  • Source Control Internal Files Are Not Packaged
  • Tags Are Spaced Separated
  • Tags Do Not Contain Chocolatey
  • Uninstall Automation Script Named Correctly
  • Install and Uninstall Scripts work with PowerShell V2, see #1
  • Templated Comments have been removed
  • UTF-8 Encoding is being used
  • Correct BOM at start of file - NOTE - not a fan of this one, we actually want this to be UTF-8 w/out BOM

Guidelines

  • Description Word Count Minimum 30
  • License Url Does Not Match Project Url
  • License Url Missing
  • Package Source Url Missing
  • Project source Url Does Not Match Project Url
  • Project Source Url Missing
  • Summary Not Empty
  • Tags Not Empty
  • Title Not Empty
  • Title Not Same As Package Id
  • Does the download include both x86 and x64 urls if available? - see #17
  • Icon Url Missing
  • Release Notes Not Empty
  • Write-ChocolateySuccess / Write-ChocolateyFailure
  • request admin tag if it calls Install-ChocolateyPackage (or uses another admin script)

Suggestions

  • Bug Tracker Url Missing
  • Docs Url Missing
  • Mailing List Url Missing
  • With Get-BinRoot, ask if the user should move to a simpler approach

Notes

  • Binaries are included
  • Package Id Uses Dots
  • Author Field Is Not Used For Maintainer

Things that require more thought

  • check package name - flag if first version based on the naming convention (doesn't matter if prerelease or not)
  • suggest the name split if over 25 chars with no -
  • flag on "."" in name (unless .portable/.install)

Things that can't be automated - These have now been covered in the moderation instructions https://github.com/chocolatey/choco/wiki/Moderation

  • Verify description contains Trial information, when required
  • Trial software should include #trial tag
  • Licensed software should include #license
  • Does the download version match the package version?
  • Does the package try to do anything that an existing Chocolatey function already covers? The maintainers would need a really good reason for diverging from that.
  • Not a package duplicating another existing package

Implements https://github.com/chocolatey/chocolatey.org/issues/181

Guideline: Check for copying to program files and flag

Nothing should have a need to copy to program files without a really good reason. The native installer should make the changes required.

However if someone is just deciding that is where their portable application goes, that is an anti-pattern.

Create docs with more information for selected rules

When a rule that requires more explanation fails, we can point to it to give folks more information on why it failed, what's wrong with what they are doing and how they can fix it up.

I'd like this for first release as well, I think it will help if folks have a place to go to understand why certain things are flagged and why they are required to be changed. That means it is less likely that they will use the contact administrators.

And as we expand on things, information for folks is automatically updated without requiring a new release of the validator.

Note: "WScript."

We need to followup to see what the user is attempting to do.

Combine docsUrl, mailingListUrl, bugTrackerUrl into one check

If a user has implemented at least one of these, then they probably know about all of them. No reason for there to be 3 checks.

  • docsUrl
  • mailingListUrl
  • bugTrackerUrl

Maybe also include projectSourceUrl in this one check. packageSourceUrl is a guideline so it should continue to remain separate.

Wiki Contributions

I’ve noticed that almost all of the wiki pages are empty stubs at this point. I also noticed that editing for the package validator wiki is disabled. Is it possible to set up a separate wiki repo like this one? If one is set up, I might be interested in supplying some preliminary documentation for the validator messages. Thanks!

Note: Chocolatey Dependency

Unless a package needs a specific version of Chocolatey in order to function, a dependency on the Chocolatey Package is not required.

Add this as a note so that a human can verify.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.