lbryio / lbryio/lbry-sdk

Automatic code formatting

Open
#3,199 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: other good first issue help wanted level: 1 type: improvement
Dominant language
Python
Stars
7.2k
Forks
493
PR merge metrics
No merged PRs in 30d

Description

We want something like gofmt for python. We want to minimize changes to existing code while defining a style we agree to. Ideally it should automatically format files on save (PyCharm integration would be great) and/or as a precommit hook.

One option: https://github.com/google/yapf

From @eukreign on Slack:
but to elegantly switch to yapf would require:

  1. defining a new config that's as close to current code as reasonable
  2. running the converter and adding a comment to any datastructure that is uglified by yapf

whoever takes on this project should be willing to carefully skim through the changes yapf makes to make sure it's not uglier (at least not too much uglier) than before

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by evaluating YAPF against the repository's existing Python style and reviewing the proposed configuration options. Compare its converted output carefully, especially data structures that become less readable, and assess PyCharm-on-save and pre-commit integration. Done means an agreed configuration, reviewed formatting changes, and a documented integration path.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.