def METHOD_NAME(args):
    """
    Runs linter (in strict mode) for monitors generation, and writes the generated file.
    """
    Linter.shared = Linter()
    all_monitors = read_all_monitors(tests_dir=args.tests_dir)
    renderer = MainTF.load_from_templates(
        main_template_path='monitors-gen/templates/main.tf.src',
        logs_monitor_template_path='monitors-gen/templates/monitor-logs.tf.src',
        apm_monitor_template_path='monitors-gen/templates/monitor-apm.tf.src',
        rum_monitor_template_path='monitors-gen/templates/monitor-rum.tf.src'
    )
    rendered = renderer.render(monitors=all_monitors)
    Linter.shared.print(strict=True)  # Print linter events and abort if any
    with open('monitors-gen/main.tf', 'w') as file:
        file.write(rendered)  # render to file
    print(f"✅ Generated {len(all_monitors)} monitor(s) in {os.path.abspath('monitors-gen/main.tf')}")
    # Create `monitors-gen/secrets.tf` file if it's missing:
    if not os.path.isfile('monitors-gen/secrets.tf'):
        shutil.copyfile('monitors-gen/templates/secrets.tf.src', 'monitors-gen/secrets.tf')
        print(
            f"⚠️ Before running Terraform you need to configure secrets in {os.path.abspath('monitors-gen/secrets.tf')}"
        )