decaporg / decaporg/decap-cms

Provide option to set number of spaces for indentation when Netlify CMS saves a .yml file

Open
#5,870 4 comments 0 reactions 0 assignees View on GitHub
area: configuration area: formats type: feature
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

I tried googling for this issue and found absolutely nothing, so i am opening up an issue.

## The problem

We use two ways of editing the content of our website:

- we use Netlify CMS to edit content that is stored in .yml files
- directly editing content in .yml files in our IDE's

Because as a team we agreed on using 4 spaces for indentation (and prettier auto-formats this every time we save a file), and because Netlify CMS seems to use 2 spaces, everytime someone edits a .yml file in an editor the entire indentation of the file is set to 4, leading the entire file to be seen by git as "changed", which leads to quite unreadable git diffs.

Proposed solution:

Adding an optional key/value pair in the netlify.toml config file where you can override the default number of spaces. This would be a non-breaking change cause existing projects still would continue to use 2 spaces, and we can set it to 4 :)

Is this possible? What do you think about this idea?

Thanks in advance!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.