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: impl query tools. #59

Merged
merged 2 commits into from
Jun 30, 2022
Merged

feat: impl query tools. #59

merged 2 commits into from
Jun 30, 2022

Conversation

Peefy
Copy link
Contributor

@Peefy Peefy commented May 30, 2022

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

kclvm/tools/src/query/mod.rs,
kclvm/tools/src/query/override.rs
kclvm/tools/src/query/tests.rs

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

KCL Rust version of the query tool, and provides query APIs to further build tools such as the query CLI.

The main API function involved is override_file, the user can specify the file to be modified and the modification specification through this function. The specification mainly includes the path and modification value of the configuration to be modified.

Does this change affect any open issues?(Y/N) and add issue references

Y, #54

Tests

Unit Tests

Test cases in kclvm/tools/src/query/tests.rs

cd kclvm/tools && cargo test

Benchmark

Test cases in kclvm/tools/benches/benchmark.rs

cd kclvm/tools && cargo bench

The override_file api benchmark result as follows:

image

@Peefy Peefy added enhancement New feature or request tool Issues or PRs related to kcl tools inlucding format, lint, validation, document tools, etc. labels May 30, 2022
@Peefy Peefy added this to the v0.4.3 Release milestone May 30, 2022
@Peefy Peefy self-assigned this May 30, 2022
@Peefy Peefy force-pushed the dev/peefy/feat_query_tool branch 5 times, most recently from d45e80e to 055aca3 Compare May 30, 2022 12:06
@Peefy Peefy added the feat label May 31, 2022
zong-zhe
zong-zhe previously approved these changes Jun 7, 2022
Copy link
Contributor

@zong-zhe zong-zhe left a comment

Choose a reason for hiding this comment

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

LGTM

@Peefy Peefy force-pushed the dev/peefy/feat_query_tool branch from 6afc7db to b60c9d3 Compare June 9, 2022 11:52
@Peefy Peefy force-pushed the dev/peefy/feat_query_tool branch 3 times, most recently from 658beab to 4e1ea53 Compare June 15, 2022 06:51
ldxdl
ldxdl previously approved these changes Jun 15, 2022
Copy link
Contributor

@ldxdl ldxdl left a comment

Choose a reason for hiding this comment

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

LGTM

kclvm/tools/src/query/override.rs Outdated Show resolved Hide resolved
kclvm/tools/src/query/override.rs Outdated Show resolved Hide resolved
kclvm/ast/src/path.rs Show resolved Hide resolved
chai2010
chai2010 previously approved these changes Jun 20, 2022
Copy link
Contributor

@chai2010 chai2010 left a comment

Choose a reason for hiding this comment

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

LGTM

@zong-zhe zong-zhe self-requested a review June 20, 2022 10:49
zong-zhe
zong-zhe previously approved these changes Jun 20, 2022
@Peefy Peefy dismissed stale reviews from zong-zhe and chai2010 via df3ec0d June 20, 2022 12:13
zong-zhe
zong-zhe previously approved these changes Jun 27, 2022
Copy link
Contributor

@zong-zhe zong-zhe left a comment

Choose a reason for hiding this comment

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

LGTM

chai2010
chai2010 previously approved these changes Jun 28, 2022
@Peefy Peefy dismissed stale reviews from chai2010 and zong-zhe via 70c4da5 June 28, 2022 08:05
@Peefy Peefy force-pushed the dev/peefy/feat_query_tool branch 2 times, most recently from 70c4da5 to 4dfc986 Compare June 29, 2022 03:48
@Peefy Peefy force-pushed the dev/peefy/feat_query_tool branch from 4dfc986 to d4bda14 Compare June 29, 2022 06:12
@zong-zhe zong-zhe self-requested a review June 29, 2022 12:30
Copy link
Contributor

@zong-zhe zong-zhe left a comment

Choose a reason for hiding this comment

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

LGTM

@Peefy Peefy merged commit 8d20c6a into main Jun 30, 2022
@Peefy Peefy deleted the dev/peefy/feat_query_tool branch July 13, 2022 02:28
@Peefy Peefy linked an issue Jul 26, 2022 that may be closed by this pull request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request feat tool Issues or PRs related to kcl tools inlucding format, lint, validation, document tools, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KCL Query tool (Rust ver.)
4 participants