question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Keep toml file indent while executing pdm command

See original GitHub issue

Before I ran pdm add -d xxx, it looks like this:

a1

And after:

a2

Is it possible to keep the brackets aligned?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
frostmingcommented, Oct 27, 2022

I’m still seeing a similar issue with pdm 2.1.5 and tomlkit 0.11.5, 2 space indent gets changed to 4 on pdm add.

It is not the same as described in this issue. PDM doesn’t keep the indentation length on add but rather normalizes it to 4 spaces, we are not changing this.

0reactions
nyuszika7hcommented, Oct 27, 2022

Yes, I was going to mention that since you already use tomlkit it shouldn’t be difficult to keep formatting. Also, how does changing indentation reduce diff noise? If anything it increases it (though generally whitespace diffs can be suppressed).

As for black, I find it’s useful as a single pass to clean up a really messy code base, but I tried using it as a pre-commit hook for a while and found some cases where it seemed to make my code uglier / harder to read than before, opinionated formatting aside (they even managed to convince me to use double instead of single quotes). But this is off-topic so I’ll end it here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A style guide for toml? · Issue #608 - GitHub
Indent is elegant and clear. Personally, I use indent to make the structure of the file very clear. And I use vim and...
Read more >
r - blogdown indentation for TOML tables - in particular the ...
I'm confused by the indentation of the [params.logo] table, five lines from the end of the file. Shouldn't this [params.logo] table be non- ......
Read more >
yamlfix
A simple opinionated yaml formatter that keeps your comments! ... run yamlfix with two config files yamlfix -c base.toml --config-file ...
Read more >
How to Manage Configurations Easily Using TOML Files
We can configure the node environment, the build command, the output directory, etc., in this config file. Another good example is the GitLab ......
Read more >
What is wrong with TOML? - HitchDev
TOML is a configuration designed as a sort of "improved" INI file. It's analogous to this project - StrictYAML, a similar attempt to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found