Skip to content

Commit c6dd67e

Browse files
authored
feat: bump publiccode-parser-go to v5 (#21)
1 parent e62a85d commit c6dd67e

File tree

6 files changed

+21
-8
lines changed

6 files changed

+21
-8
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ jobs:
3939
run: |
4040
mkdir -p "$GITHUB_WORKSPACE/bin"
4141
go build -C go-src -o "$GITHUB_WORKSPACE/bin/publiccode-parser" \
42-
github.com/italia/publiccode-parser-go/v4/publiccode-parser
42+
github.com/italia/publiccode-parser-go/v5/publiccode-parser
4343
4444
- run: echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
4545

4646
- run: |
47-
VERSION=$(go list -C go-src -m -f '{{.Version}}' github.com/italia/publiccode-parser-go/v4)
47+
VERSION=$(go list -C go-src -m -f '{{.Version}}' github.com/italia/publiccode-parser-go/v5)
4848
git clone --depth 1 --branch $VERSION https://github.com/italia/publiccode-parser-go.git /tmp/publiccode-parser-go
4949
mv /tmp/publiccode-parser-go/testdata/* tests/fixtures/testdata/
5050

go-src/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module publiccode-parser-wrapper
22

33
go 1.24.5
44

5-
require github.com/italia/publiccode-parser-go/v4 v4.3.7
5+
require github.com/italia/publiccode-parser-go/v5 v5.1.1
66

77
require (
88
github.com/Jeffail/gabs v1.4.0 // indirect

go-src/go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ github.com/go-playground/validator/v10 v10.18.0 h1:BvolUXjp4zuvkZ5YN5t7ebzbhlUtP
2121
github.com/go-playground/validator/v10 v10.18.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
2222
github.com/italia/httpclient-lib-go v0.0.2 h1:4bJLywTVd7qHPdKxJXvvhlXp436JTC4KA6dLhIl5a6c=
2323
github.com/italia/httpclient-lib-go v0.0.2/go.mod h1:b0/D3ULsBw8X+zEl7j/kSZmiMlUdj+agppneOvSq6eA=
24-
github.com/italia/publiccode-parser-go/v4 v4.3.7 h1:TaqjbA1Cu1OFsxf8K18k3WSUi19pnpyQF0FD7DGIXxo=
25-
github.com/italia/publiccode-parser-go/v4 v4.3.7/go.mod h1:a6Hh7o2TeSZcJkEjHdXU7A/kyHyJDVhnCPO6sT81lbo=
24+
github.com/italia/publiccode-parser-go/v5 v5.1.0 h1:gBfi+2JjuKsSjwmSkdDFbuZRqh1xZUm2DPXH4TXrs/Y=
25+
github.com/italia/publiccode-parser-go/v5 v5.1.0/go.mod h1:xndoanQHcweEnJlubntvOHlT/cvde0eFDF59O5PwuCg=
26+
github.com/italia/publiccode-parser-go/v5 v5.1.1 h1:XVuWXNohNJfSvvXO3OjBoKJU09UELEtRXFpkSwOttvg=
27+
github.com/italia/publiccode-parser-go/v5 v5.1.1/go.mod h1:xndoanQHcweEnJlubntvOHlT/cvde0eFDF59O5PwuCg=
2628
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
2729
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
2830
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=

go-src/publiccode-parser-wrapper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
"strings"
3131
"unsafe"
3232

33-
"github.com/italia/publiccode-parser-go/v4"
33+
"github.com/italia/publiccode-parser-go/v5"
3434
)
3535

3636
//export NewParser

src/PublicCodeV0.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ public function getRepoOwner(): ?string
100100
return $this->data['legal']['repoOwner'] ?? null;
101101
}
102102

103-
public function getCategories(): array
103+
public function getCategories(): ?array
104104
{
105-
return $this->data['categories'];
105+
return $this->data['categories'] ?? null;
106106
}
107107

108108
public function getRoadmap(): ?string
@@ -124,6 +124,16 @@ public function getReleaseDate(): ?\DateTimeInterface
124124
return new \DateTime($this->data['releaseDate']);
125125
}
126126

127+
public function getOrganisationName(): ?string
128+
{
129+
return $this->data['organisation']['name'] ?? null;
130+
}
131+
132+
public function getOrganisationUri(): ?string
133+
{
134+
return $this->data['organisation']['uri'] ?? null;
135+
}
136+
127137
public function getDevelopmentStatus(): string
128138
{
129139
return $this->data['developmentStatus'];

tests/ParserTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public function testPublicCodeAccessors(): void
5656
$this->assertEquals('community', $maintenance['type']);
5757

5858
$categories = $publicCode->getCategories();
59+
$this->assertNotNull($categories);
5960
$this->assertContains('cloud-management', $categories);
6061
}
6162

0 commit comments

Comments
 (0)