ci: fix linting on windows-only files (#1361)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Andrey Nering · committed by GitHub · parent 6811ae6 · Browse files · 2 files·+9 added−9 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+9 added−9 removed
- other:+9 added−9 removed
Provenance
- Commit
d0c4b65- Tree
0fc162a- Author
Andrey Nering <andreynering@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent
6811ae6
2 files changed+9 added−9 removed
modified:key_windows.go+5 added-5 removed
85 unmodified lines86 err := ctx.Err()87 if err != nil {88 return fmt.Errorf("coninput context error: %w", err)89 }90- return err90+ return nil91 }92 }93 }94 }18 unmodified lines113 button = MouseButtonBackward114 case s&coninput.FROM_LEFT_4TH_BUTTON_PRESSED > 0:115 button = MouseButtonForward116 }117- return117+ return button, action118 }119 120 switch {121 case btn == coninput.FROM_LEFT_1ST_BUTTON_PRESSED: // left button24 unmodified lines146 ev.Button, ev.Action = mouseEventButton(p, e.ButtonState)147 if ev.Action == MouseActionRelease {148 ev.Type = MouseRelease149 }150- switch ev.Button {150+ switch ev.Button { //nolint:exhaustive151 case MouseButtonLeft:152 ev.Type = MouseLeft153 case MouseButtonMiddle:154 ev.Type = MouseMiddle34 unmodified lines189 190 shiftPressed := e.ControlKeyState.Contains(coninput.SHIFT_PRESSED)191 ctrlPressed := e.ControlKeyState.Contains(coninput.LEFT_CTRL_PRESSED | coninput.RIGHT_CTRL_PRESSED)192 193- switch code {193+ switch code { //nolint:exhaustive194 case coninput.VK_RETURN:195 return KeyEnter196 case coninput.VK_BACK:197 return KeyBackspace149 unmodified lines347 case '\x1f':348 return KeyCtrlUnderscore349 }350 351- switch code {351+ switch code { //nolint:exhaustive352 case coninput.VK_OEM_4:353 return KeyCtrlOpenBracket354 case coninput.VK_OEM_6:355 return KeyCtrlCloseBracket5 unmodified linesmodified:tty_windows.go+4 added-4 removed
17 unmodified lines18 if f, ok := p.input.(term.File); ok && term.IsTerminal(f.Fd()) {19 p.ttyInput = f20 p.previousTtyInputState, err = term.MakeRaw(p.ttyInput.Fd())21 if err != nil {22- return err22+ return fmt.Errorf("error making raw: %w", err)23 }24 25 // Enable VT input26 var mode uint3210 unmodified lines37 if f, ok := p.output.(term.File); ok && term.IsTerminal(f.Fd()) {38 p.ttyOutput = f39 p.previousOutputState, err = term.GetState(f.Fd())40 if err != nil {41- return err41+ return fmt.Errorf("error getting state: %w", err)42 }43 44 var mode uint3245 if err := windows.GetConsoleMode(windows.Handle(p.ttyOutput.Fd()), &mode); err != nil {4 unmodified lines50 return fmt.Errorf("error setting console mode: %w", err)51 }52 }53 54- return54+ return nil55 }56 57 // Open the Windows equivalent of a TTY.58 func openInputTTY() (*os.File, error) {59 f, err := os.OpenFile("CONIN$", os.O_RDWR, 0o644)60 if err != nil {61- return nil, err61+ return nil, fmt.Errorf("error opening file: %w", err)62 }63 return f, nil64 }65 3 unmodified lines