PHPackages                             mattsqd/robovalidate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. mattsqd/robovalidate

ActiveRobo-tasks[Validation &amp; Sanitization](/categories/validation)

mattsqd/robovalidate
====================

A group of Robo commands that run various validation tasks on local environments or pipelines

1.x-dev(7mo ago)011.9k↓50%[1 issues](https://github.com/mattsqd/robovalidate/issues)GPL-2.0-or-laterPHPPHP &gt;=8.2CI passing

Since Apr 5Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/mattsqd/robovalidate)[ Packagist](https://packagist.org/packages/mattsqd/robovalidate)[ RSS](/packages/mattsqd-robovalidate/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (9)Dependencies (3)Versions (18)Used By (0)

Robo Validate Commands
======================

[](#robo-validate-commands)

**A group of [Robo](https://robo.li) commands that run various validation tasks on local environments or pipelines**

- Coding standards (`validate:coding-standards`)
    - Uses PHPCS to validate code.
    - Zero config for Drupal projects.
- Composer lock (`validate:composer-lock`)
    - Ensures you don't get this message during `composer install`:

> Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.

- Commit messages (`validate:commit-messages`)
    - Validate commit messages against a regular expression.
- Branch name (`validate:branch-name`)
    - Validate a branch name against a regular expression.
    - Note: This command has an optional single parameter which is the branch name if the current branch name cannot be determined automatically.
- Run all the above (`validate:all)`

Installing
----------

[](#installing)

`composer require mattsqd/robovalidate`

Usage
-----

[](#usage)

Use `vendor/bin/robo` to execute Robo tasks.

Configuration
-------------

[](#configuration)

There are two ways to configure the commands.

1. Pass options to the command as they run.
2. Create (or update) a robo.yml in your root directory that holds the options.

Number two is the easiest as some options are arrays, and it gets very ugly trying to pass arrays at run time.

All the options live under the `command.validate.options` namespace in robo.yml.

Some commands share the same option, such as project-id. So changing it will affect all commands unless you move that key under the specific commands section. You can see an example of this with 'pattern' which is used in two commands.

If you'd like to initialize your robo.yml with what's in robo.example.yml, please use the command:

`vendor/bin/robo validate:init-robo-yml`

### Quick Start

[](#quick-start)

The quick start assumes:

- This is a Drupal project using Drupal and DrupalPractice coding standards.
- You want commit messages like: 'ABC-1234: A short message' and you're merging into origin/develop.
- You want branches named like: main, develop, hotfix/3.3.1, release/3.3.0, and feature/ABC-123-a-short-message.
- Your composer.lock lives in the root directory and composer lives at vendor/bin/composer.

This can be configured by creating `robo.yml` in your project root with the following content:

```
command:
  validate:
    options:
      project-id: ABC
```

And run `vendor/bin/robo validate:all`

If any of the above does not apply you can either:

- Call individual commands instead of `validate:all` or
- Configure your robo.yml as in robo.example.yml.

Please see robo.example.yml for an example of the defaults configured explicitly.

For each option, you only need to override the ones you want to change, you don't need to copy the entire file, although you can.

### Configuring the robo.yml after running validate:init-robo-yml

[](#configuring-the-roboyml-after-running-validateinit-robo-yml)

#### Project ID

[](#project-id)

The first choice is whether to use project ID or not. Project ID is used in validating commit messages and branch names. Project ID is up to you if you want it. It's a good reference so you know you're committing to the correct project and also handy if you use BitBucket because issues have a project ID in them. If you do NOT want to use project ID, remove `{$project_id}` from robo.yml. This project's robo.yml does not use project ID, you can use [it as an example](https://github.com/mattsqd/robovalidate/blob/1.x/robo.yml).

#### Branch Names

[](#branch-names)

Branch name schemes usually vary between projects, so make sure that all the branch names that you could use have a corresponding entry in `valid-branch-names`. For example:

- If you `dev` instead of `develop`, you'd want to rename the entry.
- If you have a `stage` branch, you'd want to add another `explicit|stage` entry.
- If you don't want to have regex matching used by the `pattern` and `custom-help` properties, you can just remove the `custom|` entry from `valid-branch-names`.

#### Commit Messages

[](#commit-messages)

Commit messages are defaulted to more of a BitBucket style. GitHub uses a [special set of words](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) to link to an issue. You can view this projects [robo.yml](https://github.com/mattsqd/robovalidate/blob/1.x/robo.yml#L18) to see how enforcing those keywords would be possible. If you use project ID, you'll need to add that back into the pattern and help text.

### Running in Continuous Integration

[](#running-in-continuous-integration)

There is a working GitHub Action for this project that you should be able to copy into your project if you use GitHub Actions as well. It can be found at .

[![Run validation with RoboValidate](https://github.com/mattsqd/robovalidate/actions/workflows/run-validation.yml/badge.svg)](https://github.com/mattsqd/robovalidate/actions/workflows/run-validation.yml)

The main thing to note is that `vendor/bin/robo validate:commit-messages` needs a target branch so it goes over only commits that are not in the current branch. By default, this is set to `develop`. If the branch your developers merge into is not `develop`, you can either change the value or pass a value like the same GitHub action does and pass in the target branch which is only availble during pull request events. That is why there are 2 separate steps and `vendor/bin/robo validate:all` is not called. Note that current branch is also passed because on PRs, in GitHub, it does not checkout the current branch cleanly. Instead, you are left at a new hash which is the merge commit of the current branch into the target branch. Therefore, all commits will be processed and the last commit will probably not pass validation, since GitHub creates a commit.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance62

Regular maintenance activity

Popularity25

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~91 days

Recently: every ~49 days

Total

11

Last Release

231d ago

PHP version history (2 changes)1.0.0-alphaPHP &gt;=8.0.17

1.8.0-alphaPHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1043047?v=4)[Matt Poole](/maintainers/mattsqd)[@mattsqd](https://github.com/mattsqd)

---

Top Contributors

[![mattsqd](https://avatars.githubusercontent.com/u/1043047?v=4)](https://github.com/mattsqd "mattsqd (64 commits)")

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/mattsqd-robovalidate/health.svg)

```
[![Health](https://phpackages.com/badges/mattsqd-robovalidate/health.svg)](https://phpackages.com/packages/mattsqd-robovalidate)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
