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: disable empty list feature #876

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/macos_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ jobs:
working-directory: ./kclvm
run: export PATH=$PATH:$PWD/../_build/dist/Darwin/kclvm/bin:/usr/local/opt/llvm@12/bin && make install-rustc-wasm && make && make codecov-lcov
shell: bash
- name: Konfig test
working-directory: ./kclvm
run: export PATH=$PATH:$PWD/../_build/dist/Darwin/kclvm/bin:/usr/local/opt/llvm@12/bin && make install-rustc-wasm && make && make test-konfig
shell: bash

- uses: actions/upload-artifact@v3
with:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/ubuntu_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ jobs:
working-directory: ./kclvm
run: export PATH=$PATH:$PWD/../_build/dist/ubuntu/kclvm/bin && make install-rustc-wasm && make && make codecov-lcov
shell: bash
- name: Konfig test
working-directory: ./kclvm
run: export PATH=$PATH:$PWD/../_build/dist/ubuntu/kclvm/bin && make install-rustc-wasm && make && make test-konfig
shell: bash

- name: Coveralls upload
uses: coverallsapp/github-action@master
with:
Expand Down
1 change: 1 addition & 0 deletions kclvm/cmd/src/test_data/instances/test_inst_10/expected
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
a:
id: 102
inst102: []
1 change: 0 additions & 1 deletion kclvm/parser/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use kclvm_utils::path::{is_absolute, is_dir, path_exist};
use std::collections::VecDeque;
use std::fs;
use std::path::Path;
use std::sync::Arc;

use crate::LoadProgramOptions;

Expand Down
2 changes: 1 addition & 1 deletion kclvm/parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use indexmap::IndexMap;
use kclvm_ast::ast;
use kclvm_config::modfile::{get_vendor_home, KCL_FILE_EXTENSION, KCL_FILE_SUFFIX, KCL_MOD_FILE};
use kclvm_error::diagnostic::Range;
use kclvm_error::{ErrorKind, Level, Message, Style};
use kclvm_error::{ErrorKind, Message, Style};
use kclvm_sema::plugin::PLUGIN_MODULE_PREFIX;
use kclvm_utils::path::PathPrefix;
use kclvm_utils::pkgpath::parse_external_pkg_name;
Expand Down
4 changes: 2 additions & 2 deletions kclvm/runtime/src/api/kclvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ pub struct ContextConfig {
pub list_option_mode: bool,
/// Whether to emit none value in the plan process.
pub disable_none: bool,
/// Whether to output empty list in the plan process.
pub plan_empty_list: bool,
/// Whether to emit empty list in the plan process.
pub disable_empty_list: bool,
}

#[derive(PartialEq, Eq, Clone, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion kclvm/runtime/src/value/val_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ fn filter_results(ctx: &Context, key_values: &ValueRef, opts: &PlanOptions) -> V
let schema_in_list_count = ignore_schema_count + standalone_list.len();
let value = &value.as_list_ref().values;
// Plan empty list to values.
if value.is_empty() && ctx.cfg.plan_empty_list {
if value.is_empty() && !ctx.cfg.disable_empty_list {
let result = results.get_mut(0).unwrap();
result.dict_update_key_value(key.as_str(), ValueRef::list(None));
}
Expand Down
1 change: 1 addition & 0 deletions test/grammar/expr/select_expr/in_for_0/stdout.golden
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
c:
- name: main
volumeMounts: []
Loading