mkinit icon indicating copy to clipboard operation
mkinit copied to clipboard

mkinit removes `__ignore__` under certain circumstances

Open alessio-locatelli opened this issue 1 year ago • 0 comments

Describe the bug

Depending on the __ignore__ variable position it can be kept or removed.

To Reproduce

:green_circle: No problems (__ignore__ variable survives in the file):

# Some text here.
__ignore__ = ["spam", "eggs"]
__protected__ = ["foobar",]
# Some text here.

__ignore__ = ["spam", "eggs"]
__protected__ = ["foobar",]
# Some text here.

__ignore__ = ["spam", "eggs"]

__protected__ = ["foobar",]
__ignore__ = ["spam", "eggs"]
__private__ = []
# Some text.

__ignore__ = ["spam", "eggs"]
# Some text.

:red_circle: __ignore__ is removed by mistake:

# Some text here.
__protected__ = ["foobar",]
__ignore__ = ["spam", "eggs"]
# Some text here.
__protected__ = ["foobar",]
__ignore__ = ["spam", "eggs"]
# Some text here.
__ignore__ = ["spam", "eggs"]

__ignore__ = ["spam", "eggs"]
__protected__ = []
__ignore__ = ["spam", "eggs"]

Expected behavior

Always keep __ignore__ when it is around the top of the file.

alessio-locatelli avatar May 17 '24 17:05 alessio-locatelli