Updated Rector to commit 0b1345f2a7

0b1345f2a7 improve generate changelog miniscript
This commit is contained in:
Tomas Votruba 2021-11-15 14:06:34 +00:00
parent 3d7b7c3cda
commit 510ba33047
6 changed files with 34 additions and 22 deletions

View File

@ -47,12 +47,13 @@ final class GenerateChangelogCommand extends \RectorPrefix20211115\Symfony\Compo
*/
protected function execute($input, $output) : int
{
$commitHashRange = \sprintf('%s..%s', $input->getArgument(self::OPTION_FROM_COMMIT), $input->getArgument(self::OPTION_TO_COMMIT));
$commitLines = $this->exec(['git', 'log', $commitHashRange, '--reverse', '--pretty=%H %s']);
$fromCommit = (string) $input->getArgument(self::OPTION_FROM_COMMIT);
$toCommit = (string) $input->getArgument(self::OPTION_TO_COMMIT);
$commitLines = $this->resolveCommitLinesFromToHashes($fromCommit, $toCommit);
$commits = \array_map(function (string $line) : array {
[$hash, $message] = \explode(' ', $line, 2);
return ['hash' => $hash, 'message' => $message];
}, \explode("\n", $commitLines));
}, $commitLines);
$i = 0;
foreach ($commits as $commit) {
$searchPullRequestsUri = \sprintf('https://api.github.com/search/issues?q=repo:' . self::DEVELOPMENT_REPOSITORY_NAME . '+%s', $commit['hash']);
@ -98,6 +99,17 @@ final class GenerateChangelogCommand extends \RectorPrefix20211115\Symfony\Compo
$process->run();
return $process->getOutput();
}
/**
* @return string[]
*/
private function resolveCommitLinesFromToHashes(string $fromCommit, string $toCommit) : array
{
$commitHashRange = \sprintf('%s..%s', $fromCommit, $toCommit);
$output = $this->exec(['git', 'log', $commitHashRange, '--reverse', '--pretty=%H %s']);
$commitLines = \explode("\n", $output);
// remove empty values
return \array_filter($commitLines);
}
}
/**
* Inspired from @see https://github.com/phpstan/phpstan-src/blob/master/bin/generate-changelog.php

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = 'eaf1f250031db227ef2c623c16753a3642bfa2bb';
public const PACKAGE_VERSION = '0b1345f2a7214e5d2a4d81fc316920c4ddd56a28';
/**
* @var string
*/
public const RELEASE_DATE = '2021-11-15 14:45:09';
public const RELEASE_DATE = '2021-11-15 16:52:59';
public static function resolvePackageVersion() : string
{
$process = new \RectorPrefix20211115\Symfony\Component\Process\Process(['git', 'log', '--pretty="%H"', '-n1', 'HEAD'], __DIR__);

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitc74f41338d4736b0a16c54978b1e43f5::getLoader();
return ComposerAutoloaderInitc2d7ae4ff32bcda41ebdb820fb49c1de::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitc74f41338d4736b0a16c54978b1e43f5
class ComposerAutoloaderInitc2d7ae4ff32bcda41ebdb820fb49c1de
{
private static $loader;
@ -22,15 +22,15 @@ class ComposerAutoloaderInitc74f41338d4736b0a16c54978b1e43f5
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitc74f41338d4736b0a16c54978b1e43f5', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInitc2d7ae4ff32bcda41ebdb820fb49c1de', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInitc74f41338d4736b0a16c54978b1e43f5', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInitc2d7ae4ff32bcda41ebdb820fb49c1de', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitc74f41338d4736b0a16c54978b1e43f5::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInitc2d7ae4ff32bcda41ebdb820fb49c1de::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
@ -42,19 +42,19 @@ class ComposerAutoloaderInitc74f41338d4736b0a16c54978b1e43f5
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInitc74f41338d4736b0a16c54978b1e43f5::$files;
$includeFiles = Composer\Autoload\ComposerStaticInitc2d7ae4ff32bcda41ebdb820fb49c1de::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequirec74f41338d4736b0a16c54978b1e43f5($fileIdentifier, $file);
composerRequirec2d7ae4ff32bcda41ebdb820fb49c1de($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequirec74f41338d4736b0a16c54978b1e43f5($fileIdentifier, $file)
function composerRequirec2d7ae4ff32bcda41ebdb820fb49c1de($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInitc74f41338d4736b0a16c54978b1e43f5
class ComposerStaticInitc2d7ae4ff32bcda41ebdb820fb49c1de
{
public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
@ -3545,9 +3545,9 @@ class ComposerStaticInitc74f41338d4736b0a16c54978b1e43f5
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitc74f41338d4736b0a16c54978b1e43f5::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitc74f41338d4736b0a16c54978b1e43f5::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitc74f41338d4736b0a16c54978b1e43f5::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInitc2d7ae4ff32bcda41ebdb820fb49c1de::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitc2d7ae4ff32bcda41ebdb820fb49c1de::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInitc2d7ae4ff32bcda41ebdb820fb49c1de::$classMap;
}, null, ClassLoader::class);
}

View File

@ -12,8 +12,8 @@ if (!class_exists('GenerateChangelogCommand', false) && !interface_exists('Gener
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20211115\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInitc74f41338d4736b0a16c54978b1e43f5', false) && !interface_exists('ComposerAutoloaderInitc74f41338d4736b0a16c54978b1e43f5', false) && !trait_exists('ComposerAutoloaderInitc74f41338d4736b0a16c54978b1e43f5', false)) {
spl_autoload_call('RectorPrefix20211115\ComposerAutoloaderInitc74f41338d4736b0a16c54978b1e43f5');
if (!class_exists('ComposerAutoloaderInitc2d7ae4ff32bcda41ebdb820fb49c1de', false) && !interface_exists('ComposerAutoloaderInitc2d7ae4ff32bcda41ebdb820fb49c1de', false) && !trait_exists('ComposerAutoloaderInitc2d7ae4ff32bcda41ebdb820fb49c1de', false)) {
spl_autoload_call('RectorPrefix20211115\ComposerAutoloaderInitc2d7ae4ff32bcda41ebdb820fb49c1de');
}
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
spl_autoload_call('RectorPrefix20211115\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -3309,9 +3309,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20211115\print_node(...func_get_args());
}
}
if (!function_exists('composerRequirec74f41338d4736b0a16c54978b1e43f5')) {
function composerRequirec74f41338d4736b0a16c54978b1e43f5() {
return \RectorPrefix20211115\composerRequirec74f41338d4736b0a16c54978b1e43f5(...func_get_args());
if (!function_exists('composerRequirec2d7ae4ff32bcda41ebdb820fb49c1de')) {
function composerRequirec2d7ae4ff32bcda41ebdb820fb49c1de() {
return \RectorPrefix20211115\composerRequirec2d7ae4ff32bcda41ebdb820fb49c1de(...func_get_args());
}
}
if (!function_exists('parseArgs')) {