Skip to content

Commit

Permalink
refactor: json schema config for defaultRules.yaml (datreeio#608)
Browse files Browse the repository at this point in the history
* refactor: add json schema configuration to defaultRules.yaml for intelij

* refactor: add schema type for defaultRules.yaml
  • Loading branch information
royhadad authored May 11, 2022
1 parent 74ef621 commit 871aad9
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ vendor
datree
.DS_STORE
.vscode
.idea
.idea/*

# macos code signing
DatreeCli.cer
Expand All @@ -16,4 +16,7 @@ homebrew*
travis_wait*

#
changelog.txt
changelog.txt

# don't ignore json schema config files
!.idea/jsonSchemas.xml
25 changes: 25 additions & 0 deletions .idea/jsonSchemas.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/policy/defaultRules.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=./defaultRulesSchema.json
apiVersion: v1
aliases:
- &standardKinds
Expand Down
3 changes: 2 additions & 1 deletion pkg/policy/defaultRulesSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
]
},
"schema": {
"type": "object"
"$ref": "http://json-schema.org/draft-07/schema#",
"description": "schema is the logic of the rule, should be a yaml schema as specified in http://json-schema.org/draft-07/schema#"
}
}
},
Expand Down

0 comments on commit 871aad9

Please sign in to comment.