feat(codegen): rename "fields" to "codegen" for more meaningful naming
This commit is contained in:
committed by
Mateusz Filipowicz
parent
f396b2f712
commit
e629288cba
9
.github/workflows/ci.yaml
vendored
9
.github/workflows/ci.yaml
vendored
@@ -19,7 +19,7 @@ jobs:
|
|||||||
- uses: 'actions/setup-go@v5'
|
- uses: 'actions/setup-go@v5'
|
||||||
- run: 'go build ./...'
|
- run: 'go build ./...'
|
||||||
|
|
||||||
generate:
|
stringer:
|
||||||
needs: 'build'
|
needs: 'build'
|
||||||
runs-on: 'ubuntu-latest'
|
runs-on: 'ubuntu-latest'
|
||||||
steps:
|
steps:
|
||||||
@@ -49,3 +49,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: 'actions/checkout@v4'
|
- uses: 'actions/checkout@v4'
|
||||||
- uses: 'ibiqlik/action-yamllint@v3'
|
- 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"
|
||||||
|
|||||||
8
.github/workflows/generate.yaml
vendored
8
.github/workflows/generate.yaml
vendored
@@ -4,9 +4,10 @@ on:
|
|||||||
schedule:
|
schedule:
|
||||||
- cron: "0 0 * * *"
|
- cron: "0 0 * * *"
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
pull_request: {}
|
|
||||||
|
|
||||||
permissions: "write-all"
|
permissions:
|
||||||
|
contents: "write"
|
||||||
|
pull-requests: "write"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
fields:
|
fields:
|
||||||
@@ -16,9 +17,8 @@ jobs:
|
|||||||
|
|
||||||
- uses: "actions/setup-go@v5"
|
- uses: "actions/setup-go@v5"
|
||||||
|
|
||||||
|
|
||||||
- name: "Generate new client structures"
|
- name: "Generate new client structures"
|
||||||
run: 'go generate unifi/fields.go'
|
run: 'go generate unifi/codegen.go'
|
||||||
|
|
||||||
- name: "Read Unifi version marker"
|
- name: "Read Unifi version marker"
|
||||||
id: "unifi_version"
|
id: "unifi_version"
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,5 +1,6 @@
|
|||||||
# Cache
|
# Cache
|
||||||
/fields/v*.*.*/
|
/fields/v*.*.*/
|
||||||
|
/codegen/v*.*.*/
|
||||||
|
|
||||||
# goreleaser
|
# goreleaser
|
||||||
/dist/
|
/dist/
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
@@ -17,6 +16,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/iancoleman/strcase"
|
"github.com/iancoleman/strcase"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
"github.com/ulikunitz/xz"
|
"github.com/ulikunitz/xz"
|
||||||
"github.com/xor-gate/ar"
|
"github.com/xor-gate/ar"
|
||||||
)
|
)
|
||||||
@@ -22,6 +22,7 @@ func setupLogging(debugEnabled, traceEnabled bool) {
|
|||||||
log.SetFormatter(&log.TextFormatter{
|
log.SetFormatter(&log.TextFormatter{
|
||||||
DisableTimestamp: true,
|
DisableTimestamp: true,
|
||||||
DisableLevelTruncation: true,
|
DisableLevelTruncation: true,
|
||||||
|
ForceColors: true,
|
||||||
FullTimestamp: false,
|
FullTimestamp: false,
|
||||||
})
|
})
|
||||||
if traceEnabled {
|
if traceEnabled {
|
||||||
@@ -2,4 +2,4 @@ package unifi
|
|||||||
|
|
||||||
// This will generate the *.generated.go files in this package for the specified
|
// This will generate the *.generated.go files in this package for the specified
|
||||||
// Unifi controller version.
|
// Unifi controller version.
|
||||||
//go:generate go run ../fields/ -version-base-dir=../fields/ latest
|
//go:generate go run ../codegen/ -version-base-dir=../codegen/ latest
|
||||||
Reference in New Issue
Block a user