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

move pre-commit template to content #27535

Merged
merged 8 commits into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from 7 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
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
/Packs/CommonDashboards/ @michalgold @idovandijk
/Packs/ContentManagement/ @mmhw


# Build related
.circleci/config.yml @yucohen
.gitlab/ci/* @yucohen
Expand All @@ -82,6 +81,7 @@ Tests/scripts/lock_cloud_machines.py @daryakoval
# SDK Related
.gitlab/ci/sdk-nightly.yml @dorschw
Utils/trigger_nightly_sdk_build.sh @dorschw
.pre-commit-config_template.yaml @dorschw @ilaner

# XDR Related
/Packs/CortexXDR/Integrations/ @dansterenson
Expand Down
78 changes: 78 additions & 0 deletions .pre-commit-config_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
exclude: .devcontainer/|.vscode|Pipfile.lock|.gitlab/ci/|.circleci/|docs
ilaner marked this conversation as resolved.
Show resolved Hide resolved

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-json
- id: check-yaml
- id: check-ast
- id: check-merge-conflict
- id: debug-statements
language_version: python3
- id: name-tests-test
files: .+_test.py$

- repo: https://github.com/hadialqattan/pycln
rev: v2.1.2
hooks:
- id: pycln

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.272"
hooks:
- id: ruff

- repo: https://github.com/pre-commit/mirrors-autopep8
rev: "v2.0.1"
hooks:
- id: autopep8
- repo: local
hooks:

- id: is-circle-changed
name: is-circle-changed
description: Checks if circle files are changed, and checkout to current if it is.
entry: ./Tests/scripts/is_file_up_to_date.sh .circleci/config.yml "" true
language: script
pass_filenames: false

- 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 "" true
language: script
pass_filenames: false

- repo: https://github.com/demisto/demisto-sdk
rev: ""
hooks:
- id: mypy
args:
[
--ignore-missing-imports,
--check-untyped-defs,
--show-error-codes,
--follow-imports=silent,
--allow-redefinition,
# `--python-version` argument is replaced in runtime
--python-version=3.10,
]
exclude: "test_data|tests_data|.venv|.*_test.py$|infrastructure_tests"

# enable with --test
- id: run-unit-tests

- id: format
# update docker image to the latest version, assume no
args: ["-ud", "-n", "--no-validate", "-g"]

- id: validate
args: ["-g"]

- id: secrets
args: ["--ignore-entropy"]

- id: no-implicit-optional
# remove this argument when this hook is ready to use
skip: true