mirror of
https://github.com/ivuorinen/branch-usage-checker.git
synced 2026-02-23 15:51:42 +00:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.json]
|
||||
indent_size = 2
|
||||
insert_final_newline = true
|
||||
|
||||
[*.yml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
0
renovate.json → .github/renovate.json
vendored
0
renovate.json → .github/renovate.json
vendored
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
|
||||
# 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'
|
||||
on: [pull_request]
|
||||
name: "Dependency Review"
|
||||
on: [ pull_request ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
dependency-review:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 'Checkout Repository'
|
||||
uses: actions/checkout@v3
|
||||
- name: 'Dependency Review'
|
||||
uses: actions/dependency-review-action@v3
|
||||
- name: "Checkout Repository"
|
||||
uses: actions/checkout@v4
|
||||
- name: "Dependency Review"
|
||||
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:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [master]
|
||||
pull_request:
|
||||
release:
|
||||
types: [ created ]
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
build-phar:
|
||||
@@ -14,10 +14,10 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
php: [ '8.1' ]
|
||||
php: ["8.2"]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
- name: Ensure the PHAR works
|
||||
run: builds/branch-usage-checker --version
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@v4
|
||||
name: Upload the PHAR artifact
|
||||
with:
|
||||
name: branch-usage-checker
|
||||
@@ -61,16 +61,16 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
name: Publish the PHAR
|
||||
needs:
|
||||
- 'build-phar'
|
||||
- "build-phar"
|
||||
if: github.event_name == 'release'
|
||||
steps:
|
||||
- uses: actions/download-artifact@v3
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: branch-usage-checker
|
||||
path: builds/
|
||||
|
||||
- name: Upload box.phar
|
||||
uses: softprops/action-gh-release@v1
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
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
|
||||
</h1>
|
||||
# Branch usage checker
|
||||
|
||||
<p style="text-align:center">
|
||||
<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>
|
||||
[![Packagist Version][pkg-shield]][packagist] [![License][license]][packagist]
|
||||
|
||||
<h2 style="text-align:center">
|
||||
Check when your package branches have last been used.
|
||||
</h2>
|
||||
## Check when your package branches have last been used
|
||||
|
||||
<p style="text-align:center">
|
||||
Use this command line tool to cross-check project
|
||||
public GitHub Branches and Packagist branch
|
||||
download statistics to determine are branches
|
||||
safe to delete.
|
||||
</p>
|
||||
Use this command line tool to cross-check project public GitHub Branches and
|
||||
Packagist branch download statistics to determine are branches safe to delete.
|
||||
|
||||
## 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 ?? [])
|
||||
->keys()
|
||||
// Filter actual versions out.
|
||||
->filter(fn($version) => \str_starts_with($version, 'dev-'))
|
||||
->filter(fn ($version) => \str_starts_with($version, 'dev-'))
|
||||
->sort();
|
||||
|
||||
$this->totalBranches = $versions->count();
|
||||
@@ -59,7 +59,7 @@ class CheckCommand extends Command
|
||||
);
|
||||
|
||||
$statistics = collect($versions)
|
||||
->mapWithKeys(fn($branch) => $this->getStatistics($branch))
|
||||
->mapWithKeys(fn ($branch) => $this->getStatistics($branch))
|
||||
->toArray();
|
||||
|
||||
$this->info('Downloaded statistics...');
|
||||
@@ -73,7 +73,7 @@ class CheckCommand extends Command
|
||||
return 0;
|
||||
}
|
||||
|
||||
private function getStatistics($branch): array
|
||||
private function getStatistics(string $branch): array
|
||||
{
|
||||
$payload = Http::get(
|
||||
sprintf(
|
||||
|
||||
@@ -34,9 +34,7 @@ class InspireCommand extends Command
|
||||
<<<'HTML'
|
||||
<div class="py-1 ml-2">
|
||||
<div class="px-1 bg-blue-300 text-black">Laravel Zero</div>
|
||||
<em class="ml-1">
|
||||
Simplicity is the ultimate sophistication.
|
||||
</em>
|
||||
<em class="ml-1">Simplicity is the ultimate sophistication.</em>
|
||||
</div>
|
||||
HTML
|
||||
);
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Application bootstrap
|
||||
*/
|
||||
|
||||
/**
|
||||
* Create The Application
|
||||
*
|
||||
@@ -8,7 +12,7 @@
|
||||
* the IoC container for the system binding all of the various parts.
|
||||
*/
|
||||
$app = new LaravelZero\Framework\Application(
|
||||
dirname( __DIR__ )
|
||||
dirname(__DIR__)
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
34
box.json
34
box.json
@@ -1,19 +1,19 @@
|
||||
{
|
||||
"chmod": "0755",
|
||||
"directories": [
|
||||
"app",
|
||||
"bootstrap",
|
||||
"config",
|
||||
"vendor"
|
||||
],
|
||||
"files": [
|
||||
"composer.json"
|
||||
],
|
||||
"exclude-composer-files": false,
|
||||
"exclude-dev-files": false,
|
||||
"compression": "GZ",
|
||||
"compactors": [
|
||||
"KevinGH\\Box\\Compactor\\Php",
|
||||
"KevinGH\\Box\\Compactor\\Json"
|
||||
]
|
||||
"chmod": "0755",
|
||||
"directories": [
|
||||
"app",
|
||||
"bootstrap",
|
||||
"config",
|
||||
"vendor"
|
||||
],
|
||||
"files": [
|
||||
"composer.json"
|
||||
],
|
||||
"exclude-composer-files": false,
|
||||
"exclude-dev-files": false,
|
||||
"compression": "GZ",
|
||||
"compactors": [
|
||||
"KevinGH\\Box\\Compactor\\Php",
|
||||
"KevinGH\\Box\\Compactor\\Json"
|
||||
]
|
||||
}
|
||||
|
||||
Binary file not shown.
153
composer.json
153
composer.json
@@ -1,79 +1,80 @@
|
||||
{
|
||||
"name": "ivuorinen/branch-usage-checker",
|
||||
"description": "GitHub Project branch usage checker.",
|
||||
"license": "MIT",
|
||||
"type": "project",
|
||||
"keywords": [
|
||||
"branch",
|
||||
"usage",
|
||||
"github",
|
||||
"console",
|
||||
"cli"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ismo Vuorinen",
|
||||
"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"
|
||||
"name": "ivuorinen/branch-usage-checker",
|
||||
"description": "GitHub Project branch usage checker.",
|
||||
"license": "MIT",
|
||||
"type": "project",
|
||||
"keywords": [
|
||||
"branch",
|
||||
"usage",
|
||||
"github",
|
||||
"console",
|
||||
"cli"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ismo Vuorinen",
|
||||
"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.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": "^2",
|
||||
"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"
|
||||
],
|
||||
"test": "vendor/bin/pest",
|
||||
"x": "@php builds/branch-usage-checker"
|
||||
}
|
||||
}
|
||||
|
||||
4769
composer.lock
generated
4769
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"?>
|
||||
<phpunit backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
bootstrap="vendor/autoload.php"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false">
|
||||
<phpunit
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
backupGlobals="false"
|
||||
bootstrap="vendor/autoload.php"
|
||||
colors="true"
|
||||
processIsolation="false"
|
||||
stopOnFailure="false"
|
||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
|
||||
cacheDirectory=".phpunit.cache"
|
||||
backupStaticProperties="false"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="Feature">
|
||||
<directory suffix="Test.php">./tests/Feature</directory>
|
||||
@@ -16,9 +18,10 @@
|
||||
<directory suffix="Test.php">./tests/Unit</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<coverage processUncoveredFiles="true">
|
||||
<coverage/>
|
||||
<source>
|
||||
<include>
|
||||
<directory suffix=".php">./app</directory>
|
||||
</include>
|
||||
</coverage>
|
||||
</source>
|
||||
</phpunit>
|
||||
|
||||
@@ -13,7 +13,7 @@ trait CreatesApplication
|
||||
*/
|
||||
public function createApplication()
|
||||
{
|
||||
$app = require __DIR__.'/../bootstrap/app.php';
|
||||
$app = require __DIR__ . '/../bootstrap/app.php';
|
||||
|
||||
$app->make(Kernel::class)->bootstrap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user