Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linter: re-enable the linter #699

Merged
merged 2 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,6 @@ jobs:
# lint code
########################
lint:
# Temporarily disabling the linter while this issue persists:
# https://github.com/golangci/golangci-lint/discussions/1920
if: false
name: lint
runs-on: ubuntu-latest
steps:
Expand Down
11 changes: 0 additions & 11 deletions accounts/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,6 @@ func (m *mockLnd) assertNoMainErr(t *testing.T) {
}
}

func (m *mockLnd) assertMainErr(t *testing.T, expectedErr error) {
select {
case err := <-m.mainErrChan:
require.Equal(t, expectedErr, err)

case <-time.After(testTimeout):
t.Fatalf("Did not get expected main err before timeout")
}
}

// assertMainErrContains asserts that the main error contains the expected error
// string.
func (m *mockLnd) assertMainErrContains(t *testing.T, expectedStr string) {
Expand Down Expand Up @@ -408,7 +398,6 @@ func TestAccountService(t *testing.T) {
lnd.assertMainErrContains(
t, "not mapped to any account",
)

},
}, {
name: "err in payment update chan",
Expand Down
32 changes: 15 additions & 17 deletions cmd/litcli/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,17 @@ var createAccountCommand = cli.Command{
ShortName: "c",
Usage: "Create a new off-chain account with a balance.",
ArgsUsage: "balance [expiration_date] [--label=LABEL] [--save_to=FILE]",
Description: "Adds an entry to the account database. " +
"This entry represents an amount of satoshis (account " +
"balance) that can be spent using off-chain transactions " +
"(e.g. paying invoices).\n\n" +

" Macaroons can be created to be locked to an account. " +
"This makes sure that the bearer of the macaroon can only " +
"spend at most that amount of satoshis through the daemon " +
"that has issued the macaroon.\n\n" +

" Accounts only assert a maximum amount spendable. Having " +
"a certain account balance does not guarantee that the node " +
"has the channel liquidity to actually spend that amount.",
Description: `Adds an entry to the account database.
This entry represents an amount of satoshis (account balance) that can be spent
using off-chain transactions (e.g. paying invoices).

Macaroons can be created to be locked to an account. This makes sure that the
bearer of the macaroon can only spend at most that amount of satoshis through
the daemon that has issued the macaroon.

Accounts only assert a maximum amount spendable. Having a certain account
balance does not guarantee that the node has the channel liquidity to actually
spend that amount.`,
Flags: []cli.Flag{
cli.Uint64Flag{
Name: "balance",
Expand Down Expand Up @@ -315,10 +313,10 @@ func accountInfo(ctx *cli.Context) error {
}

var removeAccountCommand = cli.Command{
Name: "remove",
ShortName: "r",
Usage: "Remove an off-chain account from the database.",
ArgsUsage: "[id | label]",
Name: "remove",
ShortName: "r",
Usage: "Remove an off-chain account from the database.",
ArgsUsage: "[id | label]",
Description: "Removes an account entry from the account database.",
Flags: []cli.Flag{
cli.StringFlag{
Expand Down
6 changes: 3 additions & 3 deletions cmd/litcli/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
)

var listActionsCommand = cli.Command{
Name: "actions",
Usage: "List actions performed on the Litd server",
Name: "actions",
Usage: "List actions performed on the Litd server",
Category: "Firewall",
Action: listActions,
Action: listActions,
Flags: []cli.Flag{
cli.StringFlag{
Name: "feature",
Expand Down
24 changes: 12 additions & 12 deletions cmd/litcli/autopilot.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ var autopilotCommands = cli.Command{
}

var listAutopilotFeaturesCmd = cli.Command{
Name: "features",
ShortName: "f",
Usage: "List available Autopilot features.",
Name: "features",
ShortName: "f",
Usage: "List available Autopilot features.",
Description: "List available Autopilot features.",
Action: listFeatures,
Action: listFeatures,
}

var addAutopilotSessionCmd = cli.Command{
Expand Down Expand Up @@ -85,11 +85,11 @@ var addAutopilotSessionCmd = cli.Command{
}

var revokeAutopilotSessionCmd = cli.Command{
Name: "revoke",
ShortName: "r",
Usage: "Revoke an Autopilot session.",
Name: "revoke",
ShortName: "r",
Usage: "Revoke an Autopilot session.",
Description: "Revoke an active Autopilot session.",
Action: revokeAutopilotSession,
Action: revokeAutopilotSession,
Flags: []cli.Flag{
cli.StringFlag{
Name: "localpubkey",
Expand All @@ -101,11 +101,11 @@ var revokeAutopilotSessionCmd = cli.Command{
}

var listAutopilotSessionsCmd = cli.Command{
Name: "list",
ShortName: "l",
Usage: "List all Autopilot sessions.",
Name: "list",
ShortName: "l",
Usage: "List all Autopilot sessions.",
Description: "List all Autopilot sessions.\n",
Action: listAutopilotSessions,
Action: listAutopilotSessions,
}

func revokeAutopilotSession(ctx *cli.Context) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/litcli/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var helperCommands = cli.Command{
Name: "helper",
Usage: "Helper commands",
Description: "Helper commands.",
Category: "LiT",
Category: "LiT",
Subcommands: []cli.Command{
generateSuperMacRootIDCmd,
isSuperMacaroonCmd,
Expand Down
4 changes: 2 additions & 2 deletions cmd/litcli/sessions.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ var (
defaultSessionExpiry = time.Hour * 24 * 90

labelFlag = cli.StringFlag{
Name: "label",
Usage: "The session label.",
Name: "label",
Usage: "The session label.",
Required: true,
}
expiryFlag = cli.Uint64Flag{
Expand Down
2 changes: 1 addition & 1 deletion cmd/litcli/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var statusCommands = []cli.Command{
Usage: "View info about litd status",
Description: "View info about litd status.\n",
Category: "LiT",
Action: getStatus,
Action: getStatus,
},
}

Expand Down