Hi folks, I feel this question probably has been a...
# general
d
Hi folks, I feel this question probably has been ask a million times, but here I go 😂 Is there an existing integration that can read
pants.toml
and update
.vscode/settings.json
? VSCode has been gaslighting me on some minor formatting setting differences; having an way to auto-sync the two settings and use
pants.toml
as the source of truth will probably make VSCode + Pants a better experience.
f
Right. So what would those changes be like? Update
settings.json
to use
flake8
linter on save or something because it has been enabled in
pants.toml
as
"pants.backend.python.lint.flake8"
?
d
Things like, mypy args, black args, tool path would also be a nice to have. I guess these things are fairly static and copy pasting is not too bad. Nice to have tho
h
There isn't yet such a thing, but we would like there to be!
The easier way would be to generate those settings manually
the cooler way would be to have vscode run pants automatically to pick up changes, if it can do such things
I use PyCharm so I don't know vscode super well
But presumably settings.json is pretty well documented...
d
Yes, vscode setting is super well documented: https://code.visualstudio.com/docs/python/settings-reference I guess I can add a subsystem called
vscode
and a goal
gen-vscode-setting
?
h
Yes, that should be pretty straightforward actually
Would you want it to edit the settings file directly?
I assume settings.json is not under version control?
d
There are folks how check in repo level vscode settings, like linting standard, extraPath, etc. . In those cases, I think we can either merge the settings, or just cowardly refuse to overwrite existing settings unless explicitly specify.