Skip to content

Commit

Permalink
multi: rename nolint:lll to nolint:ll
Browse files Browse the repository at this point in the history
Find and replace all nolint instances refering to the `lll` linter and
replace with `ll` which is the name of our custom version of the `lll`
linter which can be used to ignore log lines during linting.

The next commit will do the configuration of the custom linter and
disable the default one.
  • Loading branch information
ellemouton committed Dec 2, 2024
1 parent 88f5369 commit ab7aae0
Show file tree
Hide file tree
Showing 123 changed files with 286 additions and 286 deletions.
6 changes: 3 additions & 3 deletions build/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (

// LogConfig holds logging configuration options.
//
//nolint:lll
//nolint:ll
type LogConfig struct {
Console *consoleLoggerCfg `group:"console" namespace:"console" description:"The logger writing to stdout and stderr."`
File *FileLoggerConfig `group:"file" namespace:"file" description:"The logger writing to LND's standard log file."`
Expand All @@ -41,7 +41,7 @@ func (c *LogConfig) Validate() error {

// LoggerConfig holds options for a particular logger.
//
//nolint:lll
//nolint:ll
type LoggerConfig struct {
Disable bool `long:"disable" description:"Disable this logger."`
NoTimestamps bool `long:"no-timestamps" description:"Omit timestamps from log lines."`
Expand Down Expand Up @@ -89,7 +89,7 @@ func (cfg *LoggerConfig) HandlerOptions() []btclog.HandlerOption {

// FileLoggerConfig extends LoggerConfig with specific log file options.
//
//nolint:lll
//nolint:ll
type FileLoggerConfig struct {
LoggerConfig
Compressor string `long:"compressor" description:"Compression algorithm to use when rotating logs." choice:"gzip" choice:"zstd"`
Expand Down
2 changes: 1 addition & 1 deletion build/config_dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
// consoleLoggerCfg extends the LoggerConfig struct by adding a Color option
// which is only available for a console logger.
//
//nolint:lll
//nolint:ll
type consoleLoggerCfg struct {
LoggerConfig
Style bool `long:"style" description:"If set, the output will be styled with color and fonts"`
Expand Down
2 changes: 1 addition & 1 deletion build/config_prod.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package build
// consoleLoggerCfg embeds the LoggerConfig struct along with any extensions
// specific to a production deployment.
//
//nolint:lll
//nolint:ll
type consoleLoggerCfg struct {
LoggerConfig
}
Expand Down
4 changes: 2 additions & 2 deletions chainntnfs/bitcoindnotify/bitcoind.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ out:
// TODO(wilmer): add retry logic if rescan fails?
b.wg.Add(1)

//nolint:lll
//nolint:ll
go func(msg *chainntnfs.HistoricalConfDispatch) {
defer b.wg.Done()

Expand Down Expand Up @@ -301,7 +301,7 @@ out:
// TODO(wilmer): add retry logic if rescan fails?
b.wg.Add(1)

//nolint:lll
//nolint:ll
go func(msg *chainntnfs.HistoricalSpendDispatch) {
defer b.wg.Done()

Expand Down
2 changes: 1 addition & 1 deletion chainntnfs/btcdnotify/btcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ out:
// TODO(wilmer): add retry logic if rescan fails?
b.wg.Add(1)

//nolint:lll
//nolint:ll
go func(msg *chainntnfs.HistoricalConfDispatch) {
defer b.wg.Done()

Expand Down
2 changes: 1 addition & 1 deletion chainntnfs/neutrinonotify/neutrino.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ func (n *NeutrinoNotifier) notificationDispatcher() {
// potentially long rescans.
n.wg.Add(1)

//nolint:lll
//nolint:ll
go func(msg *chainntnfs.HistoricalConfDispatch) {
defer n.wg.Done()

Expand Down
2 changes: 1 addition & 1 deletion chainreg/chainregistry.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ type ChainControl struct {
// the parts that can be purely constructed from the passed in global
// configuration and doesn't need any wallet instance yet.
//
//nolint:lll
//nolint:ll
func NewPartialChainControl(cfg *Config) (*PartialChainControl, func(), error) {
cc := &PartialChainControl{
Cfg: cfg,
Expand Down
2 changes: 1 addition & 1 deletion chanacceptor/rpcacceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func (r *RPCAcceptor) sendAcceptRequests(errChan chan error,
acceptRequests := make(map[[32]byte]*chanAcceptInfo)

for {
//nolint:lll
//nolint:ll
select {
// Consume requests passed to us from our Accept() function and
// send them into our stream.
Expand Down
2 changes: 1 addition & 1 deletion channeldb/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -1691,7 +1691,7 @@ var (

// DeriveMusig2Shachain derives a shachain producer for the taproot channel
// from normal shachain revocation root.
func DeriveMusig2Shachain(revRoot shachain.Producer) (shachain.Producer, error) { //nolint:lll
func DeriveMusig2Shachain(revRoot shachain.Producer) (shachain.Producer, error) { //nolint:ll
// In order to obtain the revocation root hash to create the taproot
// revocation, we'll encode the producer into a buffer, then use that
// to derive the shachain root needed.
Expand Down
2 changes: 1 addition & 1 deletion channeldb/migration/lnwire21/onion_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type FailCode uint16
// The currently defined onion failure types within this current version of the
// Lightning protocol.
//
//nolint:lll
//nolint:ll
const (
CodeNone FailCode = 0
CodeInvalidRealm = FlagBadOnion | 1
Expand Down
14 changes: 7 additions & 7 deletions channeldb/migration32/migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ var (
},
}

//nolint:lll
//nolint:ll
resultNew1Hop1 = &mcHop{
channelID: tlv.NewPrimitiveRecord[tlv.TlvType0, uint64](100),
pubKeyBytes: tlv.NewRecordT[tlv.TlvType1](testPub),
Expand All @@ -128,14 +128,14 @@ var (
),
}

//nolint:lll
//nolint:ll
resultNew1Hop2 = &mcHop{
channelID: tlv.NewPrimitiveRecord[tlv.TlvType0, uint64](800),
pubKeyBytes: tlv.NewRecordT[tlv.TlvType1](testPub),
amtToFwd: tlv.NewPrimitiveRecord[tlv.TlvType2, lnwire.MilliSatoshi](4),
}

//nolint:lll
//nolint:ll
resultNew1Hop3 = &mcHop{
channelID: tlv.NewPrimitiveRecord[tlv.TlvType0, uint64](800),
pubKeyBytes: tlv.NewRecordT[tlv.TlvType1](testPub),
Expand All @@ -145,7 +145,7 @@ var (
),
}

//nolint:lll
//nolint:ll
resultNew1Hop4 = &mcHop{
channelID: tlv.NewPrimitiveRecord[tlv.TlvType0, uint64](800),
pubKeyBytes: tlv.NewRecordT[tlv.TlvType1](testPub),
Expand All @@ -158,7 +158,7 @@ var (
),
}

//nolint:lll
//nolint:ll
resultNew2Hop1 = &mcHop{
channelID: tlv.NewPrimitiveRecord[tlv.TlvType0, uint64](800),
pubKeyBytes: tlv.NewRecordT[tlv.TlvType1](testPub),
Expand All @@ -171,7 +171,7 @@ var (
),
}

//nolint:lll
//nolint:ll
resultNew1 = paymentResultNew{
id: 0,
timeFwd: tlv.NewPrimitiveRecord[tlv.TlvType0](
Expand Down Expand Up @@ -200,7 +200,7 @@ var (
}),
}

//nolint:lll
//nolint:ll
resultNew2 = paymentResultNew{
id: 2,
timeFwd: tlv.NewPrimitiveRecord[tlv.TlvType0, uint64](
Expand Down
2 changes: 1 addition & 1 deletion channeldb/payment_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ func (p *PaymentControl) RegisterAttempt(paymentHash lntypes.Hash,
if attempt.Route.FinalHop().TotalAmtMsat !=
h.Route.FinalHop().TotalAmtMsat {

//nolint:lll
//nolint:ll
return ErrBlindedPaymentTotalAmountMismatch
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/commands/walletrpc_active.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func estimateFeeRate(ctx *cli.Context) error {
SatPerKw int64 `json:"sat_per_kw"`
SatPerVByte int64 `json:"sat_per_vbyte"`
MinRelayFeeSatPerKw int64 `json:"min_relay_fee_sat_per_kw"`
//nolint:lll
//nolint:ll
MinRelayFeeSatPerVByte int64 `json:"min_relay_fee_sat_per_vbyte"`
}{
SatPerKw: int64(rateKW),
Expand Down
6 changes: 3 additions & 3 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ var (
// See LoadConfig for further details regarding the configuration
// loading+parsing process.
//
//nolint:lll
//nolint:ll
type Config struct {
ShowVersion bool `short:"V" long:"version" description:"Display version information and exit"`

Expand Down Expand Up @@ -523,7 +523,7 @@ type Config struct {
// for more details. Any value of 0 means we use the gRPC internal default
// values.
//
//nolint:lll
//nolint:ll
type GRPCConfig struct {
// ServerPingTime is a duration for the amount of time of no activity
// after which the server pings the client to see if the transport is
Expand All @@ -549,7 +549,7 @@ type GRPCConfig struct {

// DefaultConfig returns all default values for the Config struct.
//
//nolint:lll
//nolint:ll
func DefaultConfig() Config {
return Config{
LndDir: DefaultLndDir,
Expand Down
18 changes: 9 additions & 9 deletions contractcourt/breach_arbitrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ func newRetributionInfo(chanPoint *wire.OutPoint,

// For taproot outputs, we also need to hold onto the second
// level tap tweak as well.
//nolint:lll
//nolint:ll
htlcOutput.secondLevelTapTweak = breachedHtlc.SecondLevelTapTweak

breachedOutputs = append(breachedOutputs, htlcOutput)
Expand Down Expand Up @@ -1729,7 +1729,7 @@ func taprootBriefcaseFromRetInfo(retInfo *retributionInfo) *taprootBriefcase {
// For spending from our commitment output on the remote
// commitment, we'll need to stash the control block.
case input.TaprootRemoteCommitSpend:
//nolint:lll
//nolint:ll
tapCase.CtrlBlocks.Val.CommitSweepCtrlBlock = bo.signDesc.ControlBlock

bo.resolutionBlob.WhenSome(func(blob tlv.Blob) {
Expand All @@ -1743,7 +1743,7 @@ func taprootBriefcaseFromRetInfo(retInfo *retributionInfo) *taprootBriefcase {
// To spend the revoked output again, we'll store the same
// control block value as above, but in a different place.
case input.TaprootCommitmentRevoke:
//nolint:lll
//nolint:ll
tapCase.CtrlBlocks.Val.RevokeSweepCtrlBlock = bo.signDesc.ControlBlock

bo.resolutionBlob.WhenSome(func(blob tlv.Blob) {
Expand All @@ -1765,10 +1765,10 @@ func taprootBriefcaseFromRetInfo(retInfo *retributionInfo) *taprootBriefcase {
copy(firstLevelTweak[:], bo.signDesc.TapTweak)
secondLevelTweak := bo.secondLevelTapTweak

//nolint:lll
//nolint:ll
tapCase.TapTweaks.Val.BreachedHtlcTweaks[resID] = firstLevelTweak

//nolint:lll
//nolint:ll
tapCase.TapTweaks.Val.BreachedSecondLevelHltcTweaks[resID] = secondLevelTweak
}
}
Expand All @@ -1788,7 +1788,7 @@ func applyTaprootRetInfo(tapCase *taprootBriefcase,
// For spending from our commitment output on the remote
// commitment, we'll apply the control block.
case input.TaprootRemoteCommitSpend:
//nolint:lll
//nolint:ll
bo.signDesc.ControlBlock = tapCase.CtrlBlocks.Val.CommitSweepCtrlBlock

tapCase.SettledCommitBlob.WhenSomeV(
Expand All @@ -1800,7 +1800,7 @@ func applyTaprootRetInfo(tapCase *taprootBriefcase,
// To spend the revoked output again, we'll apply the same
// control block value as above, but to a different place.
case input.TaprootCommitmentRevoke:
//nolint:lll
//nolint:ll
bo.signDesc.ControlBlock = tapCase.CtrlBlocks.Val.RevokeSweepCtrlBlock

tapCase.BreachedCommitBlob.WhenSomeV(
Expand All @@ -1816,15 +1816,15 @@ func applyTaprootRetInfo(tapCase *taprootBriefcase,
case input.TaprootHtlcOfferedRevoke:
resID := newResolverID(bo.OutPoint())

//nolint:lll
//nolint:ll
tap1, ok := tapCase.TapTweaks.Val.BreachedHtlcTweaks[resID]
if !ok {
return fmt.Errorf("unable to find taproot "+
"tweak for: %v", bo.OutPoint())
}
bo.signDesc.TapTweak = tap1[:]

//nolint:lll
//nolint:ll
tap2, ok := tapCase.TapTweaks.Val.BreachedSecondLevelHltcTweaks[resID]
if !ok {
return fmt.Errorf("unable to find taproot "+
Expand Down
Loading

0 comments on commit ab7aae0

Please sign in to comment.