Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

config: attempt to solve TOOL-1405 and modify old test cases #217

Merged
merged 8 commits into from
Jul 25, 2019

Conversation

lance6716
Copy link
Contributor

@lance6716 lance6716 commented Jul 23, 2019

What problem does this PR solve?

Early exit to save time when user's toml config contains unused items, for example, a typo. And give warnings when some config items won't take effect.

What is changed and how it works?

A check is performed on (*Config).LoadFromTOML, using toml.Decode and metaData.Undecoded to detect unused toml keys. Considering we have two structure Config and GlobalConfig, we check for both unused keys and give according exit-action or warning.

Check List

Tests

  • Unit test
  • Integration test

Side effects

Related changes

  • Need to update the documentation
  • Need to be included in the release note

@lance6716
Copy link
Contributor Author

PTAL @kennytm @leoppro

@lance6716 lance6716 changed the title attempt to solve TOOL-1405 and modify old test cases config: attempt to solve TOOL-1405 and modify old test cases Jul 23, 2019
@lance6716 lance6716 added feature-request This issue is a feature request priority/normal Should Update Docs Should update docs after this PR is merged. Remove this label once the docs are updated status/PTAL This PR is ready for review. Add this label back after committing new changes type/feature New feature labels Jul 23, 2019
lightning/config/config.go Outdated Show resolved Hide resolved
lightning/config/config.go Show resolved Hide resolved
lightning/config/config.go Outdated Show resolved Hide resolved
lightning/config/config.go Outdated Show resolved Hide resolved
lightning/config/config.go Outdated Show resolved Hide resolved
@lance6716
Copy link
Contributor Author

/run-all-tests

@zier-one
Copy link
Contributor

LGTM

@lance6716
Copy link
Contributor Author

/run-all-tests

@kennytm kennytm added status/LGT1 One reviewer already commented LGTM (LGTM1) and removed status/PTAL This PR is ready for review. Add this label back after committing new changes labels Jul 24, 2019
@lance6716
Copy link
Contributor Author

/run-all-tests

lightning/config/config.go Outdated Show resolved Hide resolved
lightning/config/config.go Outdated Show resolved Hide resolved
lightning/config/config.go Outdated Show resolved Hide resolved
lightning/config/config.go Outdated Show resolved Hide resolved
lightning/config/config.go Outdated Show resolved Hide resolved
lightning/config/config.go Outdated Show resolved Hide resolved
@lance6716
Copy link
Contributor Author

/run-all-tests

Copy link
Collaborator

@kennytm kennytm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

lightning/config/config.go Outdated Show resolved Hide resolved
Co-Authored-By: kennytm <kennytm@gmail.com>
@lance6716
Copy link
Contributor Author

/run-all-tests

@lance6716 lance6716 merged commit 034ba60 into master Jul 25, 2019
@lance6716 lance6716 deleted the tool-1405 branch July 25, 2019 03:37
@lance6716 lance6716 added status/LGT2 Two reviewers already commented LGTM, ready for merge (LGTM2) and removed status/LGT1 One reviewer already commented LGTM (LGTM1) labels Jul 25, 2019
@kennytm kennytm removed the Should Update Docs Should update docs after this PR is merged. Remove this label once the docs are updated label Aug 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request This issue is a feature request status/LGT2 Two reviewers already commented LGTM, ready for merge (LGTM2) type/feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants