Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gen_coverage_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
token: ${{ steps.app-token.outputs.token }}
- name: Set up Go 1.x
id: setup-go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: "1.26"
cache: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go_mod_tidy_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
token: ${{ steps.app-token.outputs.token }}
- name: Set up Go 1.x
id: setup-go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: go.mod
cache: false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint_golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
id: setup-go
with:
go-version-file: go.mod
Expand All @@ -35,4 +35,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
with:
version: v2.10.1
version: v2.11.4
2 changes: 1 addition & 1 deletion .github/workflows/lint_markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
python3 -m venv "$venv"
echo "$venv/bin" >> $GITHUB_PATH
- name: Vale
uses: errata-ai/vale-action@dcded780f1ff68e2558e802a165a484a4a3e2fb8
uses: errata-ai/vale-action@0135b9fe2b3107365569cc3142b9a1c85221ea2f
with:
vale_flags: "--glob=!{docs/testdata/*,CHANGELOG.md,.github/styles/proselint/README.md,examples/simple_plugin/docs/*.md,coverage.md}"
filter_mode: nofilter
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Go 1.x
id: setup-go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: go.mod
cache: false
Expand Down
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ linters:
disabled: true
- name: use-waitgroup-go
disabled: true
- name: package-naming
disabled: true
exclusions:
generated: lax
presets:
Expand Down
7 changes: 4 additions & 3 deletions docs/generator.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package docs

import (
"cmp"
"embed"
"fmt"
"os"
"regexp"
"sort"
"slices"

"github.com/cloudquery/plugin-sdk/v4/caser"
"github.com/cloudquery/plugin-sdk/v4/schema"
Expand Down Expand Up @@ -87,8 +88,8 @@ func DefaultTitleTransformer(table *schema.Table) string {
}

func sortTables(tables schema.Tables) {
sort.SliceStable(tables, func(i, j int) bool {
return tables[i].Name < tables[j].Name
slices.SortStableFunc(tables, func(a, b *schema.Table) int {
return cmp.Compare(a.Name, b.Name)
})

for _, table := range tables {
Expand Down
19 changes: 10 additions & 9 deletions plugin/sort.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package plugin

import (
"sort"
"cmp"
"slices"

"github.com/apache/arrow-go/v18/arrow"
"github.com/apache/arrow-go/v18/arrow/array"
Expand All @@ -18,16 +19,16 @@ func sortRecords(table *schema.Table, records []arrow.RecordBatch, columnName st
panic("table has no '" + columnName + "' column to sort on")
}
colIndex := sch.FieldIndices(columnName)[0]
sort.Slice(records, func(i, j int) bool {
switch records[i].Column(colIndex).DataType().(type) {
slices.SortFunc(records, func(a, b arrow.RecordBatch) int {
switch a.Column(colIndex).DataType().(type) {
case *arrow.Int64Type:
v1 := records[i].Column(colIndex).(*array.Int64).Value(0)
v2 := records[j].Column(colIndex).(*array.Int64).Value(0)
return v1 < v2
v1 := a.Column(colIndex).(*array.Int64).Value(0)
v2 := b.Column(colIndex).(*array.Int64).Value(0)
return cmp.Compare(v1, v2)
case *arrow.StringType:
v1 := records[i].Column(colIndex).(*array.String).Value(0)
v2 := records[j].Column(colIndex).(*array.String).Value(0)
return v1 < v2
v1 := a.Column(colIndex).(*array.String).Value(0)
v2 := b.Column(colIndex).(*array.String).Value(0)
return cmp.Compare(v1, v2)
default:
panic("unsupported type for sorting")
}
Expand Down
4 changes: 2 additions & 2 deletions writers/writers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"math/rand"
"runtime"
"sort"
"slices"
"strconv"
"testing"

Expand Down Expand Up @@ -144,7 +144,7 @@ func writerMatrix[T writers.Writer, C any, O ~func(T)](prefix string, constructo
bCases := make([]bCase, 0, len(optsMatrix))

k := maps.Keys(optsMatrix)
sort.Strings(k)
slices.Sort(k)

for _, name := range k {
opts := optsMatrix[name]
Expand Down
Loading