Skip to content

Commit 9bfcd15

Browse files
authored
feat: support parsing pubspec.lock (#159)
1 parent e519b86 commit 9bfcd15

18 files changed

+460
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ The detector supports parsing the following lockfiles:
6161
| `go.mod` | `Go` | `go mod` |
6262
| `mix.lock` | `Hex` | `mix` |
6363
| `poetry.lock` | `PyPI` | `poetry` |
64+
| `pubspec.lock` | `Pub` | `pub` |
6465
| `pom.xml`\* | `Maven` | `maven` |
6566
| `requirements.txt`\* | `PyPI` | `pip` |
6667

internal/reporter/reporter_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ func TestReporter_PrintKnownEcosystems(t *testing.T) {
272272
" Hex",
273273
" Maven",
274274
" PyPI",
275+
" Pub",
275276
"",
276277
}, "\n")
277278

main_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ func TestRun(t *testing.T) {
131131
pnpm-lock.yaml
132132
poetry.lock
133133
pom.xml
134+
pubspec.lock
134135
requirements.txt
135136
yarn.lock
136137
csv-file

pkg/lockfile/ecosystems.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ func KnownEcosystems() []Ecosystem {
1010
MixEcosystem,
1111
MavenEcosystem,
1212
PipEcosystem,
13+
PubEcosystem,
1314
}
1415
}

pkg/lockfile/fixtures/pub/empty.lock

Whitespace-only changes.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Generated by pub
2+
# See http://pub.dartlang.org/doc/glossary.html#lockfile
3+
packages:
4+
back_button_interceptor:
5+
dependency: "direct main"
6+
description:
7+
name: back_button_interceptor
8+
url: "https://pub.dartlang.org"
9+
source: hosted
10+
version: "6.0.1"
11+
build_runner:
12+
dependency: "direct dev"
13+
description:
14+
name: build_runner
15+
url: "https://pub.dartlang.org"
16+
source: hosted
17+
version: "2.2.1"
18+
shelf:
19+
dependency: transitive
20+
description:
21+
name: shelf
22+
url: "https://pub.dartlang.org"
23+
source: hosted
24+
version: "1.3.2"
25+
shelf_web_socket:
26+
dependency: transitive
27+
description:
28+
name: shelf_web_socket
29+
url: "https://pub.dartlang.org"
30+
source: hosted
31+
version: "1.0.2"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Generated by pub
2+
# See http://pub.dartlang.org/doc/glossary.html#lockfile
3+
packages: {}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
this is not valid yaml!
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Generated by pub
2+
# See http://pub.dartlang.org/doc/glossary.html#lockfile
3+
packages:
4+
build_runner:
5+
dependency: "direct dev"
6+
description:
7+
name: build_runner
8+
url: "https://pub.dartlang.org"
9+
source: hosted
10+
version: "2.2.1"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Generated by pub
2+
# See http://pub.dartlang.org/doc/glossary.html#lockfile
3+
packages:
4+
back_button_interceptor:
5+
dependency: "direct main"
6+
description:
7+
name: back_button_interceptor
8+
url: "https://pub.dartlang.org"
9+
source: hosted
10+
version: "6.0.1"

0 commit comments

Comments
 (0)