Skip to content

Commit

Permalink
chore(release): first release
Browse files Browse the repository at this point in the history
  • Loading branch information
marcocesarato committed Jan 16, 2021
1 parent 021a49f commit cb524aa
Show file tree
Hide file tree
Showing 7 changed files with 617 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eol=lf
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vendor/**
.idea
.php_cs.cache
41 changes: 41 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php


return PhpCsFixer\Config::create()
->setUsingCache(true)
->setRiskyAllowed(true)
->setCacheFile(__DIR__ . '/.php_cs.cache')
->setRules(array(
'@PSR1' => true,
'@PSR2' => true,
'@Symfony' => true,
'psr4' => true,
// Custom rules
'align_multiline_comment' => array('comment_type' => 'phpdocs_only'), // PSR-5
'phpdoc_to_comment' => false,
'array_indentation' => true,
'array_syntax' => array('syntax' => 'short'),
'cast_spaces' => array('space' => 'none'),
'concat_space' => array('spacing' => 'one'),
'compact_nullable_typehint' => true,
'declare_equal_normalize' => array('space' => 'single'),
'increment_style' => array('style' => 'post'),
'list_syntax' => array('syntax' => 'long'),
'no_short_echo_tag' => true,
'phpdoc_align' => false,
'phpdoc_no_empty_return' => false,
'phpdoc_order' => true, // PSR-5
'phpdoc_no_useless_inheritdoc' => false,
'protected_to_private' => false,
'yoda_style' => false,
'method_argument_space' => array('on_multiline' => 'ensure_fully_multiline'),
'ordered_imports' => array(
'sort_algorithm' => 'alpha',
'imports_order' => array('class', 'const', 'function')
),
))
->setFinder(PhpCsFixer\Finder::create()
->in(__DIR__)
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true));
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# PHP Conventional Changelog

## 📖 Installation

You can install it easily with composer

`composer require --dev marcocesarato/php-conventional-changelog`

## 💻 Usage

Generate a changelog without committing files:

`php vendor/bin/conventional-changelog`

or with auto commit and auto version tagging:

`php vendor/bin/conventional-changelog --commit`

### Commands List

```
-c --commit bool Commit the new release once changelog is generated
-f --from-date str Get commits from specified date
-h --help bool Show the helper with all commands available
-m --major bool Major release (important changes)
-n --minor bool Minor release (add functionality)
-p --patch bool Patch release (bug fixes)
-t --to-date str Get commits from today (or specified on --from-date) to specified date
-v --version str Specify next release version code (Semver)
```
19 changes: 19 additions & 0 deletions bin/conventional-changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php

use ConventionalChangelog\Generator;

$mainFile = __DIR__ .'/../src/Generator.php';
if(is_file($mainFile)) {
require_once $mainFile;
}

foreach ([__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php'] as $file) {
if (file_exists($file)) {
require_once $file;
break;
}
}

$app = new Generator();
$app->run();
48 changes: 48 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "marcocesarato/php-conventional-changelog",
"description": "Generate changelogs and release notes from a project's commit messages and metadata using php composer.",
"type": "library",
"license": "GPL-3.0-or-later",
"minimum-stability": "stable",
"bin": [
"conventional-changelog"
],
"keywords": [
"conventional-changelog",
"readme",
"generation",
"git",
"php",
"conventional-commit",
"conventional-commits",
"conventionalcommits",
"changelog",
"history",
"tag",
"commit",
"commits",
"conventional",
"convention",
"conventional-changelog-preset"
],
"authors": [
{
"name": "Marco Cesarato",
"email": "[email protected]"
}
],
"autoload": {
"psr-4": {
"ConventionalChangelog\\": "src/"
}
},
"scripts": {
"fix-cs": "vendor/bin/php-cs-fixer fix --config=.php_cs"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.17"
},
"require": {
"php": ">=5.5"
}
}
Loading

0 comments on commit cb524aa

Please sign in to comment.