chore: black not enforced in CI quality gate
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5
- Forks
- 26
- Avg merge
- 7d 11h
- Merged PRs (30d)
- 2
Description
Summary
black --check has never been part of the effective CI quality gate on master, despite appearing to be.
Root Cause
The Makefile on master includes:
test-quality: test-lint test-codestyle test-mypy test-format
test-format:
black --check ${SRC_FILES}
And CI's quality tox env runs make test-quality. However, requirements/quality.txt (which the quality tox env installs from) does not include black. black is only present in requirements/ci.txt and requirements/dev.txt.
As a result, black --check cannot run in the quality tox env — formatting has silently been unenforced in CI.
This was discovered during the modernization PR #283. I removed test-format from test-quality in that PR to maintain parity with what master for now and let work on it with plan.
Proposed Fix
Replace black with ruff format, which is the standard formatter for modernized Open edX Python repos and is already part of the ruff linting toolchain. Specifically:
- Add
rufftorequirements/quality.in(or thequalitydependency group inpyproject.tomlafter #283) - Replace the
test-formattarget:test-format: ruff format --check ${SRC_FILES} - Restore
test-formatintest-qualityso formatting is actually enforced - Remove
blackfrom all requirements files
ruff format is Black-compatible by design and handles imports cleanly, satisfying the same formatting contract without the dependency overhead.
Related
- Modernization PR: #283
- Open edX modernization tracking: https://github.com/openedx/public-engineering/issues/506
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Makefile's test-quality and test-format targets, then inspect the quality tox environment and requirements/quality.in, requirements/ci.txt, and requirements/dev.txt. Verify which dependency configuration applies after #283. Done means the quality gate runs formatting checks successfully with the intended dependency and no longer relies on the ineffective setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ci-cd, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100