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

Ll #169

Closed
wants to merge 6 commits into from
Closed

Ll #169

wants to merge 6 commits into from

Conversation

ellemouton
Copy link
Owner

Change Description

Description of change / link to associated issue.

Steps to Test

Steps for reviewers to follow to test the change.

Pull Request Checklist

Testing

  • Your PR passes all CI checks.
  • Tests covering the positive and negative (error paths) are included.
  • Bug fixes contain tests triggering the bug to prevent regressions.

Code Style and Documentation

📝 Please see our Contribution Guidelines for further guidance.

In this commit, we copy the implementation of the golangci-lint lll
linter which we currently use in our CI flow during the `make lint`
check. This commit copies the code mostly as is (the only exception
being the line which trims white space before checking if a line starts
with "import"), and formats it to fit our codebase guidelines. A test is
also added so that we can be sure that the following commits which
adjust the implementation have the intended results.

The custom linter is put into its own module as this is requied by the
`golangci-lint custom` when building the custom linter binary which
includes the plugin.
This commit introduces the `LLPlugin` type and converts the existing lll
code such that the LLPlugin implements the register.LinterPlugin
interface. This will allow us to plug it into golangci-linter as a
plugin.
This commit adds a feature to our custom lll linter which will ignore
log lines (both single and multi-lined log lines) for the lll linter.
Add this file both to the main LND directory so that devs can use it for
local linter runs and also add it to the `tools` directory so that the
docker environment used to run the linter in CI has access to it. A
custom linter binary can be built via `golangci-lint custom`. This will
pull in and register all the plugins listed in the new config file when
building the new binary. The new binary can then be run using
`custom-gcl run`.
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.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 12082691165

Details

  • 95 of 117 (81.2%) changed or added relevant lines in 35 files are covered.
  • 117 unchanged lines in 23 files lost coverage.
  • Overall coverage decreased (-0.02%) to 58.954%

Changes Missing Coverage Covered Lines Changed/Added Lines %
channeldb/payment_control.go 0 1 0.0%
contractcourt/channel_arbitrator.go 4 5 80.0%
funding/manager.go 0 1 0.0%
htlcswitch/link.go 3 4 75.0%
lnrpc/devrpc/dev_server.go 0 1 0.0%
lnwallet/chancloser/chancloser.go 2 3 66.67%
protofsm/state_machine.go 5 6 83.33%
lntest/utils.go 0 2 0.0%
lnwallet/channel.go 17 30 56.67%
Files with Coverage Reduction New Missed Lines %
watchtower/wtclient/queue.go 1 87.73%
peer/ping_manager.go 1 86.36%
lnwallet/test/test_interface.go 1 78.76%
rpcperms/interceptor.go 2 82.59%
log.go 2 96.72%
lnwallet/channel.go 2 85.04%
contractcourt/htlc_timeout_resolver.go 2 89.27%
graph/notifications.go 2 84.62%
htlcswitch/interceptable_switch.go 2 81.52%
rpcserver.go 2 71.07%
Totals Coverage Status
Change from base Build 12081391037: -0.02%
Covered Lines: 133460
Relevant Lines: 226380

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants