From d7f1c482e79065f65ca965c462cfca8b17de28fd Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Wed, 29 Jun 2022 10:46:12 +0000 Subject: [PATCH] Unused parameter should be replaced by underscore --- internal/bundler/linker.go | 4 ++-- internal/css_ast/css_ast.go | 2 +- internal/css_parser/css_reduce_calc.go | 4 ++-- internal/css_printer/css_printer.go | 2 +- internal/fs/fs_mock.go | 4 ++-- internal/js_lexer/js_lexer_test.go | 2 +- pkg/api/api_impl.go | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/bundler/linker.go b/internal/bundler/linker.go index ec6b691fa4f..01af00eca2f 100644 --- a/internal/bundler/linker.go +++ b/internal/bundler/linker.go @@ -3877,8 +3877,8 @@ func (c *linkerContext) generateCodeForFileInChunkJS( r renamer.Renamer, waitGroup *sync.WaitGroup, partRange partRange, - entryBits helpers.BitSet, - chunkAbsDir string, + _ helpers.BitSet, + _ string, toCommonJSRef js_ast.Ref, toESMRef js_ast.Ref, runtimeRequireRef js_ast.Ref, diff --git a/internal/css_ast/css_ast.go b/internal/css_ast/css_ast.go index 11f33e6e38c..ba193355415 100644 --- a/internal/css_ast/css_ast.go +++ b/internal/css_ast/css_ast.go @@ -310,7 +310,7 @@ type RAtImport struct { ImportRecordIndex uint32 } -func (*RAtImport) Equal(rule R) bool { +func (*RAtImport) Equal(_ R) bool { return false } diff --git a/internal/css_parser/css_reduce_calc.go b/internal/css_parser/css_reduce_calc.go index b28ff56e309..6522a5254f8 100644 --- a/internal/css_parser/css_reduce_calc.go +++ b/internal/css_parser/css_reduce_calc.go @@ -245,7 +245,7 @@ func (c *calcInvert) convertToToken(whitespace css_ast.WhitespaceFlags) (css_ast }, true } -func (c *calcNumeric) convertToToken(whitespace css_ast.WhitespaceFlags) (css_ast.Token, bool) { +func (c *calcNumeric) convertToToken(_ css_ast.WhitespaceFlags) (css_ast.Token, bool) { text, ok := floatToStringForCalc(c.number) if !ok { return css_ast.Token{}, false @@ -269,7 +269,7 @@ func (c *calcNumeric) convertToToken(whitespace css_ast.WhitespaceFlags) (css_as } } -func (c *calcValue) convertToToken(whitespace css_ast.WhitespaceFlags) (css_ast.Token, bool) { +func (c *calcValue) convertToToken(_ css_ast.WhitespaceFlags) (css_ast.Token, bool) { t := c.token t.Whitespace = 0 return t, true diff --git a/internal/css_printer/css_printer.go b/internal/css_printer/css_printer.go index 79530a68829..5bdbd479b55 100644 --- a/internal/css_printer/css_printer.go +++ b/internal/css_printer/css_printer.go @@ -317,7 +317,7 @@ func (p *printer) printComplexSelectors(selectors []css_ast.ComplexSelector, ind } } -func (p *printer) printCompoundSelector(sel css_ast.CompoundSelector, isFirst bool, isLast bool) { +func (p *printer) printCompoundSelector(sel css_ast.CompoundSelector, isFirst bool, _ bool) { if !isFirst && sel.Combinator == "" { // A space is required in between compound selectors if there is no // combinator in the middle. It's fine to convert "a + b" into "a+b" diff --git a/internal/fs/fs_mock.go b/internal/fs/fs_mock.go index e5392850f3f..15d9dac5ef2 100644 --- a/internal/fs/fs_mock.go +++ b/internal/fs/fs_mock.go @@ -69,7 +69,7 @@ func (fs *mockFS) OpenFile(path string) (OpenedFile, error, error) { return nil, syscall.ENOENT, syscall.ENOENT } -func (fs *mockFS) ModKey(path string) (ModKey, error) { +func (fs *mockFS) ModKey(_ string) (ModKey, error) { return ModKey{}, errors.New("This is not available during tests") } @@ -148,7 +148,7 @@ func (*mockFS) Rel(base string, target string) (string, bool) { return commonParent + target, true } -func (fs *mockFS) kind(dir string, base string) (symlink string, kind EntryKind) { +func (fs *mockFS) kind(_ string, _ string) (symlink string, kind EntryKind) { panic("This should never be called") } diff --git a/internal/js_lexer/js_lexer_test.go b/internal/js_lexer/js_lexer_test.go index 363d686d152..e7e54b52e9f 100644 --- a/internal/js_lexer/js_lexer_test.go +++ b/internal/js_lexer/js_lexer_test.go @@ -32,7 +32,7 @@ func assertEqualStrings(t *testing.T, a string, b string) { } } -func lexToken(t *testing.T, contents string) T { +func lexToken(_ *testing.T, contents string) T { log := logger.NewDeferLog(logger.DeferLogNoVerboseOrDebug, nil) lexer := NewLexer(log, test.SourceForTest(contents), config.TSOptions{}) return lexer.Token diff --git a/pkg/api/api_impl.go b/pkg/api/api_impl.go index b282fd2edc1..8bf13637dac 100644 --- a/pkg/api/api_impl.go +++ b/pkg/api/api_impl.go @@ -1251,7 +1251,7 @@ const minItemCountPerIter = 64 // The maximum number of intervals before a change is detected const maxIntervalsBeforeUpdate = 20 -func (w *watcher) start(logLevel LogLevel, color StderrColor, mode WatchMode) { +func (w *watcher) start(logLevel LogLevel, color StderrColor, _ WatchMode) { useColor := validateColor(color) go func() {