Download the PHP package stolt/lean-package-validator without Composer

On this page you can find all versions of the php package stolt/lean-package-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lean-package-validator

Lean package validator

Test Status Version PHP Version composer.lock available PDS Skeleton

The lean package validator is a utility tool that validates a project/micro-package for its leanness. A project/micro-package is considered lean when its common repository artifacts won't be included in release assets.

Installation

The lean package validator CLI should be installed globally through Composer.

Make sure that the path to your global vendor binaries directory is in your $PATH. You can determine the location of your global vendor binaries directory via composer global config bin-dir --absolute. This way the lean-package-validator executable can be located.

Since the default name of the CLI is quite a mouthful, an alias which can be placed in ~/.aliases, ~/.zshrc or the like might come in handy. The alias shown next assumes that $COMPOSER_HOME is ~/.config/composer and not ~/.composer.

The lean package validator also can be installed locally to a project which allows further utilisation via Composer scripts.

[!TIP] As of release v1.9.0 it's also possible to install and use the lean package validator via a PHAR file.

Therefor download a released version e.g. v3.3.1 and move it to /usr/local/bin as shown next.

Usage

Run the lean package validator CLI within or against a project/micro-package directory, and it will validate the export-ignore entries present in a .gitattributes file against a set of common repository artifacts. If no .gitattributes file is present it will suggest to create one.

Available options

The --enforce-strict-order option will enforce a strict order comparison of export-ignores in the .gitattributes file and fail validation if the order differs. Per default the order comparison is done in a non-strict fashion.

The --create|-c option creates an .gitattributes file if nonexistent.

The --overwrite|-o option overwrites an existing .gitattributes file when there are any export-ignore entries missing. Using this option on a directory with a nonexistent .gitattributes file implicates the --create option.

The --glob-pattern option allows you to overwrite the default pattern used to match common repository artifacts. The amount of pattern in the grouping braces is expected to be >1. As shown next this utility could thereby also be used for projects (i.e. Python) outside the PHP ecosystem.

The default pattern is defined in the PHP preset file.

The --glob-pattern-file option allows you to load patterns, which should be used to match the common repository artifacts, from a given file. You can put a .lpv file in the repository which will be used per default and overwrite the default pattern. The structure of such a glob pattern file can be taken from the example directory or be created via lean-package-validator init.

The --keep-license option will allow a license file in the release/dist archive file which is per default ommitted.

The --align-export-ignores|-a option will align the created or overwritten export-ignores for a better readability.

The --enforce-alignment option will enforce a strict alignment of export-ignores in the .gitattributes file and fail validation if they aren't aligned. Per default no alignment is enforced.

The --validate-git-archive option will validate that no common repository artifacts slip into the release/dist archive file. It will do so by creating a temporary archive from the current Git HEAD and inspecting its content. With a set --keep-license option a license file becomes mandatory and will fail the archive validation if not present.

The --diff option will show a visual diff between the actual and expected .gitattributes content.

The --report-stale-export-ignores option extends the validation to look for export-ignore statements referencing non-existent repository artifacts. In combination with the --diff option these will be shown in the output.

Additional commands

The init command will create an initial .lpv file with the default patterns used to match common repository artifacts.

The --overwrite|-o option overwrites an existing .lpv file.

The --preset option allows to choose from a predefined set of glob pattern. Available presets are PHP, Python, and Go. With PHP being the default.

Utilisation via Composer scripts or it's dedicated GitHub Action

To avoid that changes coming from contributions or own modifications slip into release/dist archives it might be helpful to use a guarding Composer script, which will be available at everyone's fingertips.

By adding the following to the project/micro-package its composer.json the .gitattributes file can now be easily validated via composer validate-gitattributes.

For utilising a dedicated GitHub Action have a look at the documentation over here.

Running tests

License

This library and its CLI are licensed under the MIT license. Please see LICENSE.md for more details.

Changelog

Please see CHANGELOG.md for more details.

Contributing

Please see CONTRIBUTING.md for more details.


All versions of lean-package-validator with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
laminas/laminas-stdlib Version ^3.7
sebastian/diff Version ^5.0||^4.0.3
symfony/console Version ^7.0.6||^v5.4.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package stolt/lean-package-validator contains the following files

Loading the files please wait ....