Check simultaneous use of monitor_raw and monitor_filters

This commit is contained in:
Ivan Kravets
2023-04-18 21:35:22 +03:00
parent 02a63a6954
commit 97a7cdd2a2

View File

@ -401,11 +401,22 @@ class ProjectConfigBase:
", ".join(unknown_envs), ", ".join(known_envs)
)
# check envs names
for env in known_envs:
# check envs names
if not self.ENVNAME_RE.match(env):
raise exception.InvalidEnvNameError(env)
# check simultaneous use of `monitor_raw` and `monitor_filters`
if self.get(f"env:{env}", "monitor_raw", False) and self.get(
f"env:{env}", "monitor_filters", None
):
self.warnings.append(
"The `monitor_raw` and `monitor_filters` options cannot be "
f"used simultaneously for the `{env}` environment in the "
"`platformio.ini` file. The `monitor_filters` option will "
"be disabled to avoid conflicts."
)
if not silent:
for warning in self.warnings:
click.secho("Warning! %s" % warning, fg="yellow")