diff --git a/.github/workflows/actions.yaml b/.github/workflows/actions.yaml index c59ed8c..5f438ce 100644 --- a/.github/workflows/actions.yaml +++ b/.github/workflows/actions.yaml @@ -23,7 +23,7 @@ jobs: - uses: WillAbides/setup-go-faster@v1.8.0 with: go-version: ${{ matrix.go }} - - run: "go test ./internal/..." + - run: "go test ./pkg/..." reports: name: "Run various reports on code basis" diff --git a/Makefile b/Makefile index 2e7bc8c..aa1a08d 100644 --- a/Makefile +++ b/Makefile @@ -67,25 +67,24 @@ report-cyclo: @echo '####################################################################' gocyclo ./cmd/cciu report-mispell: - @echo '####################################################################' - misspell ./cmd/ + report-ineffassign: @echo '####################################################################' - ineffassign ./cmd/... ./internal/... + ineffassign ./cmd/... ./pkg/... report-vet: @echo '####################################################################' - go vet ./cmd/... ./internal/... + go vet ./cmd/... ./pkg/... report-staticcheck: @echo '####################################################################' - staticcheck ./cmd/... ./internal/... + staticcheck ./cmd/... ./pkg/... report-vuln: @echo '####################################################################' - govulncheck ./... + govulncheck ./cmd/... ./pkg/... report-gosec: @echo '####################################################################' - gosec ./... + gosec ./cmd/... ./pkg/... report-grype: @echo '####################################################################' diff --git a/cmd/cciu/filter.go b/cmd/cciu/filter.go index 194231c..fd3ac92 100644 --- a/cmd/cciu/filter.go +++ b/cmd/cciu/filter.go @@ -5,7 +5,7 @@ import ( "github.com/Masterminds/semver/v3" - "github.com/mgumz/cciu/internal/tag" + "github.com/mgumz/cciu/pkg/tag" ) const ( diff --git a/cmd/cciu/main.go b/cmd/cciu/main.go index a7a62db..136d028 100644 --- a/cmd/cciu/main.go +++ b/cmd/cciu/main.go @@ -9,12 +9,12 @@ import ( "github.com/Masterminds/semver/v3" - "github.com/mgumz/cciu/internal/imagespec" - "github.com/mgumz/cciu/internal/printer" - "github.com/mgumz/cciu/internal/registry" - "github.com/mgumz/cciu/internal/registry/fetcher" - "github.com/mgumz/cciu/internal/stats" - "github.com/mgumz/cciu/internal/tag" + "github.com/mgumz/cciu/pkg/imagespec" + "github.com/mgumz/cciu/pkg/printer" + "github.com/mgumz/cciu/pkg/registry" + "github.com/mgumz/cciu/pkg/registry/fetcher" + "github.com/mgumz/cciu/pkg/stats" + "github.com/mgumz/cciu/pkg/tag" ) type cciuRepoTags struct { diff --git a/internal/imagespec/imagespec.go b/pkg/imagespec/imagespec.go similarity index 100% rename from internal/imagespec/imagespec.go rename to pkg/imagespec/imagespec.go diff --git a/internal/imagespec/normalize.go b/pkg/imagespec/normalize.go similarity index 100% rename from internal/imagespec/normalize.go rename to pkg/imagespec/normalize.go diff --git a/internal/imagespec/normalize_test.go b/pkg/imagespec/normalize_test.go similarity index 100% rename from internal/imagespec/normalize_test.go rename to pkg/imagespec/normalize_test.go diff --git a/internal/imagespec/split.go b/pkg/imagespec/split.go similarity index 100% rename from internal/imagespec/split.go rename to pkg/imagespec/split.go diff --git a/internal/imagespec/split_test.go b/pkg/imagespec/split_test.go similarity index 100% rename from internal/imagespec/split_test.go rename to pkg/imagespec/split_test.go diff --git a/internal/printer/json_printer.go b/pkg/printer/json_printer.go similarity index 98% rename from internal/printer/json_printer.go rename to pkg/printer/json_printer.go index b6ab3d2..9bb7e4b 100644 --- a/internal/printer/json_printer.go +++ b/pkg/printer/json_printer.go @@ -7,7 +7,7 @@ import ( "github.com/Masterminds/semver/v3" - "github.com/mgumz/cciu/internal/stats" + "github.com/mgumz/cciu/pkg/stats" ) // JSONPrinter collects the requested images, the fetched tags and creates diff --git a/internal/printer/printer.go b/pkg/printer/printer.go similarity index 91% rename from internal/printer/printer.go rename to pkg/printer/printer.go index bea232f..421a2ff 100644 --- a/internal/printer/printer.go +++ b/pkg/printer/printer.go @@ -5,7 +5,7 @@ import ( "github.com/Masterminds/semver/v3" - "github.com/mgumz/cciu/internal/stats" + "github.com/mgumz/cciu/pkg/stats" ) // Printer describes the interface for a cciu printer - a helper for controlled diff --git a/internal/printer/text_printer.go b/pkg/printer/text_printer.go similarity index 98% rename from internal/printer/text_printer.go rename to pkg/printer/text_printer.go index 159a7de..c8ffa16 100644 --- a/internal/printer/text_printer.go +++ b/pkg/printer/text_printer.go @@ -7,7 +7,7 @@ import ( "github.com/Masterminds/semver/v3" - "github.com/mgumz/cciu/internal/stats" + "github.com/mgumz/cciu/pkg/stats" ) const ( diff --git a/internal/registry/fetcher/per_registry.go b/pkg/registry/fetcher/per_registry.go similarity index 100% rename from internal/registry/fetcher/per_registry.go rename to pkg/registry/fetcher/per_registry.go diff --git a/internal/registry/fetcher/simple.go b/pkg/registry/fetcher/simple.go similarity index 95% rename from internal/registry/fetcher/simple.go rename to pkg/registry/fetcher/simple.go index b7258e3..875461d 100644 --- a/internal/registry/fetcher/simple.go +++ b/pkg/registry/fetcher/simple.go @@ -3,7 +3,7 @@ package fetcher import ( "time" - "github.com/mgumz/cciu/internal/repo" + "github.com/mgumz/cciu/pkg/repo" ) // Simple defines a simple registry.Fetcher which is just a tiny wrapper around diff --git a/internal/registry/registry.go b/pkg/registry/registry.go similarity index 100% rename from internal/registry/registry.go rename to pkg/registry/registry.go diff --git a/internal/repo/fetch.go b/pkg/repo/fetch.go similarity index 100% rename from internal/repo/fetch.go rename to pkg/repo/fetch.go diff --git a/internal/repo/repo.go b/pkg/repo/repo.go similarity index 100% rename from internal/repo/repo.go rename to pkg/repo/repo.go diff --git a/internal/stats/stats.go b/pkg/stats/stats.go similarity index 100% rename from internal/stats/stats.go rename to pkg/stats/stats.go diff --git a/internal/tag/filter.go b/pkg/tag/filter.go similarity index 100% rename from internal/tag/filter.go rename to pkg/tag/filter.go diff --git a/internal/tag/tags.go b/pkg/tag/tags.go similarity index 100% rename from internal/tag/tags.go rename to pkg/tag/tags.go diff --git a/internal/tag/tags_test.go b/pkg/tag/tags_test.go similarity index 100% rename from internal/tag/tags_test.go rename to pkg/tag/tags_test.go