-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from davelopez/improve_validation_profiles
Improve validation profiles
- Loading branch information
Showing
47 changed files
with
1,391 additions
and
331 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
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,46 @@ | ||
import { DiagnosticSeverity, ValidationRule } from "@gxwf/server-common/src/languageTypes"; | ||
import { | ||
BasicCommonValidationProfile, | ||
IWCCommonValidationProfile, | ||
} from "@gxwf/server-common/src/providers/validation/profiles"; | ||
import { RequiredPropertyValidationRule } from "@gxwf/server-common/src/providers/validation/rules"; | ||
import { InputTypeValidationRule } from "./validation/rules/InputTypeValidationRule"; | ||
|
||
/** | ||
* Defines the minimal set of validation rules for gxformat2 Galaxy workflows. | ||
*/ | ||
export class GxFormat2BasicValidationProfile extends BasicCommonValidationProfile { | ||
public readonly name: string = "GxFormat2 Validation"; | ||
public static readonly RULES = new Set([ | ||
...super.RULES, | ||
// Add more custom rules specific to gxformat2 workflows here... | ||
]); | ||
|
||
public get rules(): Set<ValidationRule> { | ||
return GxFormat2BasicValidationProfile.RULES; | ||
} | ||
} | ||
|
||
/** | ||
* *Intergalactic Workflow Commission* (IWC) validation profile for gxformat2 Galaxy workflows. | ||
* This profile extends the basic validation profile and adds additional rules to comply | ||
* with the IWC best practices guidelines. | ||
*/ | ||
export class GxFormat2IWCValidationProfile extends IWCCommonValidationProfile { | ||
protected static readonly RULES = new Set([ | ||
...super.RULES, | ||
...GxFormat2BasicValidationProfile.RULES, | ||
new RequiredPropertyValidationRule( | ||
"doc", | ||
true, | ||
DiagnosticSeverity.Error, | ||
"The workflow is not documented. Documenting workflows helps users understand the purpose of the workflow." | ||
), | ||
new InputTypeValidationRule(DiagnosticSeverity.Error), | ||
// Add more custom rules specific to gxformat2 workflows here... | ||
]); | ||
|
||
public get rules(): Set<ValidationRule> { | ||
return GxFormat2IWCValidationProfile.RULES; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { FieldSchemaNode, RecordSchemaNode, SchemaNode } from "./definitions"; | ||
import { GalaxyWorkflowFormat2SchemaLoader } from "./schemaLoader"; | ||
import { RecordSchemaNode, FieldSchemaNode, SchemaNode } from "./definitions"; | ||
import { SchemaNodeResolver } from "./schemaNodeResolver"; | ||
|
||
export { GalaxyWorkflowFormat2SchemaLoader, SchemaNodeResolver, SchemaNode, RecordSchemaNode, FieldSchemaNode }; | ||
export { FieldSchemaNode, GalaxyWorkflowFormat2SchemaLoader, RecordSchemaNode, SchemaNode, SchemaNodeResolver }; |
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
Oops, something went wrong.