google / google/yapf

Style api for use as a module

Open
#405 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
14k
Forks
904
PR merge metrics
No merged PRs in 30d

Description

Right now there is no documented way to create a Style object for use with the "for use as a module" apis (i.e., `FormatCode` and `FormatFile`).

Given the current apis (at least in as far as they are documented), the only way to use a custom style is to write out a file on disk and to point to that file. That's suboptimal if you're trying to use it as part of a conversion pipeline that tries to keep configuration and computation in-memory. It's also suboptimal for debugging a call to FormatCode in an interactive session (e.g., in a Jupyter notebook).

Alternatively, having a way to set individual "knobs" directly in the module level APIs (e.g., by passing in a dictionary with the knob names as the keys) would avoid this as well.

cc @Carreau

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.