Download the PHP package lform/pretty-code without Composer

On this page you can find all versions of the php package lform/pretty-code. 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 pretty-code

Pretty Code

Pretty Code enforces consistent code formatting across all your projects automatically on commit. It provides a single source of truth for Prettier and Laravel Pint configurations, designed for Roots Bedrock + Sage and Statamic projects.

Table of Contents

  1. Requirements
  2. Installation & Setup
  3. Commands
  4. Updating
  5. PHP Formatting
  6. Supported File Types
  7. Configuration Files
  8. Customization per Project
  9. Troubleshooting
  10. Uninstalling

Requirements

Installation & Setup

Installation

After installing, the package prints a reminder to run the init command.

Initialization

Run the init command to scaffold the project. It copies the following config files to the project root, configures git hooks, and adds pretty:format, pretty:format:prettier, pretty:format:pint, and pretty:check scripts to package.json:

Existing config files are overwritten — use git diff to review changes before committing. Pass --suggest to write new configs as suggestion files alongside your existing ones instead. In --suggest mode, Pretty Code does not update your git hooks path or rewrite package.json scripts:

This writes:

Commands

Updating

When a new version of Pretty Code is released, update the package then run:

This overwrites your config files with the latest package versions. Use git diff to review and selectively revert any changes you want to keep. Pass --suggest to write updated configs as .suggestions.* files instead:

PHP Formatting

Laravel Pint (recommended)

Laravel Pint is the recommended PHP formatter and is included by default in both Roots Bedrock + Sage and Statamic — no separate install needed for those projects. The pint.json config file is copied to your project root during init.

PHP CS Fixer (alternative)

For projects that cannot use Laravel Pint, a .php-cs-fixer.php baseline configuration is included in the package as a reference. To use it:

  1. Install PHP CS Fixer:

  2. Copy the baseline config to your project root:

  3. Update .lintstagedrc.json to replace the Pint rule with PHP CS Fixer:

  4. Update the pretty:format:pint script in package.json:

Supported File Types

Extension Tool
php Pint
blade.php Prettier
antlers.html, antlers.php Prettier
js, jsx, ts, tsx Prettier
css, scss, pcss Prettier
html, htm Prettier
json Prettier
yaml, yml Prettier

Configuration Files

File Description
.prettierrc.json Prettier configuration
.prettierignore Files excluded from Prettier
.lintstagedrc.json Pre-commit hook rules
.editorconfig Editor-wide formatting defaults
.githooks/ Git hook scripts
pint.json Laravel Pint configuration
.php-cs-fixer.php PHP CS Fixer baseline (reference — copy manually if needed)

Customization Per Project

To customize formatting for a specific project, copy the relevant config file from node_modules/@lform/pretty-code/ to the project root and modify it as needed. Only copy what you need — copied files will no longer receive updates from the package manager.

To undo a customization, delete the project-level config file and it will fall back to the package default.

Troubleshooting

Disconnecting & Reconnecting the Git Hook

If you need to disable or re-enable the automated pre-commit hook:

Uninstalling

  1. Delete any config files copied to the project root
  2. Delete the .githooks directory
  3. Run git config core.hooksPath .git/hooks
  4. Run npm remove @lform/pretty-code
  5. Remove the pretty:format, pretty:format:prettier, pretty:format:pint, and pretty:check scripts from package.json

All versions of pretty-code with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
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 lform/pretty-code contains the following files

Loading the files please wait ...