-
-
Notifications
You must be signed in to change notification settings - Fork 802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project Configuration does not preserve comments in platformio.ini
#3862
Comments
Please open a separate issue for this, this is a bug. We will not save boolean field to the config if their value is == default. |
Yes, this is a known issue. We don't preserve comments because Python's ConfigParser does not support this :(
We do this by default when saving config file. |
Separate issue opened for those boolean parameters. A warning It may be worth investigating other configuration parsers as configobj as that apparently does preserve comments, although may have also have undesirable requirements for multi-line entries? Food for thought. I suspected the header behaviour wouldn't change, was just worth mentioning ;) |
I saw this project, it's fully abandoned => https://github.com/DiffSK/configobj/releases |
Hm... it's last release was in 2016... but there are commits through 2018 and 2019... still doesn't seem to be that actively supported. 😢 In a word... frack. Warning it is! |
platformio.ini
Can you add a description or comment tag to the env section? That would help overcome the lost comments. |
Oh... NICE! :) I like that thinking... maybe a |
Yes, see platformio/platformio-home#137 |
That's not what I meant (or I don't understand your answer).
|
Ahhh, formatting? We do not do this. We use native Python's ConfigParser to save the configuration in a raw INI file. They know better how to do this. If you need custom formatting, custom spaces, tabs, comments, etc., please use manual editing. This configuration is intended for people who do not want to play with INI files. Like me, and others. There is no difference for me in how Python will format it. It's the same when you do configuration in operating system UI. Is it important for you how OS saves XML, Plist and other files? |
Nope, that's also not what I meant.
Just to make sure it is not about formatting, I removed the spaces ;) |
Sorry, now I understand. You can use custom fields in environment sections. Just add |
FYI: try It works for me. |
… project. Because we want to retain useful comments (see #29 (review) and platformio/platformio-core#3862).
Just ran into this issue myself. I see the discussion above but this issue is still listed as open. Is PIO going to preserve platformio.ini comments by default? That'd be amazing, but otherwise, I'd suggest closing this issue with Won't Fix |
Given the suggestion that |
We will assess this package in the upcoming PlatformIO Core 7.0. The last time we tried it (Python 2.7), it was buggy and didn't parse complex INI files very well. |
Behaviour Change Request
I think this may go in the 'too hard basket' ... but still have to ask ;)
The (fantastic, btw!) project configuration GUI does some... Makes some questionable changes to the
platformio.ini
configuration file. I shorten the header text on a lot of mine, and also comment my libdeps lines, but by ...... this removes the comments, and re-adds the full header to the file. Also, as noted by another user, it sometimes adds
on it's own, even though these options haven't been touched.
So is it possible to not change lines if they haven't been modified... i.e. don't strip the comments, and perhaps not make changes to the header.
The text was updated successfully, but these errors were encountered: