Skip to content

Commit 31b1aa7

Browse files
committed
chore: u
1 parent 53a4db3 commit 31b1aa7

7 files changed

Lines changed: 44 additions & 24 deletions

File tree

.docker/Dockerfile-alpine

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.20
1+
FROM alpine:3.22
22

33
RUN apk add -U --no-cache ca-certificates libssl3 libcrypto3 bash
44

.golangci.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
1+
version: "2"
12
linters:
3+
exclusions:
4+
generated: lax
5+
presets:
6+
- comments
7+
- common-false-positives
8+
- legacy
9+
- std-error-handling
10+
paths:
11+
- third_party$
12+
- builtin$
13+
- examples$
14+
formatters:
215
enable:
316
- goimports
4-
5-
linters-settings:
6-
goimports:
7-
local-prefixes: github.com/ory
17+
settings:
18+
goimports:
19+
local-prefixes:
20+
- github.com/ory
21+
exclusions:
22+
generated: lax
23+
paths:
24+
- third_party$
25+
- builtin$
26+
- examples$

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export GO111MODULE := on
88
export PATH := .bin:${PATH}
99
export PWD := $(shell pwd)
1010

11-
GOLANGCI_LINT_VERSION = 1.61.0
11+
GOLANGCI_LINT_VERSION = 2.3.1
1212

1313
GO_DEPENDENCIES = github.com/ory/go-acc \
1414
github.com/golang/mock/mockgen \

cmd/cloudx/testhelpers/testhelpers.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"github.com/ory/cli/cmd/cloudx/client"
2727

2828
"github.com/ory/x/cmdx"
29-
. "github.com/ory/x/pointerx"
29+
"github.com/ory/x/pointerx"
3030
"github.com/ory/x/randx"
3131
)
3232

@@ -234,8 +234,8 @@ func SetupPlaywright(t testing.TB) (playwright.Browser, playwright.Page, func())
234234
pw, err := playwright.Run()
235235
require.NoError(t, err)
236236
browser, err := pw.Chromium.Launch(playwright.BrowserTypeLaunchOptions{
237-
Headless: Ptr(true),
238-
TracesDir: Ptr(tracesDir),
237+
Headless: pointerx.Ptr(true),
238+
TracesDir: pointerx.Ptr(tracesDir),
239239
})
240240
require.NoError(t, err)
241241

@@ -250,7 +250,7 @@ func SetupPlaywright(t testing.TB) (playwright.Browser, playwright.Page, func())
250250

251251
func NewPage(t testing.TB, browser playwright.Browser) playwright.Page {
252252
page, err := browser.NewPage(playwright.BrowserNewPageOptions{
253-
BaseURL: Ptr(client.CloudConsoleURL("").String()),
253+
BaseURL: pointerx.Ptr(client.CloudConsoleURL("").String()),
254254
})
255255
require.NoError(t, err)
256256

@@ -290,8 +290,8 @@ func PlaywrightAcceptConsentBrowserHook(t testing.TB, page playwright.Page, emai
290290
t.Logf("open browser with %s", uri)
291291

292292
require.NoError(t, page.Context().Tracing().Start(playwright.TracingStartOptions{
293-
Screenshots: Ptr(true),
294-
Snapshots: Ptr(true),
293+
Screenshots: pointerx.Ptr(true),
294+
Snapshots: pointerx.Ptr(true),
295295
}))
296296
defer func() {
297297
r := recover()

cmd/dev/ci/monorepo/changes.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func getGitDefaults() string {
5959
func getChangedFiles(rootDirectory string, revisionRange string, gitOpts string) (string, error) {
6060
changeLog, err := getRepositoryChangeLog(rootDirectory, revisionRange, gitOpts)
6161
if err != nil {
62-
return "", fmt.Errorf("Error getting changes from Git: %v", err)
62+
return "", fmt.Errorf("error getting changes from Git: %v", err)
6363
}
6464
cleansedChangeLogArray := strings.Split(removeCommitMessages(changeLog), "\n")
6565
cleanseRepositoryChanges(&cleansedChangeLogArray, true, true)
@@ -75,7 +75,7 @@ func getChangedFiles(rootDirectory string, revisionRange string, gitOpts string)
7575
func getChangedDirectories(rootDirectory string, revisionRange string, gitOpts string) (string, error) {
7676
changeLog, err := getRepositoryChangeLog(rootDirectory, revisionRange, gitOpts)
7777
if err != nil {
78-
return "", fmt.Errorf("Error getting changes from Git: %v", err)
78+
return "", fmt.Errorf("error getting changes from Git: %v", err)
7979
}
8080
cleansedChangeLogArray := strings.Split(removeCommitMessages(changeLog), "\n")
8181
cleanseRepositoryChanges(&cleansedChangeLogArray, false, true)
@@ -90,7 +90,7 @@ func getChangedDirectories(rootDirectory string, revisionRange string, gitOpts s
9090
func getChangeLog(rootDirectory string, revisionRange string, gitOpts string) (string, error) {
9191
repoChanges, err := getRepositoryChangeLog(rootDirectory, revisionRange, gitOpts)
9292
if err != nil {
93-
return "", fmt.Errorf("Error getting changes from Git: %v", err)
93+
return "", fmt.Errorf("error getting changes from Git: %v", err)
9494
}
9595

9696
return repoChanges, nil

cmd/dev/ci/monorepo/depgraph.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (graph *ComponentGraph) getComponentGraph(rootDirectory string) (*Component
4949
return nil, err
5050
}
5151
if !isDirectory {
52-
return nil, fmt.Errorf("Provided path '%s' is not a directory", rootDirectory)
52+
return nil, fmt.Errorf("provided path '%s' is not a directory", rootDirectory)
5353
}
5454
if err := filepath.Walk(rootDirectory, func(path string, fi os.FileInfo, err error) error {
5555
if err != nil {
@@ -92,20 +92,20 @@ func isDirectory(path string) (bool, error) {
9292
func (component *Component) getComponentFromConfig(configFilePath, rootDir string) (*Component, error) {
9393
yamlFile, err := os.ReadFile(configFilePath)
9494
if err != nil {
95-
return nil, fmt.Errorf("Config file not found: '%s'", configFilePath)
95+
return nil, fmt.Errorf("config file not found: '%s'", configFilePath)
9696
}
9797
err = yaml.Unmarshal(yamlFile, component)
9898
if err != nil {
99-
return nil, fmt.Errorf("Error reading config file '%s', invalid format: %v", configFilePath, err)
99+
return nil, fmt.Errorf("error reading config file '%s', invalid format: %v", configFilePath, err)
100100
}
101101

102102
configFilePath, err = filepath.Abs(configFilePath)
103103
if err != nil {
104-
return nil, fmt.Errorf("Error determining absolute config file path '%s': %v", configFilePath, err)
104+
return nil, fmt.Errorf("error determining absolute config file path '%s': %v", configFilePath, err)
105105
}
106106
rootDir, err = filepath.Abs(rootDir)
107107
if err != nil {
108-
return nil, fmt.Errorf("Error determining absolute root directory path '%s': %v", rootDir, err)
108+
return nil, fmt.Errorf("error determining absolute root directory path '%s': %v", rootDir, err)
109109
}
110110
rootDir = rootDir + "/"
111111
component.Path = strings.TrimSuffix(strings.TrimPrefix(configFilePath, rootDir), "/"+configFile)
@@ -146,7 +146,7 @@ func (graph *ComponentGraph) resolveGraph() (ComponentGraph, error) {
146146
g.addComponent(graph.componentIDs[id])
147147
}
148148

149-
return g, errors.New("Circular dependency found")
149+
return g, errors.New("circular dependency found")
150150
}
151151

152152
// remove ready components (without dependencies) from the

cmd/dev/headers/copyright.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,12 @@ Does not add the header to files listed in .gitignore and .prettierignore.`,
113113
RunE: func(cmd *cobra.Command, args []string) error {
114114
year, _, _ := time.Now().Date()
115115
var template string
116-
if headerType == headerTypeProprietary {
116+
switch headerType {
117+
case headerTypeProprietary:
117118
template = HEADER_TEMPLATE_PROPRIETARY
118-
} else if headerType == headerTypeOpenSource {
119+
case headerTypeOpenSource:
119120
template = HEADER_TEMPLATE_OPEN_SOURCE
120-
} else {
121+
default:
121122
return fmt.Errorf("unknown value for type, expected one of %q or %q", headerTypeOpenSource, headerTypeProprietary)
122123
}
123124
return AddHeaders(".", fmt.Sprintf(template, year), exclude, regexp.MustCompile(HEADER_REGEXP))

0 commit comments

Comments
 (0)