dockstation icon indicating copy to clipboard operation
dockstation copied to clipboard

docker-compose.yml should not be reformated

Open op-fasc opened this issue 6 years ago • 10 comments

Including a docker-compose.yml as project, causes some reformating (e.g. indenting), which means a version control system recognizes this as change. This is not so ideal if a IDE reformats file before commiting based on a team wide configuration.

It would be helpful if this can be configureable within settings and disabled by default.

op-fasc avatar Oct 06 '17 09:10 op-fasc

I'm not sure that it's easy way. Because during your some change action - We parse your YML config to an array -> adding your changes to the array -> convert array comeback to YML and write it to file. We got a default YML standards with 2 spaces. If you're using some other style I think that need to find some other way for after styling your config. If we disable the possibility to change YML config you will not able to make changes from the app.

igor-lemon avatar Oct 06 '17 14:10 igor-lemon

Ok, i see. That might be a big change. Maybe you could make the number of spaces configureable.

op-fasc avatar Oct 09 '17 07:10 op-fasc

Yep. We can add it into project settings. Do you use 4 spaces?

igor-lemon avatar Oct 09 '17 09:10 igor-lemon

Normally we're also using 2 spaces, but it seems we looked over it in the coding styles for our IDE.

op-fasc avatar Oct 09 '17 09:10 op-fasc

Not just spaces. It also removes blank line. In my docker-compose file I have all services separated by 1 line to make reading easier. After initializing a project in DockStation all blank lines got removed :)

desprit avatar Nov 11 '17 11:11 desprit

Same issue for me docker-compose file is in git

lexbritvin avatar Jan 31 '18 12:01 lexbritvin

Ok. We'll think how to do it more correct.

igor-lemon avatar Jan 31 '18 13:01 igor-lemon

Any news on this? Looks like all strings are reformatted and encapsulated, comments are removed, syntax is then re-optimized, ...

schtr4jh avatar Nov 18 '19 21:11 schtr4jh

Yes. We're testing this. We implemented AST processing.

igor-lemon avatar Nov 18 '19 21:11 igor-lemon

Re: any news on this? I am still getting reformatting and removal of comments, which I was using to delineate groups of containers.

deefdragon avatar Nov 29 '21 06:11 deefdragon