platformio-core: Project Configuration does not preserve comments in `platformio.ini`
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 …
- opening the configurator
- adding a description
- hitting save
… this removes the comments, and re-adds the full header to the file. Also, as noted by another user, it sometimes adds
lib_archive = yes
test_build_project_src = no
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.

About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 16 (11 by maintainers)
Sorry, now I understand. You can use custom fields in environment sections. Just add
custom_prefix. For example,custom_env_comment = Simple MCVE environment.Nope, that’s also not what I meant. See these added (not existing) parameters:
Just to make sure it is not about formatting, I removed the spaces 😉
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.
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
Can you add a description or comment tag to the env section? Maybe that can also be used later for other purposes in PIO to maybe show in a tooltip or whatever fancy way to give more info on the env section.
That would help overcome the lost comments. A single line and multi line option would be great. One for a more short description and one for something like an abstract. It would also be useful to be able to wrap them in a define in the accompanying Python script so you can use it in the build itself.
I saw this project, it’s fully abandoned => https://github.com/DiffSK/configobj/releases