Skip to content

Commit 13314b0

Browse files
committed
wip
1 parent 585d1c3 commit 13314b0

File tree

11 files changed

+376
-78
lines changed

11 files changed

+376
-78
lines changed

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ FROM composer:${composer} AS composer-bin
66
FROM php:${php}-cli-alpine
77

88
ENV PATH="/usr/local/go/bin:$PATH"
9-
ENV GOROOT=/usr/local/go
10-
ENV GOTOOLCHAIN=local
11-
ENV GOFLAGS=-mod=mod
9+
ENV GOROOT="/usr/local/go"
10+
ENV GOTOOLCHAIN="local"
11+
ENV GOFLAGS="-mod=mod"
1212

1313
COPY --from=composer-bin --link /usr/bin/composer /usr/bin/composer
14-
COPY --from=golang:1-alpine --link /usr/local/go /usr/local/go
14+
RUN apk add --no-cache subversion
1515

16+
COPY --from=golang:1-alpine --link /usr/local/go /usr/local/go
1617
COPY go.mod go.sum /tmp-app/
1718
WORKDIR /tmp-app
1819
RUN go mod download && rm -rf /tmp-app
1920

2021
WORKDIR /app
21-
2222
CMD ["go", "test", "./..."]

composer.json

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,71 @@
11
{
2-
"name": "typisttech/wp-org-closed-plugin",
3-
"description": "TODO",
4-
"license": "MIT",
5-
"type": "composer-plugin",
6-
"keywords": [
7-
"TODO"
8-
],
9-
"authors": [
10-
{
11-
"name": "Typist Tech",
12-
"homepage": "https://typist.tech"
2+
"name": "typisttech/wp-org-closed-plugin",
3+
"description": "TODO",
4+
"license": "MIT",
5+
"type": "composer-plugin",
6+
"keywords": [
7+
"TODO"
8+
],
9+
"authors": [
10+
{
11+
"name": "Typist Tech",
12+
"homepage": "https://typist.tech"
13+
},
14+
{
15+
"name": "Tang Rufus",
16+
"email": "[email protected]",
17+
"homepage": "https://tangrufus.com",
18+
"role": "Developer"
19+
}
20+
],
21+
"homepage": "https://github.com/typisttech/wp-org-closed-plugin",
22+
"support": {
23+
"issues": "https://github.com/typisttech/wp-org-closed-plugin/issues",
24+
"source": "https://github.com/typisttech/wp-org-closed-plugin",
25+
"security": "https://github.com/typisttech/wp-org-closed-plugin/security"
1326
},
14-
{
15-
"name": "Tang Rufus",
16-
"email": "[email protected]",
17-
"homepage": "https://tangrufus.com",
18-
"role": "Developer"
19-
}
20-
],
21-
"homepage": "https://github.com/typisttech/wp-org-closed-plugin",
22-
"support": {
23-
"issues": "https://github.com/typisttech/wp-org-closed-plugin/issues",
24-
"source": "https://github.com/typisttech/wp-org-closed-plugin",
25-
"security": "https://github.com/typisttech/wp-org-closed-plugin/security"
26-
},
27-
"require": {
28-
"php": "^8.3",
29-
"composer-plugin-api": "^2.6"
30-
},
31-
"require-dev": {
32-
"composer/composer": "^2.8",
33-
"pestphp/pest": "^4.1",
34-
"phpstan/extension-installer": "^1.4",
35-
"phpstan/phpstan": "^2.1",
36-
"phpstan/phpstan-deprecation-rules": "^2.0",
37-
"phpstan/phpstan-strict-rules": "^2.0"
38-
},
39-
"autoload": {
40-
"psr-4": {
41-
"TypistTech\\WpOrgClosedPlugin\\": "src/"
42-
}
43-
},
44-
"autoload-dev": {
45-
"psr-4": {
46-
"Tests\\": "tests/"
47-
}
48-
},
49-
"config": {
50-
"allow-plugins": {
51-
"pestphp/pest-plugin": true,
52-
"phpstan/extension-installer": true
27+
"require": {
28+
"php": "^8.3",
29+
"composer-plugin-api": "^2.6"
5330
},
54-
"sort-packages": true
55-
},
56-
"extra": {
57-
"class": "TypistTech\\WpOrgClosedPlugin\\Main",
58-
"plugin-modifies-downloads": true,
59-
"plugin-optional": true
60-
},
61-
"scripts": {
62-
"lint": [
63-
"@composer normalize --dry-run",
64-
"pint --test",
65-
"phpstan analyse"
66-
],
67-
"pest": "pest",
68-
"pest:feature": "pest --group=feature",
69-
"pest:unit": "pest --group=unit"
70-
}
31+
"require-dev": {
32+
"composer/composer": "^2.8",
33+
"pestphp/pest": "^4.1",
34+
"phpstan/extension-installer": "^1.4",
35+
"phpstan/phpstan": "^2.1",
36+
"phpstan/phpstan-deprecation-rules": "^2.0",
37+
"phpstan/phpstan-strict-rules": "^2.0"
38+
},
39+
"autoload": {
40+
"psr-4": {
41+
"TypistTech\\WpOrgClosedPlugin\\": "src/"
42+
}
43+
},
44+
"autoload-dev": {
45+
"psr-4": {
46+
"Tests\\": "tests/"
47+
}
48+
},
49+
"config": {
50+
"allow-plugins": {
51+
"pestphp/pest-plugin": true,
52+
"phpstan/extension-installer": true
53+
},
54+
"sort-packages": true
55+
},
56+
"extra": {
57+
"class": "TypistTech\\WpOrgClosedPlugin\\Main",
58+
"plugin-modifies-downloads": true,
59+
"plugin-optional": true
60+
},
61+
"scripts": {
62+
"lint": [
63+
"@composer normalize --dry-run",
64+
"pint --test",
65+
"phpstan analyse"
66+
],
67+
"pest": "pest",
68+
"pest:feature": "pest --group=feature",
69+
"pest:unit": "pest --group=unit"
70+
}
7171
}

testdata/script/dist_closed.txtar

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
exec composer config repositories.wp-org-closed-plugin path $PWD
2+
exec composer install
3+
4+
! exec composer audit --format=json
5+
6+
cmp stdout golden.out
7+
8+
-- composer.json --
9+
{
10+
"name": "test/example",
11+
"version": "0.0.1",
12+
"require": {
13+
"typisttech/wp-org-closed-plugin": "@dev",
14+
"wpackagist-plugin/better-delete-revision": "*"
15+
},
16+
"repositories": [
17+
{
18+
"type": "package",
19+
"package": {
20+
"name": "wpackagist-plugin/better-delete-revision",
21+
"version": "1.0",
22+
"dist": {
23+
"type": "zip",
24+
"url": "https://downloads.wordpress.org/plugin/better-delete-revision.1.0.zip"
25+
}
26+
}
27+
}
28+
],
29+
"config": {
30+
"allow-plugins": {
31+
"composer/installers": true,
32+
"typisttech/wp-org-closed-plugin": true
33+
},
34+
"audit": {
35+
"abandoned": "fail"
36+
}
37+
}
38+
}
39+
40+
-- golden.out --
41+
{
42+
"advisories": [],
43+
"abandoned": {
44+
"wpackagist-plugin/better-delete-revision": null
45+
}
46+
}

testdata/script/dist_open.txtar

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
exec composer config repositories.wp-org-closed-plugin path $PWD
2+
exec composer install
3+
4+
exec composer audit --format=json
5+
6+
cmp stdout golden.out
7+
8+
-- composer.json --
9+
{
10+
"name": "test/example",
11+
"version": "0.0.1",
12+
"require": {
13+
"typisttech/wp-org-closed-plugin": "@dev",
14+
"wpackagist-plugin/hello-dolly": "*"
15+
},
16+
"repositories": [
17+
{
18+
"type": "package",
19+
"package": {
20+
"name": "wpackagist-plugin/hello-dolly",
21+
"version": "1.7.3",
22+
"dist": {
23+
"type": "zip",
24+
"url": "https://downloads.wordpress.org/plugin/hello-dolly.1.7.3.zip"
25+
}
26+
}
27+
}
28+
],
29+
"config": {
30+
"allow-plugins": {
31+
"composer/installers": true,
32+
"typisttech/wp-org-closed-plugin": true
33+
},
34+
"audit": {
35+
"abandoned": "fail"
36+
}
37+
}
38+
}
39+
40+
-- golden.out --
41+
{
42+
"advisories": [],
43+
"abandoned": []
44+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
exec composer config repositories.wp-org-closed-plugin path $PWD
2+
exec composer install
3+
4+
! exec composer audit --format=json
5+
6+
cmp stdout golden.out
7+
8+
-- composer.json --
9+
{
10+
"name": "test/example",
11+
"version": "0.0.1",
12+
"require": {
13+
"typisttech/wp-org-closed-plugin": "@dev",
14+
"wpackagist-plugin/better-delete-revision": "*"
15+
},
16+
"repositories": [
17+
{
18+
"type": "package",
19+
"package": {
20+
"name": "wpackagist-plugin/better-delete-revision",
21+
"version": "1.0",
22+
"source": {
23+
"type": "svn",
24+
"url": "https://plugins.svn.wordpress.org/better-delete-revision/",
25+
"reference": "tags/1.0"
26+
}
27+
}
28+
}
29+
],
30+
"config": {
31+
"allow-plugins": {
32+
"composer/installers": true,
33+
"typisttech/wp-org-closed-plugin": true
34+
},
35+
"audit": {
36+
"abandoned": "fail"
37+
}
38+
}
39+
}
40+
41+
-- golden.out --
42+
{
43+
"advisories": [],
44+
"abandoned": {
45+
"wpackagist-plugin/better-delete-revision": null
46+
}
47+
}

testdata/script/source_open.txtar

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
exec composer config repositories.wp-org-closed-plugin path $PWD
2+
exec composer install
3+
4+
exec composer audit --format=json
5+
6+
cmp stdout golden.out
7+
8+
-- composer.json --
9+
{
10+
"name": "test/example",
11+
"version": "0.0.1",
12+
"require": {
13+
"typisttech/wp-org-closed-plugin": "@dev",
14+
"wpackagist-plugin/hello-dolly": "*"
15+
},
16+
"repositories": [
17+
{
18+
"type": "package",
19+
"package": {
20+
"name": "wpackagist-plugin/hello-dolly",
21+
"version": "1.7.3",
22+
"source": {
23+
"type": "svn",
24+
"url": "https://plugins.svn.wordpress.org/hello-dolly/",
25+
"reference": "tags/1.7.3"
26+
}
27+
}
28+
}
29+
],
30+
"config": {
31+
"allow-plugins": {
32+
"composer/installers": true,
33+
"typisttech/wp-org-closed-plugin": true
34+
},
35+
"audit": {
36+
"abandoned": "fail"
37+
}
38+
}
39+
}
40+
41+
-- golden.out --
42+
{
43+
"advisories": [],
44+
"abandoned": []
45+
}

testdata/script/wpackagist_closed.txtar

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
exec composer config --quiet repositories.wp-org-closed-plugin path $PWD
2-
exec composer install --quiet
1+
exec composer config repositories.wp-org-closed-plugin path $PWD
2+
exec composer install
33

44
! exec composer audit --format=json
55

@@ -8,9 +8,10 @@ cmp stdout golden.out
88
-- composer.json --
99
{
1010
"name": "test/example",
11+
"version": "0.0.1",
1112
"require": {
1213
"typisttech/wp-org-closed-plugin": "@dev",
13-
"wpackagist-plugin/moody": "1.1"
14+
"wpackagist-plugin/moody": "*"
1415
},
1516
"repositories": {
1617
"wpackagist": {

testdata/script/wpackagist_open.txtar

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
exec composer config --quiet repositories.wp-org-closed-plugin path $PWD
2-
exec composer install --quiet
1+
exec composer config repositories.wp-org-closed-plugin path $PWD
2+
exec composer install
33

44
exec composer audit --format=json
55

@@ -8,9 +8,10 @@ cmp stdout golden.out
88
-- composer.json --
99
{
1010
"name": "test/example",
11+
"version": "0.0.1",
1112
"require": {
1213
"typisttech/wp-org-closed-plugin": "@dev",
13-
"wpackagist-plugin/two-factor": "0.11.0"
14+
"wpackagist-plugin/hello-dolly": "*"
1415
},
1516
"repositories": {
1617
"wpackagist": {

tests/Feature/WpOrg/Api/ClientTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
'unknown_permanent' => ['link-linker', true],
2727
'unused' => ['auto-translator', true],
2828
'unused_permanent' => ['spam-stopgap', true],
29+
'unused_permanent_2' => ['update-linkroll', true],
2930

3031
// Not closed.
3132
'open' => ['hello-dolly', false],

0 commit comments

Comments
 (0)