code: def lint_envvars(
      self,
      snakefile,
      regex=re.compile(
          r"os.environ\[(?P<quote>['\"])(?P<name>.+)?(?P=quote)\]"
      ),
  ):
      for match in regex.finditer(snakefile):
          line = get_line(match, snakefile)
          name = match.group("name")
          if name not in self.workflow.envvars:
              yield Lint(
                  title="Environment variable {} used but not asserted with envvars directive in line {}.".format(
                      name, line
                  ),
                  body="Asserting existence of environment variables with the envvars directive ensures proper error "
                  "messages if the user fails to invoke a workflow with all required environment variables defined. "
                  "Further, it allows snakemake to pass them on in case of distributed execution.",
                  links=[links.envvars],
              )
  
file_path: snakemake/snakemake/linting/snakefiles.py
imports: import re
  from itertools import chain
  from snakemake.linting import Linter, Lint, links, NAME_PATTERN
label_desc: Use image node_id 7 for calling the SnakefileLinter obj's underlying member method code with example usage: obj.lint_envvars(snakefile, regex) without return types