-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added import statements to the Yamlator schema syntax that support importing one or more types * Added namespaces to the import statements with the as keyword * Improvements to the loading of rulesets to allow for schema files to be less restrictive in the order resources are defined. * Improvements to the grammar file to include new terminals and remove duplicate constructs * Updated package build to 0.4.0 in the setup.py
- Loading branch information
Showing
43 changed files
with
2,023 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Project from "../strict_mode/strict.ys" | ||
|
||
enum Values { | ||
TEST = 1 | ||
} | ||
|
||
enum Status { | ||
SUCCESS = 0 | ||
ERR = 1 | ||
FAILURE = 2 | ||
WARNING = 3 | ||
} | ||
|
||
ruleset ProjectDetails { | ||
author str | ||
created str | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
project: | ||
version: 1 | ||
name: test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Values, Status, ProjectDetails from "common.ys" as core | ||
|
||
schema { | ||
project Project | ||
value core.Values | ||
} | ||
|
||
strict ruleset Project { | ||
status core.Status | ||
apis list(str) | ||
details core.ProjectDetails | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
"""Contains constants for the test files paths""" | ||
|
||
_BASE_INVALID_PATH = './tests/files/invalid_files' | ||
|
||
INVALID_ENUM_NAME_SCHEMA = f'{_BASE_INVALID_PATH}/invalid_enum_name.ys' | ||
INVALID_RULESET_NAME_SCHEMA = f'{_BASE_INVALID_PATH}/invalid_ruleset_name.ys' | ||
INVALID_SYNTAX_SCHEMA = f'{_BASE_INVALID_PATH}/invalid_syntax.ys' | ||
MISSING_RULESET_DEF_SCHEMA = f'{_BASE_INVALID_PATH}/missing_defined_ruleset.ys' | ||
NESTED_UNION_SCHEMA = f'{_BASE_INVALID_PATH}/nested_union.ys' | ||
MISSING_RULESET_RULES_SCHEMA = f'{_BASE_INVALID_PATH}/ruleset_missing_rules.ys' | ||
MISSING_SCHEMA_RULES_SCHEMA = f'{_BASE_INVALID_PATH}/schema_missing_rules.ys' | ||
SELF_CYCLE_SCHEMA = f'{_BASE_INVALID_PATH}/cycles/self_cycle.ys' | ||
INVALID_YAML_DATA = f'{_BASE_INVALID_PATH}/invalid.yaml' | ||
|
||
_BASE_VALID_PATH = './tests/files/valid' | ||
VALID_YAML_DATA = f'{_BASE_VALID_PATH}/valid.yaml' | ||
VALID_SCHEMA = f'{_BASE_VALID_PATH}/valid.ys' | ||
VALID_KEYLESS_DIRECTIVE_SCHEMA = f'{_BASE_VALID_PATH}/keyless_directive.ys' | ||
VALID_KEYLESS_RULES_SCHEMA = f'{_BASE_VALID_PATH}/keyless_and_standard_rules.ys' | ||
|
||
# These files don't exists and are used to force specific errors in the tests | ||
NONE_PATH = None | ||
EMPTY_PATH = '' | ||
NOT_FOUND_SCHEMA = 'not_found.ys' | ||
NOT_FOUND_YAML_DATA = 'not_found.yaml' | ||
INVALID_SCHEMA_EXTENSION = './tests/files/hello.ruleset' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Project from "root.ys" | ||
|
||
enum Values { | ||
TEST = 1 | ||
} | ||
|
||
enum Status { | ||
SUCCESS = 0 | ||
ERR = 1 | ||
FAILURE = 2 | ||
WARNING = 3 | ||
} | ||
|
||
ruleset ProjectDetails { | ||
author str | ||
created str | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Values, Status from "common.ys" as core | ||
|
||
ruleset Project { | ||
version str | ||
name str | ||
status core.Status optional | ||
} | ||
|
||
schema { | ||
project Project | ||
value core.Values | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Test from "self_cycle.ys" | ||
|
||
ruleset Test { | ||
data str | ||
number int | ||
} | ||
|
||
schema { | ||
test Test optional | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
ruleset Details {} | ||
|
||
schema { | ||
message str | ||
details Details | ||
} | ||
} | ||
|
||
ruleset Details {} |
Oops, something went wrong.