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
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,19 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: "1.23"
# gofmt is a standalone binary and does not follow the toolchain
# switch that go.mod's `go 1.25.0` triggers for go commands, so this
# job pins the version the module requires.
go-version: "1.25"

- name: Format check
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "gofmt -w . is needed for:"
echo "$unformatted"
exit 1
fi

- name: Vet
run: go vet ./...
Expand Down
14 changes: 7 additions & 7 deletions internal/cli/download_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import (

func newDownloadCmd() *cobra.Command {
var (
fromFile string
urlsFile string
singleURL string
outputDir string
parallel int
fromFile string
urlsFile string
singleURL string
outputDir string
parallel int
maxSamples int
dryRun bool
force bool
dryRun bool
force bool
)

cmd := &cobra.Command{
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/query_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (

cols "github.com/allthebacteria/atb-cli/internal/columns"
idx "github.com/allthebacteria/atb-cli/internal/index"
pq "github.com/allthebacteria/atb-cli/internal/parquet"
"github.com/allthebacteria/atb-cli/internal/output"
pq "github.com/allthebacteria/atb-cli/internal/parquet"
"github.com/allthebacteria/atb-cli/internal/query"
"github.com/allthebacteria/atb-cli/internal/suggest"
)
Expand Down
56 changes: 28 additions & 28 deletions internal/index/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,40 +72,40 @@ type QueryParams struct {

// userColToSQL maps user-facing column names to SQLite column names.
var userColToSQL = map[string]string{
"sample_accession": "sample_accession",
"run_accession": "run_accession",
"assembly_accession": "assembly_accession",
"sylph_species": "sylph_species",
"hq_filter": "hq_filter",
"asm_fasta_on_osf": "asm_fasta_on_osf",
"dataset": "dataset",
"scientific_name": "scientific_name",
"aws_url": "aws_url",
"osf_tarball_url": "osf_tarball_url",
"total_length": "total_length",
"number": "num_contigs",
"N50": "n50",
"N90": "n90",
"sample_accession": "sample_accession",
"run_accession": "run_accession",
"assembly_accession": "assembly_accession",
"sylph_species": "sylph_species",
"hq_filter": "hq_filter",
"asm_fasta_on_osf": "asm_fasta_on_osf",
"dataset": "dataset",
"scientific_name": "scientific_name",
"aws_url": "aws_url",
"osf_tarball_url": "osf_tarball_url",
"total_length": "total_length",
"number": "num_contigs",
"N50": "n50",
"N90": "n90",
"Completeness_General": "completeness",
"Contamination": "contamination",
"Genome_Size": "genome_size",
"GC_Content": "gc_content",
"mlst_scheme": "mlst_scheme",
"mlst_st": "mlst_st",
"mlst_status": "mlst_status",
"mlst_score": "mlst_score",
"mlst_alleles": "mlst_alleles",
"Contamination": "contamination",
"Genome_Size": "genome_size",
"GC_Content": "gc_content",
"mlst_scheme": "mlst_scheme",
"mlst_st": "mlst_st",
"mlst_status": "mlst_status",
"mlst_score": "mlst_score",
"mlst_alleles": "mlst_alleles",
}

// sqlToUserCol is the reverse mapping, used when building result maps.
var sqlToUserCol = map[string]string{
"num_contigs": "number",
"n50": "N50",
"n90": "N90",
"completeness": "Completeness_General",
"num_contigs": "number",
"n50": "N50",
"n90": "N90",
"completeness": "Completeness_General",
"contamination": "Contamination",
"genome_size": "Genome_Size",
"gc_content": "GC_Content",
"genome_size": "Genome_Size",
"gc_content": "GC_Content",
}

// allSQLCols is the full list of columns in SELECT order.
Expand Down
8 changes: 4 additions & 4 deletions internal/query/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,10 @@ func TestParseCollectionDate(t *testing.T) {
return t
}
cases := []struct {
in string
wantOK bool
wantStart time.Time
wantEnd time.Time
in string
wantOK bool
wantStart time.Time
wantEnd time.Time
}{
{"2020-05-15", true, d("2020-05-15"), d("2020-05-15")},
{"2020-05", true, d("2020-05-01"), d("2020-05-31")},
Expand Down
6 changes: 3 additions & 3 deletions internal/selfupdate/selfupdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
)

const (
repo = "allthebacteria/atb-cli"
checkInterval = 24 * time.Hour
stateFileName = "update-state.json"
repo = "allthebacteria/atb-cli"
checkInterval = 24 * time.Hour
stateFileName = "update-state.json"
)

type Release struct {
Expand Down
Loading