Skip to content

reset settings to avoid auto-format#239

Merged
ccmywish merged 2 commits intoRubyMetric:devfrom
Mikachu2333:feat/update_vsc_settings
Aug 7, 2025
Merged

reset settings to avoid auto-format#239
ccmywish merged 2 commits intoRubyMetric:devfrom
Mikachu2333:feat/update_vsc_settings

Conversation

@Mikachu2333
Copy link
Copy Markdown
Collaborator

问题描述

  1. 原来的设置没搞好,在我的设备上还是会自动format,所以打了个补丁,现在应该可以适用于全部设备了
  2. N/A

方案与实现

  1. 增加了几种格式的format禁止设置
  2. 重新排序了一下,现在观感好多了
  3. 硬设置了tab为2(与现有文件一致)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 7, 2025

Hi @Mikachu2333,

❤️ 感谢你的贡献!我们将在5天内阅读此 PR 并回复你

Copy link
Copy Markdown
Contributor

@ccmywish ccmywish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍👍👍

"editor.tabSize": 2,

这一项应当删除,有这么几个原因:

  1. .editorconfig 可能有冲突
  2. Makefile 对 tab 很敏感,我不知道设置成这个是否会影响 Makefile
  3. 你可以看一下 .editorconfig 这个文件,JSON 是设置为4个空格的,这是因为 VS Code 经常会强制重写 .vscode 里的文件,总是使用4个空格
  4. 项目里还有 Perl 代码,实际上按照 Perl 的标准应该用4个空格缩进,只不过我一直都没有调整这一点

我觉得还是集中用 .editorconfig 里的设置来控制合适一些。

我觉得整个项目应该采用 入乡随俗 的原则:官方有比较唯一性推荐的,沿用官方。比如 YAML 官方推荐用几个空格(2个),我们尽量用几个,JSON 官方推荐用几个空格(4个),我们就用几个。具体某个编程语言,如 Perl 这样的,虽然有不同的风格,但是 4 个空格是 Larry Wall 所认同的,应当按照4个。

所以应当把这个配置项删除。

@ccmywish ccmywish added this to the v0.2.3 milestone Aug 7, 2025
@Mikachu2333
Copy link
Copy Markdown
Collaborator Author

所以应当把这个配置项删除。

感觉是得改,我改改,把c设置成缩进2,其余默认

@Mikachu2333
Copy link
Copy Markdown
Collaborator Author

fixed

@ccmywish ccmywish merged commit 5e679b1 into RubyMetric:dev Aug 7, 2025
@Mikachu2333 Mikachu2333 deleted the feat/update_vsc_settings branch August 7, 2025 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants