Beispiel #1
0
def run_lint(file_path: str, json_output_file: str) -> None:
    lint_log_dir = os.path.dirname(json_output_file)
    logging_setup(verbose=3, quiet=False, log_path=lint_log_dir)
    lint_manager = LintManager(input=file_path,
                               git=False,
                               all_packs=False,
                               quiet=False,
                               verbose=1,
                               prev_ver='',
                               json_file_path=json_output_file)
    lint_manager.run_dev_packages(
        parallel=1,
        no_flake8=False,
        no_xsoar_linter=False,
        no_bandit=False,
        no_mypy=False,
        no_pylint=True,
        no_coverage=True,
        coverage_report='',
        no_vulture=False,
        no_test=True,
        no_pwsh_analyze=True,
        no_pwsh_test=True,
        keep_container=False,
        test_xml='',
        failure_report=lint_log_dir,
        docker_timeout=60,
    )
Beispiel #2
0
def lint(input: str, git: bool, all_packs: bool, verbose: int, quiet: bool,
         parallel: int, no_flake8: bool, no_bandit: bool, no_mypy: bool,
         no_vulture: bool, no_pylint: bool, no_test: bool,
         no_pwsh_analyze: bool, no_pwsh_test: bool, keep_container: bool,
         test_xml: str, failure_report: str, log_path: str):
    """Lint command will perform:\n
        1. Package in host checks - flake8, bandit, mypy, vulture.\n
        2. Package in docker image checks -  pylint, pytest, powershell - test, powershell - analyze.\n
    Meant to be used with integrations/scripts that use the folder (package) structure. Will lookup up what
    docker image to use and will setup the dev dependencies and file in the target folder."""
    lint_manager = LintManager(input=input,
                               git=git,
                               all_packs=all_packs,
                               verbose=verbose,
                               quiet=quiet,
                               log_path=log_path)
    return lint_manager.run_dev_packages(parallel=parallel,
                                         no_flake8=no_flake8,
                                         no_bandit=no_bandit,
                                         no_mypy=no_mypy,
                                         no_vulture=no_vulture,
                                         no_pylint=no_pylint,
                                         no_test=no_test,
                                         no_pwsh_analyze=no_pwsh_analyze,
                                         no_pwsh_test=no_pwsh_test,
                                         keep_container=keep_container,
                                         test_xml=test_xml,
                                         failure_report=failure_report)
Beispiel #3
0
def lint(config, dir, **kwargs):
    linter = LintManager(configuration=config.configuration,
                         project_dir_list=dir,
                         **kwargs)
    return linter.run_dev_packages()