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: add file.mkdir and file.delete functions #1271

Merged
merged 2 commits into from
May 4, 2024

Conversation

shruti2522
Copy link
Contributor

@shruti2522 shruti2522 commented May 3, 2024

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

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

kcl-lang/kcl/kclvm

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

Added kclvm_mkdir and kclvm_delete module functions.

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

@shruti2522 shruti2522 force-pushed the module-functions branch 2 times, most recently from 7fa580b to d1cb43b Compare May 3, 2024 23:50
@Peefy
Copy link
Contributor

Peefy commented May 4, 2024

A reference PR to add more functions for the file module. #1157

@shruti2522
Copy link
Contributor Author

Ah, got it now. While going through the issue, I supposed them to be cli functions, that's why I made changes to the cli.

@coveralls
Copy link
Collaborator

coveralls commented May 4, 2024

Pull Request Test Coverage Report for Build 8951702386

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 30 of 68 (44.12%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.03%) to 71.41%

Changes Missing Coverage Covered Lines Changed/Added Lines %
kclvm/runtime/src/file/mod.rs 0 38 0.0%
Totals Coverage Status
Change from base Build 8949502527: -0.03%
Covered Lines: 52784
Relevant Lines: 73917

💛 - Coveralls

@shruti2522 shruti2522 force-pushed the module-functions branch 2 times, most recently from 143f196 to a37fe21 Compare May 4, 2024 10:23
@shruti2522 shruti2522 marked this pull request as ready for review May 4, 2024 10:27
@shruti2522
Copy link
Contributor Author

Ready for review @Peefy

@Peefy
Copy link
Contributor

Peefy commented May 4, 2024

Could you please add more tests and code for the resolver like this PR #1157

@shruti2522
Copy link
Contributor Author

added the tests @Peefy, please have a look

@@ -1638,6 +1638,34 @@ register_file_member! {
false,
None,
)
mkdir => Type::function(
None,
Type::str_ref(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Any type?

)
delete => Type::function(
None,
Type::str_ref(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Any type?

@@ -0,0 +1 @@
delete: 'failed to delete 'test_dir': No such file or directory'
Copy link
Contributor

Choose a reason for hiding this comment

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

You can add the stderr test suite.

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

corrected formatting

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

updated formatting

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

feat: added mkdir and delete module functions

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

updated linker.rs

feat: added mkdir and delete module functions

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

format checking

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

`get_schema_type` function will now return `SchemaType` instances with base schema information included (kcl-lang#1272)

* `get_schema_type` and `get_full_schema_type` will now return `SchemaType` instance

Signed-off-by: utnim2 <mintugogoi567@gmail.com>

* added  the recursive function

Signed-off-by: utnim2 <mintugogoi567@gmail.com>

* fixed the types

Signed-off-by: utnim2 <mintugogoi567@gmail.com>

---------

Signed-off-by: utnim2 <mintugogoi567@gmail.com>

feat: extend file module functions mkdir and delete

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

feat: added mkdir and delete module functions

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

tests added

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

tests updated

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

feat: added mkdir and delete module functions

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

updated test cases

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

updated kclvm loader snaps

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

added stderr output

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

feat: added mkdir and delete module functions

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>
@shruti2522
Copy link
Contributor Author

made the changes @Peefy

@shruti2522 shruti2522 changed the title feat: extend module functions feat: add file.mkdir and file.delete functions May 4, 2024
Signed-off-by: shruti2522 <shruti.apc01@gmail.com>
Copy link
Contributor

@Peefy Peefy 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 e9e54de into kcl-lang:main May 4, 2024
6 of 8 checks passed
JeevaRamanathan pushed a commit to JeevaRamanathan/kcl that referenced this pull request May 7, 2024
* feat: added mkdir and delete module functions

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

corrected formatting

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

updated formatting

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

feat: added mkdir and delete module functions

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

updated linker.rs

feat: added mkdir and delete module functions

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

format checking

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

`get_schema_type` function will now return `SchemaType` instances with base schema information included (kcl-lang#1272)

* `get_schema_type` and `get_full_schema_type` will now return `SchemaType` instance

Signed-off-by: utnim2 <mintugogoi567@gmail.com>

* added  the recursive function

Signed-off-by: utnim2 <mintugogoi567@gmail.com>

* fixed the types

Signed-off-by: utnim2 <mintugogoi567@gmail.com>

---------

Signed-off-by: utnim2 <mintugogoi567@gmail.com>

feat: extend file module functions mkdir and delete

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

feat: added mkdir and delete module functions

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

tests added

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

tests updated

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

feat: added mkdir and delete module functions

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

updated test cases

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

updated kclvm loader snaps

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

added stderr output

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

feat: added mkdir and delete module functions

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

* updated stdout

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>

---------

Signed-off-by: shruti2522 <shruti.apc01@gmail.com>
Signed-off-by: JeevaRamanathan <jeevaramanathan.m@infosys.com>
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.

Extend file module functions (for smoother GitOps)
3 participants