yapf icon indicating copy to clipboard operation
yapf copied to clipboard

How do you use the knob?

Open SBoudrias opened this issue 10 years ago • 7 comments

The documentation is very vague about this and doesn't gives any hint as to how you'd use them.

SBoudrias avatar Dec 03 '15 23:12 SBoudrias

Sorry, I'll change that. In the meantime, you can set up a .style.yapf in the base directory of your project. In it, you will have something like:

[style]
based_on_style = pep8
spaces_before_comment = 3

Each knob is listed with a description if you use yapf --style-help.

bwendling avatar Dec 04 '15 21:12 bwendling

Oh also, yapf expect specific ini section depending in which file we store it.

  • [style] for .style.yapf
  • [yapf] for config.cfg

SBoudrias avatar Dec 04 '15 21:12 SBoudrias

The documentation is still very vague. Is based_on_style on "knob"? If so, why isn't it listed as such?

eskenny avatar Mar 24 '17 20:03 eskenny

Yes i also stumbled over it. can you please clarify if the capital KNOBs can just be used with lower case letters?

vinnichase avatar Apr 11 '18 12:04 vinnichase

Oh also, yapf expect specific ini section depending in which file we store it.

  • [style] for .style.yapf
  • [yapf] for config.cfg

If I am not wrong should not [yapf] for setup.cfg ? Thanks in advance :)

chashiv avatar Apr 07 '19 21:04 chashiv

Yes i also stumbled over it. can you please clarify if the capital KNOBs can just be used with lower case letters?

@vinnichase Yes, they can be :P

chashiv avatar Apr 13 '19 04:04 chashiv

This still is unclear to me. So this works for a .styl.yapf file?

[style]
based_on_style = google
spaces_before_comment = 4
split_before_logical_operator = true

COLUMN_LIMIT = 100
SPACES_BEFORE_COMMENT = 3

ismet55555 avatar May 08 '21 02:05 ismet55555