feat(codegen): rename "fields" to "codegen" for more meaningful naming

This commit is contained in:
Mateusz Filipowicz
2025-02-07 17:17:09 +01:00
committed by Mateusz Filipowicz
parent f396b2f712
commit e629288cba
12 changed files with 16 additions and 7 deletions

View File

@@ -19,7 +19,7 @@ jobs:
- uses: 'actions/setup-go@v5'
- run: 'go build ./...'
generate:
stringer:
needs: 'build'
runs-on: 'ubuntu-latest'
steps:
@@ -49,3 +49,10 @@ jobs:
steps:
- uses: 'actions/checkout@v4'
- uses: 'ibiqlik/action-yamllint@v3'
test-codegen:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-go@v5"
- run: "go generate unifi/codegen.go"

View File

@@ -4,9 +4,10 @@ on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch: {}
pull_request: {}
permissions: "write-all"
permissions:
contents: "write"
pull-requests: "write"
jobs:
fields:
@@ -16,9 +17,8 @@ jobs:
- uses: "actions/setup-go@v5"
- name: "Generate new client structures"
run: 'go generate unifi/fields.go'
run: 'go generate unifi/codegen.go'
- name: "Read Unifi version marker"
id: "unifi_version"

1
.gitignore vendored
View File

@@ -1,5 +1,6 @@
# Cache
/fields/v*.*.*/
/codegen/v*.*.*/
# goreleaser
/dist/

View File

@@ -7,7 +7,6 @@ import (
"encoding/json"
"errors"
"fmt"
log "github.com/sirupsen/logrus"
"io"
"net/http"
"net/url"
@@ -17,6 +16,7 @@ import (
"strings"
"github.com/iancoleman/strcase"
log "github.com/sirupsen/logrus"
"github.com/ulikunitz/xz"
"github.com/xor-gate/ar"
)

View File

@@ -22,6 +22,7 @@ func setupLogging(debugEnabled, traceEnabled bool) {
log.SetFormatter(&log.TextFormatter{
DisableTimestamp: true,
DisableLevelTruncation: true,
ForceColors: true,
FullTimestamp: false,
})
if traceEnabled {

View File

@@ -2,4 +2,4 @@ package unifi
// This will generate the *.generated.go files in this package for the specified
// Unifi controller version.
//go:generate go run ../fields/ -version-base-dir=../fields/ latest
//go:generate go run ../codegen/ -version-base-dir=../codegen/ latest