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

feat: support config entry mutual reference. #395

Merged
merged 2 commits into from Feb 7, 2023

Conversation

Peefy
Copy link
Contributor

@Peefy Peefy commented Feb 1, 2023

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

  • N
  • Y

re #368. With the mutual-reference feature of attributes in the KCL config entry, we can write fewer KCL codes to eliminate more templates in the configuration and improve the convenience of configuration writing.

  • Before
data = {
    name = "nginx"
    metadata.name = "nginx"
}
  • After
data = {
    name = "nginx"
    metadata.name = name  # Can reference `name` directly.
}

TODO: Reverse variable reference in configuration block such as the following code:

data = {
    metadata.name = name  # Can reference `name` directly.
    name = "nginx"
}

2. What is the scope of this PR (e.g. component or file name):

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other
  • test/grammar/datatype/dict/mutual_ref_{number}/main.k

6. Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@Peefy Peefy added semantic Issues or PRs related to kcl semantic and checker feat labels Feb 1, 2023
@Peefy Peefy self-assigned this Feb 1, 2023
@coveralls
Copy link
Collaborator

coveralls commented Feb 1, 2023

Pull Request Test Coverage Report for Build 4080646785

  • 74 of 87 (85.06%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-27.8%) to 62.777%

Changes Missing Coverage Covered Lines Changed/Added Lines %
kclvm/compiler/src/codegen/llvm/node.rs 44 57 77.19%
Totals Coverage Status
Change from base Build 4080571330: -27.8%
Covered Lines: 22883
Relevant Lines: 36451

💛 - Coveralls

@Peefy Peefy force-pushed the feat-config-entry-mutual-ref branch from 9f9bf72 to e7d5a0b Compare February 2, 2023 05:36
NeverRaR
NeverRaR previously approved these changes Feb 2, 2023
@Peefy Peefy merged commit edd89e6 into kcl-lang:main Feb 7, 2023
@Peefy Peefy deleted the feat-config-entry-mutual-ref branch February 7, 2023 11:13
@github-actions github-actions bot locked and limited conversation to collaborators Feb 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat semantic Issues or PRs related to kcl semantic and checker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants