update(engine): modify append_output format

Signed-off-by: Luca Guerra <luca@guerra.sh>
This commit is contained in:
Luca Guerra
2024-09-12 08:16:43 +00:00
committed by poiana
parent d3c6a7478e
commit 7005983409
9 changed files with 130 additions and 111 deletions

View File

@@ -19,6 +19,7 @@ limitations under the License.
#include <memory>
#include <set>
#include <vector>
#include <functional>
#include "rule_loader_compiler.h"
#include "filter_warning_resolver.h"
@@ -501,9 +502,18 @@ void rule_loader::compiler::compile_rule_infos(
continue;
}
if (extra.m_tag != "" && r.tags.count(extra.m_tag) == 0)
if (extra.m_tags.size() != 0)
{
continue;
std::set<std::string> intersect;
set_intersection(extra.m_tags.begin(), extra.m_tags.end(),
r.tags.begin(), r.tags.end(),
inserter(intersect, intersect.begin()));
if (intersect.size() != extra.m_tags.size())
{
continue;
}
}
if (extra.m_rule != "" && r.name != extra.m_rule)
@@ -541,9 +551,18 @@ void rule_loader::compiler::compile_rule_infos(
continue;
}
if (extra.m_tag != "" && r.tags.count(extra.m_tag) == 0)
if (extra.m_tags.size() != 0)
{
continue;
std::set<std::string> intersect;
set_intersection(extra.m_tags.begin(), extra.m_tags.end(),
r.tags.begin(), r.tags.end(),
inserter(intersect, intersect.begin()));
if (intersect.size() != extra.m_tags.size())
{
continue;
}
}
if (extra.m_rule != "" && r.name != extra.m_rule)