Skip to content

Commit

Permalink
Fixed linter issues related to new version
Browse files Browse the repository at this point in the history
  • Loading branch information
codebien committed Jan 31, 2025
1 parent 33d2fc0 commit 1211278
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 15 deletions.
2 changes: 0 additions & 2 deletions cloudapi/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ func (c *Config) logtailConn(ctx context.Context, referenceID string, since time

// StreamLogsToLogger streams the logs for the configured test to the provided logger until ctx is
// Done or an error occurs.
//
//nolint:funlen
func (c *Config) StreamLogsToLogger(
ctx context.Context, logger logrus.FieldLogger, referenceID string, tailFrom time.Duration,
) error {
Expand Down
1 change: 0 additions & 1 deletion internal/cmd/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ func printExecutionDescription(
}
}

//nolint:funlen
func renderMultipleBars(
nocolor, isTTY, goBack bool, maxLeft, termWidth, widthDelta int, pbs []*pb.ProgressBar,
) (string, int) {
Expand Down
4 changes: 3 additions & 1 deletion internal/js/modules/k6/browser/browser/browser_mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import (
)

// mapBrowser to the JS module.
func mapBrowser(vu moduleVU) mapping { //nolint:funlen,gocognit
//
//nolint:gocognit
func mapBrowser(vu moduleVU) mapping {
return mapping{
"context": func() (mapping, error) {
b, err := vu.browser()
Expand Down
2 changes: 1 addition & 1 deletion internal/js/modules/k6/browser/common/element_handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,7 @@ func (h *ElementHandle) newAction(
}
}

//nolint:funlen,gocognit
//nolint:gocognit
func (h *ElementHandle) newPointerAction(
fn elementHandlePointerActionFunc, opts *ElementHandleBasePointerOptions,
) func(apiCtx context.Context, resultCh chan any, errCh chan error) {
Expand Down
2 changes: 0 additions & 2 deletions internal/js/modules/k6/browser/common/frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -1888,8 +1888,6 @@ func (f *Frame) WaitForLoadState(state string, opts sobek.Value) error {
}

// WaitForNavigation waits for the given navigation lifecycle event to happen.
//
//nolint:funlen
func (f *Frame) WaitForNavigation(opts *FrameWaitForNavigationOptions) (*Response, error) {
f.log.Debugf("Frame:WaitForNavigation",
"fid:%s furl:%s", f.ID(), f.URL())
Expand Down
2 changes: 1 addition & 1 deletion internal/js/modules/k6/browser/common/frame_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (fs *FrameSession) initDomains() error {
return nil
}

//nolint:funlen,cyclop
//nolint:cyclop
func (fs *FrameSession) initEvents() {
fs.logger.Debugf("NewFrameSession:initEvents",
"sid:%v tid:%v", fs.session.ID(), fs.targetID)
Expand Down
1 change: 0 additions & 1 deletion internal/js/modules/k6/browser/common/network_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ func (m *NetworkManager) emitRequestMetrics(req *Request) {
})
}

//nolint:funlen
func (m *NetworkManager) emitResponseMetrics(resp *Response, req *Request) {
state := m.vu.State()

Expand Down
1 change: 0 additions & 1 deletion internal/js/modules/k6/browser/common/screenshotter.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ func getViewPortDimensions(ctx context.Context, sess session, logger *log.Logger
return visualViewportScale, visualViewportPageX, visualViewportPageY, nil
}

//nolint:funlen
func (s *screenshotter) screenshotElement(h *ElementHandle, opts *ElementHandleScreenshotOptions) ([]byte, error) {
format := opts.Format
viewportSize, originalViewportSize, err := s.originalViewportSize(h.frame.page)
Expand Down
2 changes: 0 additions & 2 deletions js/modules/k6/http/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ func checkErrorInJSON(input []byte, offset int, err error) error {

// SubmitForm parses the body as an html looking for a from and then submitting it
// TODO: document the actual arguments that can be provided
//
//nolint:funlen
func (res *Response) SubmitForm(args ...sobek.Value) (*Response, error) {
rt := res.client.moduleInstance.vu.Runtime()

Expand Down
2 changes: 1 addition & 1 deletion lib/executor/ramping_vus.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func (vlvc RampingVUsConfig) precalculateTheRequiredSteps(et *lib.ExecutionTuple
// executorEndOffset, is not handled here. Instead GetExecutionRequirements()
// takes care of that. But to make its job easier, this method won't add any
// steps with an offset that's greater or equal to executorEndOffset.
func (vlvc RampingVUsConfig) reserveVUsForGracefulRampDowns( //nolint:funlen
func (vlvc RampingVUsConfig) reserveVUsForGracefulRampDowns(
rawSteps []lib.ExecutionStep, executorEndOffset time.Duration,
) []lib.ExecutionStep {
rawStepsLen := len(rawSteps)
Expand Down
2 changes: 0 additions & 2 deletions lib/netext/httpext/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ func newTransport(

// Helper method to finish the tracer trail, assemble the tag values and emits
// the metric samples for the supplied unfinished request.
//
//nolint:funlen
func (t *transport) measureAndEmitMetrics(unfReq *unfinishedRequest) *finishedRequest {
trail := unfReq.tracer.Done()

Expand Down

0 comments on commit 1211278

Please sign in to comment.