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

Validate content paths #4084

Merged
merged 53 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
0ba3f49
initial commit
dorschw Feb 25, 2024
febb5a0
add typer CLI, tests
dorschw Feb 25, 2024
3371637
black
dorschw Feb 25, 2024
1ea2ec7
update typer version
dorschw Feb 25, 2024
4a507ca
update additional dependencies
dorschw Feb 25, 2024
27dceaf
changelog
dorschw Feb 25, 2024
d3505cd
support DeprecatedContent
dorschw Feb 25, 2024
8e01adf
fix logic, test
dorschw Feb 25, 2024
5f4ee0b
fix UT, logic
dorschw Feb 26, 2024
fda1941
prevent filenames with spaces
dorschw Feb 26, 2024
7ebcd2b
CI
dorschw Feb 26, 2024
0e931f7
fix CI
dorschw Feb 26, 2024
cefcc8f
fix CI
dorschw Feb 26, 2024
0aef18a
change CI step order
dorschw Feb 26, 2024
7c8bd2f
upload log
dorschw Feb 26, 2024
9d55b3d
fix log path
dorschw Feb 26, 2024
a2bd3a8
typo
dorschw Feb 26, 2024
717ee36
fix CLI
dorschw Feb 26, 2024
8b3b530
fix hooks file
dorschw Feb 26, 2024
92d48af
multiple inputs
dorschw Feb 26, 2024
c540adf
undo separator check
dorschw Feb 28, 2024
a313a2e
undo separator check
dorschw Feb 28, 2024
31d6bd6
allow doc files in first level
dorschw Feb 28, 2024
5766944
allow `doc_imgs` at first level
dorschw Feb 28, 2024
2c2bed5
allow `doc_imgs` at first level
dorschw Feb 28, 2024
a5ecec9
change log levels
dorschw Feb 28, 2024
3b861c9
setup logging
dorschw Feb 28, 2024
bb154a2
change logging levels
dorschw Feb 28, 2024
2df9ed8
fix folders
dorschw Feb 28, 2024
5d6a17c
Merge branch 'master' of https://github.com/demisto/demisto-sdk into …
dorschw Feb 28, 2024
5f4e8c7
Merge branch 'ds-validate-paths' of https://github.com/demisto/demist…
dorschw Feb 28, 2024
176affc
fix ut
dorschw Mar 3, 2024
6d84e60
fix another ut
dorschw Mar 3, 2024
51cee12
fixes, add `validate_all`
dorschw Mar 3, 2024
20b9fb5
Merge branch 'master' into ds-validate-paths
dorschw Mar 3, 2024
16592f7
BA108, BA109
dorschw Mar 3, 2024
1cf161e
select suffixes
dorschw Mar 3, 2024
5c65c7e
undo 108,109
dorschw Mar 3, 2024
db3812e
add IN137,IN138
dorschw Mar 10, 2024
9042837
more checks
dorschw Mar 11, 2024
ef4394f
more validations
dorschw Mar 13, 2024
bc54e87
add `ignore` flags
dorschw Mar 13, 2024
ceab1c8
fix flags used
dorschw Mar 13, 2024
abe81e2
path
dorschw Mar 13, 2024
a399c3f
CI
dorschw Mar 14, 2024
7fbb321
simplify
dorschw Mar 14, 2024
c4d0815
fix argument name
dorschw Mar 14, 2024
5ff3060
fix path
dorschw Mar 17, 2024
4ea828f
fix path
dorschw Mar 17, 2024
99a8977
no need for artifacts
dorschw Mar 17, 2024
17d073b
Merge branch 'master' into ds-validate-paths
dorschw Mar 17, 2024
5a66bd8
Apply suggestions from code review
dorschw Mar 18, 2024
dd1cdfd
Merge branch 'master' of https://github.com/demisto/demisto-sdk into …
dorschw Mar 18, 2024
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
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