mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 01:57:13 +02:00
Allow to skip ProjectConfig option validation with new "validate_options" argument
This commit is contained in:
@ -259,7 +259,7 @@ class ProjectConfig(object):
|
|||||||
return []
|
return []
|
||||||
return self.getlist("platformio", "env_default")
|
return self.getlist("platformio", "env_default")
|
||||||
|
|
||||||
def validate(self, envs=None):
|
def validate(self, envs=None, validate_options=True):
|
||||||
if not isfile(self.path):
|
if not isfile(self.path):
|
||||||
raise exception.NotPlatformIOProject(self.path)
|
raise exception.NotPlatformIOProject(self.path)
|
||||||
# check envs
|
# check envs
|
||||||
@ -267,11 +267,11 @@ class ProjectConfig(object):
|
|||||||
if not known:
|
if not known:
|
||||||
raise exception.ProjectEnvsNotAvailable()
|
raise exception.ProjectEnvsNotAvailable()
|
||||||
|
|
||||||
unknown = set((envs or []) + self.default_envs()) - known
|
unknown = set(list(envs or []) + self.default_envs()) - known
|
||||||
if unknown:
|
if unknown:
|
||||||
raise exception.UnknownEnvNames(", ".join(unknown),
|
raise exception.UnknownEnvNames(", ".join(unknown),
|
||||||
", ".join(known))
|
", ".join(known))
|
||||||
return self.validate_options()
|
return self.validate_options() if validate_options else True
|
||||||
|
|
||||||
def validate_options(self):
|
def validate_options(self):
|
||||||
warnings = set()
|
warnings = set()
|
||||||
|
Reference in New Issue
Block a user