最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Have different Black settings for submodules in main repo - Stack Overflow

programmeradmin7浏览0评论

I'm cloning a repo which contains 2 submodules cloned in the subs/ folder, so the structure is like:

main_repo/
-- subs/
---- sub_01
---- sub_02

I would want each of them to have different settings, for example line length for the Black formatter and flake8, so I created 3 .vscode/settings.json file (main repo, and in each of the submodules' folders), each containing:

  "[python]": {
    "editor.formatOnType": false,
    "editor.formatOnSave": true,
    "editor.defaultFormatter": "ms-python.black-formatter",
  },
  "black-formatter.args": [
    "--line-length=xxx".
  ]

I set the line length to 150 in the main repo and sub_01, and 100 in sub_02, but it seems the 150 setting is being used everywhere when I save.

I'm cloning a repo which contains 2 submodules cloned in the subs/ folder, so the structure is like:

main_repo/
-- subs/
---- sub_01
---- sub_02

I would want each of them to have different settings, for example line length for the Black formatter and flake8, so I created 3 .vscode/settings.json file (main repo, and in each of the submodules' folders), each containing:

  "[python]": {
    "editor.formatOnType": false,
    "editor.formatOnSave": true,
    "editor.defaultFormatter": "ms-python.black-formatter",
  },
  "black-formatter.args": [
    "--line-length=xxx".
  ]

I set the line length to 150 in the main repo and sub_01, and 100 in sub_02, but it seems the 150 setting is being used everywhere when I save.

Share Improve this question edited Mar 21 at 11:19 jonrsharpe 122k30 gold badges268 silver badges476 bronze badges asked Mar 21 at 10:51 CarloCarlo 1,5901 gold badge19 silver badges58 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

A settings file only applies to one workspace.

But you could vote the request: https://github/Microsoft/vscode/issues/32693

发布评论

评论列表(0)

  1. 暂无评论