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

feat(general): fix circleci yaml-doc #4246

Merged
merged 3 commits into from
Jan 15, 2023
Merged
Show file tree
Hide file tree
Changes from all 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 checkov/yaml_doc/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def resolve_sub_name(definition: dict[str, Any], start_line: int, end_line: int,
if not definition:
return ""
for key, sub_name in definition.get(tag, {}).items():
if key in (START_LINE, END_LINE):
if key in (START_LINE, END_LINE) or not isinstance(sub_name, dict):
continue
if sub_name[START_LINE] <= start_line <= end_line <= sub_name[END_LINE]:
return str(key)
Expand Down
13 changes: 8 additions & 5 deletions tests/circleci_pipelines/resources/.circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
orbs:
---
orbs:
new-orb: "whatever/orbname@goodorb"
some-orb: "orbs/orbname@dev:blah"

Expand All @@ -9,6 +9,9 @@ executors:
- "image": "mongo:2.6.8"

jobs:
test-job-single-line: say-hello-workflow/script
test-job-list-line:
- checkout
test-docker-hash-img:
docker:
-
Expand Down Expand Up @@ -92,9 +95,9 @@ jobs:
name: "Echo the PR Reponame"

version: 2.1
workflows:
say-hello-workflow:
jobs:
workflows:
say-hello-workflow:
jobs:
- test-docker-hash-img
- test-docker-latest-img
- test-docker-versioned-img
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change this? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a test for it, but I guess the resource test file was left out