Intellij 错误地格式化了我的 .yml 文件,我在样式设置中看不到任何错误。我该如何解决?
Intellij is incorrectly formatting my `.yml` file, I cannot see any errors in my style settings. how can I fix it?
Intellij 一直错误地格式化我的 spotbugs.yml
文件,因此破坏了 github 操作。
我不明白为什么要这样做:
上周工作正常,我没有对格式配置进行任何更改,但现在,每次我从文件中更改焦点时,Intellij 都会像这样自动格式化,然后保存它。我该如何解决?
我不明白的是它的格式似乎无效 yaml
,对吗?
YAML 的语法使其与非 2 spaces 的缩进不兼容。 4 spaces,你有:
droggel:
jug:
- sequence item: with indentation
this line: isn't aligned to four spaces
nor are further indented lines:
if you indent relative four spaces
spam:
- same: problem
without: indenting the sequence item
这使得代码格式化人员很难做到正确。正确对齐意味着:
droggel:
jug:
- three spaces after the sequence item indicator.
that's horrible, nobody does that.
spam:
- alternatively this.
nobody does this either and it breaks
- - with nested sequences
我假设 IntelliJ 中的一些错误导致格式化程序因此而混淆。通常最好只使用 2 space 缩进,由于上述问题,这似乎更自然。这应该避免混淆格式化程序。
Intellij 一直错误地格式化我的 spotbugs.yml
文件,因此破坏了 github 操作。
我不明白为什么要这样做:
上周工作正常,我没有对格式配置进行任何更改,但现在,每次我从文件中更改焦点时,Intellij 都会像这样自动格式化,然后保存它。我该如何解决?
我不明白的是它的格式似乎无效 yaml
,对吗?
YAML 的语法使其与非 2 spaces 的缩进不兼容。 4 spaces,你有:
droggel:
jug:
- sequence item: with indentation
this line: isn't aligned to four spaces
nor are further indented lines:
if you indent relative four spaces
spam:
- same: problem
without: indenting the sequence item
这使得代码格式化人员很难做到正确。正确对齐意味着:
droggel:
jug:
- three spaces after the sequence item indicator.
that's horrible, nobody does that.
spam:
- alternatively this.
nobody does this either and it breaks
- - with nested sequences
我假设 IntelliJ 中的一些错误导致格式化程序因此而混淆。通常最好只使用 2 space 缩进,由于上述问题,这似乎更自然。这应该避免混淆格式化程序。