All Projects → ScreamingDev → phpsemver

ScreamingDev / phpsemver

Licence: MIT license
Check if your changes are a major change, minor change or just a patch.

Programming Languages

PHP
23972 projects - #3 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to phpsemver

json matcher
Library for simplifying data verification in functional tests for your JSON-based APIs
Stars: ✭ 24 (-14.29%)
Mutual labels:  assertions
picolisp-unit
Unit Testing framework for PicoLisp
Stars: ✭ 22 (-21.43%)
Mutual labels:  assertions
fluentcheck
Fluent assertions for Python
Stars: ✭ 79 (+182.14%)
Mutual labels:  assertions
chai
BDD / TDD assertion framework for node.js and the browser that can be paired with any testing framework.
Stars: ✭ 7,842 (+27907.14%)
Mutual labels:  assertions
assert.sh
❗ Assertion lib for shell script users
Stars: ✭ 105 (+275%)
Mutual labels:  assertions
jasmine-custom-message
custom failure message on any jasmine v1.3 assertion
Stars: ✭ 15 (-46.43%)
Mutual labels:  assertions
Truss
Assertions API for Clojure/Script
Stars: ✭ 239 (+753.57%)
Mutual labels:  assertions
asserts
The most over-engineered and overpowered C++ assertion library.
Stars: ✭ 217 (+675%)
Mutual labels:  assertions
jasmine2-custom-message
custom failure message on any jasmine v2 assertion
Stars: ✭ 27 (-3.57%)
Mutual labels:  assertions
Assertion
The power of Respect\Validation into an assertion library.
Stars: ✭ 23 (-17.86%)
Mutual labels:  assertions
zerocode-hello-world
Zerocode YAML and JSON based declarative steps hello world rest api testing example - soap, database
Stars: ✭ 18 (-35.71%)
Mutual labels:  assertions
kiwi
Fluent assertions for Kotlin
Stars: ✭ 17 (-39.29%)
Mutual labels:  assertions
vim-UT
Unit Testing plugin for Vim
Stars: ✭ 18 (-35.71%)
Mutual labels:  assertions
tau
A Micro (1k lines of code) Unit Test Framework for C/C++
Stars: ✭ 121 (+332.14%)
Mutual labels:  assertions
concise
✅ Concise is test framework for using plain English and minimal code, built on PHPUnit.
Stars: ✭ 47 (+67.86%)
Mutual labels:  assertions
superdeno
Super-agent driven library for testing Deno HTTP servers.
Stars: ✭ 119 (+325%)
Mutual labels:  assertions
apid
User focused API testing
Stars: ✭ 90 (+221.43%)
Mutual labels:  assertions
rust-claim
Assertion macros toolkit for Rust
Stars: ✭ 53 (+89.29%)
Mutual labels:  assertions
crystal-clear
Design by Contract for Crystal
Stars: ✭ 45 (+60.71%)
Mutual labels:  assertions
karate
Test Automation Made Simple
Stars: ✭ 6,384 (+22700%)
Mutual labels:  assertions

PHPSemVer

Check your changes against semantic versions

Build Status Coverage

Install it via composer

composer require sourcerer-mike/phpsemver

and test your code by comparing two versions

phpsemver compare 3.2.0 HEAD

or the last commit with your current work:

phpsemver compare HEAD .

+-------+-------------------------------------------------------------------+
| Level | Message                                                           |
+-------+-------------------------------------------------------------------+
| major | phpsemver_get_composer_config() removed.                          |
| major | PHPSemVer\Specification removed.                                  |
| minor | PHPSemVer\Config added.                                           |
| minor | PHPSemVer\Wrapper\AbstractWrapper::mergeTrees() added.            |
| patch | PHPSemVer\Wrapper\Directory::getAllFileNames() body changed.      |
| patch | PHPSemVer\Wrapper\Git::getAllFileNames() body changed.            |
+-------+-------------------------------------------------------------------+

Total time: 0.94

You're welcome!

Features

Commands

Try the several possibilities:

  • Use compare to check for changes.
  • Use vcs:message to enhance your commit messages.

Wrapper

Choose between those wrapper(phpsemver compare --type ...):

  • GIT
  • Filesystem / Directories

If one argument is a directory, then the system will work on the file system.

Assertions

Make assertions on:

  • Functions
    • IsAdded: Check if a function is new.
    • IsRemoved: Check if a function is removed.
    • BodyChanged: Check if someone changed the behaviour of a function.
  • Classes
    • IsAdded: Check if a classes is new.
    • IsRemoved: Check if a classes is removed.
  • Methods
    • IsAdded: Check if a method is new.
    • IsRemoved: Check if a method is removed.
    • BodyChanged: Check if someone changed the behaviour of a method.
    • ReturnTypeChanged: Watch for changed return types.
    • ReturnTypeRemoved: Watch for incompatible changes on methods.
  • Interfaces
    • IsAdded: Check if an interface is new.
    • IsRemoved: Check if an interface is removed.

Combine them as you like in your own configuration file.

Configuration

Configure which assertions are used in a XML-File. The delivered XSD file makes it easy to write your own configuration (in a proper IDE).

<?xml version="1.0"?>
<phpsemver
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/sourcerer-mike/phpsemver/3.2.0/etc/phpsemver.xsd"
        title="My own rules">
    <RuleSet name="major">
        <Trigger>
            <Functions>
                <IsRemoved />
            </Functions>
        </Trigger>
    </RuleSet>
    <RuleSet name="minor">
        <Trigger>
            <Classes>
                <IsAdded />
            </Classes>
        </Trigger>
    </RuleSet>
    <RuleSet name="patch">

    </RuleSet>
    <Filter>
        <Whitelist>
            <Pattern>@lib/.*@</Pattern>
        </Whitelist>
        <Blacklist>
            <Pattern>@lib/Test/.*@</Pattern>
        </Blacklist>
    </Filter>
</phpsemver>

Write your own and use it with the --ruleset option. See the wiki entry for more information: https://github.com/sourcerer-mike/phpsemver/wiki/Configuration

Prepared rule sets

Those projects do semantic versions in different ways. So a special config is written for them which can be used via the --ruleSet option:

  • Drupal-Core
  • SemVer2
  • WordPress

Just write phpsemver --ruleSet Drupal-Core and see the latest changes in Drupal. There are other companies that follow some semantics in their rules like Symfony. Don't drag behind - catch up with PHPSemVer.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].