https://pantsbuild.org/ logo
d

dazzling-diamond-4749

08/06/2021, 6:51 AM
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

fresh-cat-90827

08/06/2021, 7:35 AM
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

dazzling-diamond-4749

08/06/2021, 7:47 AM
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

happy-kitchen-89482

08/06/2021, 2:02 PM
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

dazzling-diamond-4749

08/06/2021, 8:06 PM
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

happy-kitchen-89482

08/07/2021, 3:49 PM
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

dazzling-diamond-4749

08/07/2021, 10:30 PM
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.
3 Views