Skip to content

Commit

Permalink
Validate content paths (#4084)
Browse files Browse the repository at this point in the history
  • Loading branch information
dorschw authored Mar 19, 2024
1 parent de7e630 commit f2aecd4
Show file tree
Hide file tree
Showing 9 changed files with 776 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .changelog/4084.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- description: Added the `validate-content-path` **pre-commit** hook
type: feature
pr_number: 4084
27 changes: 27 additions & 0 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,33 @@ jobs:
artifacts-path-dir: content/test-pre-commit-command
artifact-name: test-demisto-sdk-pre-commit-command-artifacts

test-validate-content-path:
runs-on: ubuntu-latest
name: Test validate-content-path
steps:
- name: Checkout SDK
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Checkout Content
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: demisto/content
path: content

- name: Setup Python Environment
uses: ./.github/actions/setup_environment
with:
python-version: "3.10"

- name: Validate content master paths
run: |
source $(poetry env info --path)/bin/activate
validate-content-path validate-all content --skip-depth-one-file --skip-depth-one-folder --skip-depth-zero-file --skip-integration-script-file-name --skip-integration-script-file-type --skip-markdown
test-graph-commands:
runs-on: ubuntu-latest
name: Test Graph Commands
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ repos:
- ruamel-yaml-clib==0.2.7 ; platform_python_implementation == "CPython" and python_version < "3.11" and python_version >= "3.8"
- ruamel-yaml==0.17.22 ; python_version >= "3.8" and python_version < "3.11"
- setuptools==67.7.2 ; python_version >= "3.8" and python_version < "3.11"
- shellingham==1.5.0.post1 ; python_version >= "3.8" and python_version < "3.11"
- shellingham==1.5.4 ; python_version >= "3.8" and python_version < "3.11"
- six==1.16.0 ; python_version >= "3.8" and python_version < "3.11"
- slack-sdk==3.21.3 ; python_version >= "3.8" and python_version < "3.11"
- smmap==5.0.0 ; python_version >= "3.8" and python_version < "3.11"
Expand All @@ -157,7 +157,7 @@ repos:
- tomli==2.0.1 ; python_version >= "3.8" and python_version < "3.11"
- tqdm==4.65.0 ; python_version >= "3.8" and python_version < "3.11"
- typed-ast==1.5.4 ; python_version >= "3.8" and python_version < "3.11"
- typer[all]==0.7.0 ; python_version >= "3.8" and python_version < "3.11"
- typer[all]==0.9.0 ; python_version >= "3.8" and python_version < "3.11"
- types-chardet==5.0.4.5 ; python_version >= "3.8" and python_version < "3.11"
- types-cryptography==3.3.23.2 ; python_version >= "3.8" and python_version < "3.11"
- types-dateparser==1.1.4.9 ; python_version >= "3.8" and python_version < "3.11"
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,9 @@
language: python
require_serial: true
pass_filenames: false

- id: validate-content-path
name: validate-content-path
entry: validate-content-path
language: python
pass_filenames: true
1 change: 1 addition & 0 deletions demisto_sdk/commands/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ class FileType(str, Enum):
PACKS_CONTRIBUTORS_FILE_NAME = "CONTRIBUTORS.json"
AUTHOR_IMAGE_FILE_NAME = "Author_image.png"
PACKS_FOLDER = "Packs"
GIT_IGNORE_FILE_NAME = ".gitignore"

CONF_JSON_FILE_NAME = "conf.json"

Expand Down
Loading

0 comments on commit f2aecd4

Please sign in to comment.