web-platform-tests / web-platform-tests/rfcs

FR: Establish a default python formatter / linter and enforce it via CI

Open
#171 17 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
110
Forks
90
PR merge metrics
No merged PRs in 30d

Description

Note: Originally copied / imported from https://github.com/web-platform-tests/wpt/issues/42710. We'll keep the other bug open to track the implementation side of this FR.

So long as we do not agree on a default formatter for this repository, back-end-forth diff noise and bikeshedding keeps coming up (e.g.).

It would be the best to everyone, and for improved devex, to agree to use one and only one formatter.
Additionally, to ensure it sticks, we should add some CI job to enforce that no violations are introduced.

The status quo (at least within the realm of WebDriver BiDi) seems to be the following:

  • Google / Chromium and the Chromium BiDi Mapper use yapf v0.31.0.
  • Mozilla / Firefox uses black.

The following AIs should happen:

  1. agree on which formatter to use: yapf, black, or something else?
  2. globally format the codebase using it
  3. add a (non-optional?) CI check to enforce it

Resources:

cc @juliandescottes @past

Contributor guide

No contributing guide indexed for this repository

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 reviewing the linked WPT issue, the referenced pull-request discussion, and the yapf and black resources. Done means the project agrees on one formatter, the codebase is formatted with it, and CI enforces that new violations are not introduced.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ci-cd, developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.