Skip to content

Commit

Permalink
validate content paths with MP
Browse files Browse the repository at this point in the history
  • Loading branch information
ilan committed Apr 2, 2024
1 parent dfc4a0c commit 15ffa85
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions demisto_sdk/scripts/validate_content_path.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from abc import ABC
from functools import partial
from multiprocessing import Pool
from pathlib import Path
from typing import ClassVar, List, Sequence

Expand Down Expand Up @@ -47,6 +49,7 @@
XSIAM_DASHBOARDS_DIR,
XSIAM_REPORTS_DIR,
)
from demisto_sdk.commands.common.cpu_count import cpu_count
from demisto_sdk.commands.common.logger import logger, logging_setup
from demisto_sdk.commands.content_graph.common import ContentType

Expand Down Expand Up @@ -410,23 +413,25 @@ def validate_paths(
skip_suffix: bool = False,
) -> None:
"""Validate given paths"""
if not all(
(
validate(
path,
github_action,
skip_depth_one_file=skip_depth_one_file,
skip_depth_one_folder=skip_depth_one_folder,
skip_depth_zero_file=skip_depth_zero_file,
skip_integration_script_file_name=skip_integration_script_file_name,
skip_integration_script_file_type=skip_integration_script_file_type,
skip_markdown=skip_markdown,
skip_suffix=skip_suffix,
with Pool(cpu_count()) as pool:

if not all(
pool.map(
partial(
validate,
github_action=github_action,
skip_depth_one_file=skip_depth_one_file,
skip_depth_one_folder=skip_depth_one_folder,
skip_depth_zero_file=skip_depth_zero_file,
skip_integration_script_file_name=skip_integration_script_file_name,
skip_integration_script_file_type=skip_integration_script_file_type,
skip_markdown=skip_markdown,
skip_suffix=skip_suffix,
),
paths,
)
for path in paths
)
):
raise typer.Exit(1)
):
raise typer.Exit(1)


@app.command(name="validate-all")
Expand Down

0 comments on commit 15ffa85

Please sign in to comment.