Skip to content

Commit

Permalink
[pre-commit] remove __init__folders, fix script_runner and add commit…
Browse files Browse the repository at this point in the history
… mode (#31579)

[pre-commit] remove __init__folders, fix script_runner and add commit mode #31579
  • Loading branch information
ilaner authored and maimorag committed Dec 31, 2023
1 parent 84c60a2 commit 2720f84
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .hooks/pre-commit
Expand Up @@ -21,4 +21,4 @@ if ! poetry run demisto-sdk >/dev/null 2>&1; then
exit 1
fi

poetry run demisto-sdk pre-commit --staged-only --no-validate --no-docker
poetry run demisto-sdk pre-commit --staged-only --mode=commit
9 changes: 9 additions & 0 deletions .pre-commit-config_template.yaml
Expand Up @@ -70,6 +70,8 @@ repos:
config_file_arg:
arg_name: --rcfile
file_name: .pylintrc
skip:commit: true

- id: pytest-in-docker
name: pytest-in-docker
description: Run pytest on the code in content packs
Expand All @@ -94,6 +96,8 @@ repos:
- --files
copy_files:
- Tests/scripts/dev_envs/pytest/conftest.py
skip:commit: true

- id: pwsh-test-in-docker
name: pwsh-test-in-docker
description: Run powershell tests
Expand Down Expand Up @@ -133,12 +137,15 @@ repos:
entry: ./Tests/scripts/is_file_up_to_date.sh .circleci/config.yml "" false
language: script
pass_filenames: false
skip:commit: true
- id: is-gitlab-changed
name: is-gitlab-changed
description: Checks if gitlab files are changed, and checkout to current if it is.
entry: ./Tests/scripts/is_file_up_to_date.sh .gitlab "" false
language: script
pass_filenames: false
skip:commit: true

- id: validate
name: validate
description: validate content
Expand All @@ -148,6 +155,8 @@ repos:
pass_filenames: false
language: system
require_serial: true
skip:commit: true

- id: format
name: format
description: Format non-code files, to comply with XSOAR standards.
Expand Down
Empty file.
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions Tests/scripts/script_runner.py
Expand Up @@ -16,8 +16,10 @@ def run_script(args, files):
return 1
except subprocess.CalledProcessError as e:
print("Error: {e}".format(e=e)) # noqa: T201,UP032
return 1
except Exception as e:
print("An error occurred: {e}".format(e=e)) # noqa: T201,UP032
return 1
return 0


Expand Down

0 comments on commit 2720f84

Please sign in to comment.