mirror of
https://github.com/ivuorinen/branch-usage-checker.git
synced 2026-02-23 20:51:50 +00:00
Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1103e59c35 | ||
|
|
de9231d1cd | ||
|
|
29d11f41c7 | ||
|
|
0149b81b5e | ||
|
|
47314c8089 | ||
|
|
7701a55e91 | ||
|
|
f9515966e8 | ||
|
|
8efdbc289f | ||
| ef136f6410 | |||
| 2007436e22 | |||
| 852f850bc0 | |||
|
|
ebbf7371a8 | ||
|
|
c9a87cce82 | ||
|
|
b546e5bd77 | ||
| ab9a8797bd | |||
|
|
445973b2ad | ||
| b6e1252f61 | |||
| 45927b0171 | |||
| 557e906acf | |||
| 2ee29e57fa | |||
|
|
53cf3abc04 | ||
| 5e6e2246af | |||
| 6a6f342d19 | |||
|
|
8008d7d0e9 |
@@ -11,6 +11,10 @@ trim_trailing_whitespace = true
|
|||||||
[*.md]
|
[*.md]
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
[*.json]
|
||||||
|
indent_size = 2
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
[*.yml]
|
[*.yml]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|||||||
4
renovate.json → .github/renovate.json
vendored
4
renovate.json → .github/renovate.json
vendored
@@ -1,4 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
"extends": ["github>ivuorinen/.github:renovate-config"]
|
"extends": [
|
||||||
|
"github>ivuorinen/renovate-config"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
12
.github/workflows/dependency-review.yml
vendored
12
.github/workflows/dependency-review.yml
vendored
@@ -7,8 +7,8 @@
|
|||||||
#
|
#
|
||||||
# Source repository: https://github.com/actions/dependency-review-action
|
# Source repository: https://github.com/actions/dependency-review-action
|
||||||
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
|
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
|
||||||
name: 'Dependency Review'
|
name: "Dependency Review"
|
||||||
on: [pull_request]
|
on: [ pull_request ]
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -17,7 +17,7 @@ jobs:
|
|||||||
dependency-review:
|
dependency-review:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Repository'
|
- name: "Checkout Repository"
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: 'Dependency Review'
|
- name: "Dependency Review"
|
||||||
uses: actions/dependency-review-action@v3
|
uses: actions/dependency-review-action@v4
|
||||||
|
|||||||
16
.github/workflows/test-and-build.yml
vendored
16
.github/workflows/test-and-build.yml
vendored
@@ -2,10 +2,10 @@ name: Test & Build
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [master]
|
||||||
pull_request:
|
pull_request:
|
||||||
release:
|
release:
|
||||||
types: [ created ]
|
types: [created]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-phar:
|
build-phar:
|
||||||
@@ -14,10 +14,10 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
php: [ '8.1' ]
|
php: ["8.2"]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ jobs:
|
|||||||
- name: Ensure the PHAR works
|
- name: Ensure the PHAR works
|
||||||
run: builds/branch-usage-checker --version
|
run: builds/branch-usage-checker --version
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v4
|
||||||
name: Upload the PHAR artifact
|
name: Upload the PHAR artifact
|
||||||
with:
|
with:
|
||||||
name: branch-usage-checker
|
name: branch-usage-checker
|
||||||
@@ -61,16 +61,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Publish the PHAR
|
name: Publish the PHAR
|
||||||
needs:
|
needs:
|
||||||
- 'build-phar'
|
- "build-phar"
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: branch-usage-checker
|
name: branch-usage-checker
|
||||||
path: builds/
|
path: builds/
|
||||||
|
|
||||||
- name: Upload box.phar
|
- name: Upload box.phar
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
files: builds/branch-usage-checker
|
files: builds/branch-usage-checker
|
||||||
|
|||||||
0
.yamlignore
Normal file
0
.yamlignore
Normal file
25
README.md
25
README.md
@@ -1,23 +1,16 @@
|
|||||||
<h1 style="text-align:center">
|
# Branch usage checker
|
||||||
Branch usage checker
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
<p style="text-align:center">
|
[![Packagist Version][pkg-shield]][packagist] [![License][license]][packagist]
|
||||||
<a href="https://packagist.org/packages/ivuorinen/branch-usage-checker"><img src="https://img.shields.io/packagist/v/ivuorinen/branch-usage-checker.svg?label=stable" alt="Latest Stable Version"></a>
|
|
||||||
<a href="https://packagist.org/packages/ivuorinen/branch-usage-checker"><img src="https://img.shields.io/packagist/l/ivuorinen/branch-usage-checker.svg" alt="License"></a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2 style="text-align:center">
|
## Check when your package branches have last been used
|
||||||
Check when your package branches have last been used.
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<p style="text-align:center">
|
Use this command line tool to cross-check project public GitHub Branches and
|
||||||
Use this command line tool to cross-check project
|
Packagist branch download statistics to determine are branches safe to delete.
|
||||||
public GitHub Branches and Packagist branch
|
|
||||||
download statistics to determine are branches
|
|
||||||
safe to delete.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Branch usage checker is an open-source software licensed under the MIT license.
|
Branch usage checker is an open-source software licensed under the MIT license.
|
||||||
|
|
||||||
|
[packagist]: https://packagist.org/packages/ivuorinen/branch-usage-checker
|
||||||
|
[pkg-shield]: https://img.shields.io/packagist/v/ivuorinen/branch-usage-checker
|
||||||
|
[license]: https://img.shields.io/packagist/l/ivuorinen/branch-usage-checker.svg
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class CheckCommand extends Command
|
|||||||
$versions = collect($pkg->versions ?? [])
|
$versions = collect($pkg->versions ?? [])
|
||||||
->keys()
|
->keys()
|
||||||
// Filter actual versions out.
|
// Filter actual versions out.
|
||||||
->filter(fn($version) => \str_starts_with($version, 'dev-'))
|
->filter(fn ($version) => \str_starts_with($version, 'dev-'))
|
||||||
->sort();
|
->sort();
|
||||||
|
|
||||||
$this->totalBranches = $versions->count();
|
$this->totalBranches = $versions->count();
|
||||||
@@ -59,7 +59,7 @@ class CheckCommand extends Command
|
|||||||
);
|
);
|
||||||
|
|
||||||
$statistics = collect($versions)
|
$statistics = collect($versions)
|
||||||
->mapWithKeys(fn($branch) => $this->getStatistics($branch))
|
->mapWithKeys(fn ($branch) => $this->getStatistics($branch))
|
||||||
->toArray();
|
->toArray();
|
||||||
|
|
||||||
$this->info('Downloaded statistics...');
|
$this->info('Downloaded statistics...');
|
||||||
@@ -73,7 +73,7 @@ class CheckCommand extends Command
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getStatistics($branch): array
|
private function getStatistics(string $branch): array
|
||||||
{
|
{
|
||||||
$payload = Http::get(
|
$payload = Http::get(
|
||||||
sprintf(
|
sprintf(
|
||||||
|
|||||||
@@ -34,9 +34,7 @@ class InspireCommand extends Command
|
|||||||
<<<'HTML'
|
<<<'HTML'
|
||||||
<div class="py-1 ml-2">
|
<div class="py-1 ml-2">
|
||||||
<div class="px-1 bg-blue-300 text-black">Laravel Zero</div>
|
<div class="px-1 bg-blue-300 text-black">Laravel Zero</div>
|
||||||
<em class="ml-1">
|
<em class="ml-1">Simplicity is the ultimate sophistication.</em>
|
||||||
Simplicity is the ultimate sophistication.
|
|
||||||
</em>
|
|
||||||
</div>
|
</div>
|
||||||
HTML
|
HTML
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Application bootstrap
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create The Application
|
* Create The Application
|
||||||
*
|
*
|
||||||
@@ -8,7 +12,7 @@
|
|||||||
* the IoC container for the system binding all of the various parts.
|
* the IoC container for the system binding all of the various parts.
|
||||||
*/
|
*/
|
||||||
$app = new LaravelZero\Framework\Application(
|
$app = new LaravelZero\Framework\Application(
|
||||||
dirname( __DIR__ )
|
dirname(__DIR__)
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
34
box.json
34
box.json
@@ -1,19 +1,19 @@
|
|||||||
{
|
{
|
||||||
"chmod": "0755",
|
"chmod": "0755",
|
||||||
"directories": [
|
"directories": [
|
||||||
"app",
|
"app",
|
||||||
"bootstrap",
|
"bootstrap",
|
||||||
"config",
|
"config",
|
||||||
"vendor"
|
"vendor"
|
||||||
],
|
],
|
||||||
"files": [
|
"files": [
|
||||||
"composer.json"
|
"composer.json"
|
||||||
],
|
],
|
||||||
"exclude-composer-files": false,
|
"exclude-composer-files": false,
|
||||||
"exclude-dev-files": false,
|
"exclude-dev-files": false,
|
||||||
"compression": "GZ",
|
"compression": "GZ",
|
||||||
"compactors": [
|
"compactors": [
|
||||||
"KevinGH\\Box\\Compactor\\Php",
|
"KevinGH\\Box\\Compactor\\Php",
|
||||||
"KevinGH\\Box\\Compactor\\Json"
|
"KevinGH\\Box\\Compactor\\Json"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
154
composer.json
154
composer.json
@@ -1,79 +1,81 @@
|
|||||||
{
|
{
|
||||||
"name": "ivuorinen/branch-usage-checker",
|
"name": "ivuorinen/branch-usage-checker",
|
||||||
"description": "GitHub Project branch usage checker.",
|
"description": "GitHub Project branch usage checker.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "project",
|
"type": "project",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"branch",
|
"branch",
|
||||||
"usage",
|
"usage",
|
||||||
"github",
|
"github",
|
||||||
"console",
|
"console",
|
||||||
"cli"
|
"cli"
|
||||||
],
|
],
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Ismo Vuorinen",
|
"name": "Ismo Vuorinen",
|
||||||
"homepage": "https://github.com/ivuorinen"
|
"homepage": "https://github.com/ivuorinen"
|
||||||
}
|
|
||||||
],
|
|
||||||
"homepage": "https://github.com/ivuorinen/branch-usage-checker",
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/ivuorinen/branch-usage-checker/issues",
|
|
||||||
"source": "https://github.com/ivuorinen/branch-usage-checker"
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=8.1",
|
|
||||||
"guzzlehttp/guzzle": "^7.4",
|
|
||||||
"illuminate/http": "^9.0",
|
|
||||||
"laravel-zero/phar-updater": "^1.2",
|
|
||||||
"nunomaduro/termwind": "^1.3",
|
|
||||||
"spatie/data-transfer-object": "^3.7"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"ergebnis/composer-normalize": "^2.23",
|
|
||||||
"laravel-zero/framework": "^9.0",
|
|
||||||
"mockery/mockery": "^1.4.4",
|
|
||||||
"pestphp/pest": "^1.21.1",
|
|
||||||
"roave/security-advisories": "dev-latest"
|
|
||||||
},
|
|
||||||
"minimum-stability": "dev",
|
|
||||||
"prefer-stable": true,
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"App\\": "app/",
|
|
||||||
"Database\\Factories\\": "database/factories/",
|
|
||||||
"Database\\Seeders\\": "database/seeders/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload-dev": {
|
|
||||||
"psr-4": {
|
|
||||||
"Tests\\": "tests/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"bin": [
|
|
||||||
"builds/branch-usage-checker"
|
|
||||||
],
|
|
||||||
"config": {
|
|
||||||
"allow-plugins": {
|
|
||||||
"pestphp/pest-plugin": true,
|
|
||||||
"ergebnis/composer-normalize": true,
|
|
||||||
"dealerdirect/phpcodesniffer-composer-installer": true
|
|
||||||
},
|
|
||||||
"optimize-autoloader": true,
|
|
||||||
"platform": {
|
|
||||||
"php": "8.1"
|
|
||||||
},
|
|
||||||
"preferred-install": "dist",
|
|
||||||
"sort-packages": true
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"post-autoload-dump": [
|
|
||||||
"composer normalize"
|
|
||||||
],
|
|
||||||
"build": [
|
|
||||||
"cp application application.phar",
|
|
||||||
"@php application app:build branch-usage-checker"
|
|
||||||
],
|
|
||||||
"x": "@php builds/branch-usage-checker"
|
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/ivuorinen/branch-usage-checker",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/ivuorinen/branch-usage-checker/issues",
|
||||||
|
"source": "https://github.com/ivuorinen/branch-usage-checker"
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^8.2",
|
||||||
|
"guzzlehttp/guzzle": "^7",
|
||||||
|
"illuminate/http": "^11",
|
||||||
|
"laravel-zero/phar-updater": "^1.2",
|
||||||
|
"nunomaduro/termwind": "^2",
|
||||||
|
"spatie/data-transfer-object": "^3.7"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"ergebnis/composer-normalize": "^2",
|
||||||
|
"laravel-zero/framework": "^11",
|
||||||
|
"mockery/mockery": "^1",
|
||||||
|
"pestphp/pest": "^3",
|
||||||
|
"roave/security-advisories": "dev-latest"
|
||||||
|
},
|
||||||
|
"minimum-stability": "dev",
|
||||||
|
"prefer-stable": true,
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"App\\": "app/",
|
||||||
|
"Database\\Factories\\": "database/factories/",
|
||||||
|
"Database\\Seeders\\": "database/seeders/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload-dev": {
|
||||||
|
"psr-4": {
|
||||||
|
"Tests\\": "tests/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bin": [
|
||||||
|
"builds/branch-usage-checker"
|
||||||
|
],
|
||||||
|
"config": {
|
||||||
|
"allow-plugins": {
|
||||||
|
"dealerdirect/phpcodesniffer-composer-installer": true,
|
||||||
|
"ergebnis/composer-normalize": true,
|
||||||
|
"pestphp/pest-plugin": true
|
||||||
|
},
|
||||||
|
"optimize-autoloader": true,
|
||||||
|
"platform": {
|
||||||
|
"php": "8.2"
|
||||||
|
},
|
||||||
|
"preferred-install": "dist",
|
||||||
|
"sort-packages": true
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"post-autoload-dump": [
|
||||||
|
"composer normalize"
|
||||||
|
],
|
||||||
|
"build": [
|
||||||
|
"cp application application.phar",
|
||||||
|
"@php application app:build branch-usage-checker",
|
||||||
|
"rm application.phar"
|
||||||
|
],
|
||||||
|
"test": "vendor/bin/pest",
|
||||||
|
"x": "@php builds/branch-usage-checker"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
5137
composer.lock
generated
5137
composer.lock
generated
File diff suppressed because it is too large
Load Diff
8
phpcs.xml
Normal file
8
phpcs.xml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<ruleset name="PHP_CodeSniffer">
|
||||||
|
<description>PHP_CodeSniffer configuration</description>
|
||||||
|
<rule ref="PSR12">
|
||||||
|
<exclude name="PSR12.Operators.OperatorSpacing"/>
|
||||||
|
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols"/>
|
||||||
|
</rule>
|
||||||
|
</ruleset>
|
||||||
@@ -1,13 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<phpunit backupGlobals="false"
|
<phpunit
|
||||||
backupStaticAttributes="false"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
bootstrap="vendor/autoload.php"
|
backupGlobals="false"
|
||||||
colors="true"
|
bootstrap="vendor/autoload.php"
|
||||||
convertErrorsToExceptions="true"
|
colors="true"
|
||||||
convertNoticesToExceptions="true"
|
processIsolation="false"
|
||||||
convertWarningsToExceptions="true"
|
stopOnFailure="false"
|
||||||
processIsolation="false"
|
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
|
||||||
stopOnFailure="false">
|
cacheDirectory=".phpunit.cache"
|
||||||
|
backupStaticProperties="false"
|
||||||
|
>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Feature">
|
<testsuite name="Feature">
|
||||||
<directory suffix="Test.php">./tests/Feature</directory>
|
<directory suffix="Test.php">./tests/Feature</directory>
|
||||||
@@ -16,9 +18,10 @@
|
|||||||
<directory suffix="Test.php">./tests/Unit</directory>
|
<directory suffix="Test.php">./tests/Unit</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
<coverage processUncoveredFiles="true">
|
<coverage/>
|
||||||
|
<source>
|
||||||
<include>
|
<include>
|
||||||
<directory suffix=".php">./app</directory>
|
<directory suffix=".php">./app</directory>
|
||||||
</include>
|
</include>
|
||||||
</coverage>
|
</source>
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ trait CreatesApplication
|
|||||||
*/
|
*/
|
||||||
public function createApplication()
|
public function createApplication()
|
||||||
{
|
{
|
||||||
$app = require __DIR__.'/../bootstrap/app.php';
|
$app = require __DIR__ . '/../bootstrap/app.php';
|
||||||
|
|
||||||
$app->make(Kernel::class)->bootstrap();
|
$app->make(Kernel::class)->bootstrap();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user