Skip to content

puppet-lint overwriting yaml file with contents of init.pp #254

@cbowman0

Description

@cbowman0

Describe the Bug

When running puppet-lint --fix, the contents of yaml files are replaced with the last manifest file read in.

Expected Behavior

Do not replace any files with another files contents.

Steps to Reproduce

Have a manifest directory with an init.pp and a yaml file, like:
test/manifests/init.pp
test/files/sample.yaml

Contents are not important, but the tests I'm using are:

# Class: test
#
class test {

  $foo = 'bar'

  $baz = 'test'

}

and a yaml file like:

# This is a sample YAML file demonstrating common features

# Key-value pairs (mappings)
name: John Doe
age: 30
isStudent: false

# Lists (sequences)
hobbies:
  - Reading
  - Hiking
  - Coding

# Nested structures
address:
  street: 123 Main St
  city: Anytown
  zipCode: "12345" # String value

After running puppet-lint --fix test, the contents of the yaml file are changed to the same as test/manifests/init.pp.

Environment

  • Version 5.1.0
  • Platform Rocky 9.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions