-
Notifications
You must be signed in to change notification settings - Fork 820
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
Add new option for disabling validations #220
Conversation
This replaces #216 |
cdb2aa1
to
774bbe8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @keith.
We could create a followup PR that disables missingFiles
@@ -52,6 +53,10 @@ public struct ProjectSpec { | |||
} | |||
} | |||
|
|||
public enum DisabledValidations: String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename to ValidationType
and move to SpecValidation.swift
?
@@ -36,7 +36,7 @@ extension ProjectSpec { | |||
if !(basePath + configFile).exists { | |||
errors.append(.invalidConfigFile(configFile: configFile, config: config)) | |||
} | |||
if getConfig(config) == nil { | |||
if !options.disabledValidations.contains(.missingConfigs) && getConfig(config) == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can also add this check to https://github.com/yonaskolb/XcodeGen/blob/master/Sources/ProjectSpec/SpecValidation.swift#L20
This gives us an entry point for disabling specific project.yml validations that sometimes shouldn't apply. The first example is missingConfigs, which, if you use your .yml file in multiple projects, can be too strict if the projects have different top level configurations.
774bbe8
to
b6ef82b
Compare
Updated! |
Thanks! |
This gives us an entry point for disabling specific project.yml
validations that sometimes shouldn't apply. The first example is
missingConfigs, which, if you use your .yml file in multiple projects,
can be too strict if the projects have different top level
configurations.