Revert flake8 and re-formats python files#5044
Revert flake8 and re-formats python files#5044bjester merged 7 commits intolearningequality:unstablefrom
Conversation
|
I think we should also replace this frontend only linting PR check: https://github.com/learningequality/studio/blob/unstable/.github/workflows/frontendlint.yml with one that runs pre-commit on everything, like the one in Kolibri: Can't quite be copy pasted directly. Alternatively, this can go in a follow up issue, which I'll be happy to pick up! |
|
I think that should be possible in this pr. Will revert in case I encounter challenges. Thanks |
26a3bf2 to
c0b6dd3
Compare
There was a problem hiding this comment.
Pull Request Overview
Reverts a prior Flake8-related commit and applies linting/formatting across Python files to ensure consistent styling and hook behavior.
- Revert the specific Flake8 commit and run lint/format on all Python files
- Normalize string quoting, add trailing commas, reorganize long statements
- Update pre-commit and GitHub Actions configs to incorporate new hooks and caching
Reviewed Changes
Copilot reviewed 293 out of 293 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| contentcuration/contentcuration/constants/completion_criteria.py | Reformatted multi-line schema resolver update and error handling |
| contentcuration/contentcuration/collectstatic_settings.py | Added # flake8: noqa and standardized quotes |
| contentcuration/contentcuration/apps.py | Changed single quotes to double quotes |
| contentcuration/contentcuration/api.py | Broke long raise and logging.info calls into multi-line |
| contentcuration/contentcuration/admin.py | Expanded tuple items onto separate lines |
| contentcuration/automation/views.py | Removed stray trailing whitespace in commented code |
| contentcuration/automation/utils/appnexus/base.py | Inserted blank lines and trailing commas for formatting consistency |
| contentcuration/automation/tests/test_recommendations_cache_model.py | Normalized quotes and added trailing commas |
| contentcuration/automation/tests/appnexus/test_base.py | Broke patched calls into multi-line and normalized quotes |
| contentcuration/automation/tests.py | Removed stray trailing whitespace |
| contentcuration/automation/models.py | Standardized quotes in related_name and index fields |
| contentcuration/automation/migrations/0001_initial.py | Reflowed migration field definitions to comply with formatting |
| contentcuration/automation/apps.py | Changed single quotes to double quotes |
| contentcuration/automation/admin.py | Removed stray trailing whitespace |
| LICENSE | Removed trailing whitespace |
| .pre-commit-config.yaml | Added dependencies, Black, and local hooks |
| .github/workflows/pre-commit.yml | Renamed job, added Python setup, Node cache, and pre-commit step |
| .git-blame-ignore-revs | Added new lint/format commit hashes |
Comments suppressed due to low confidence (2)
.pre-commit-config.yaml:37
- [nitpick] This exclusion regex for the no-auto-migrations hook is very long and brittle. Consider simplifying it by narrowing the directory scope or using a glob pattern to make it easier to maintain.
exclude: (?x)^(… very long list …)$
.github/workflows/pre-commit.yml:35
- Indentation for the
- uses: actions/setup-python@v5step is misaligned and will break the YAML workflow. Align this step with other- uses:entries understeps:with consistent indentation.
- uses: actions/setup-python@v5
bjester
left a comment
There was a problem hiding this comment.
I asked Copilot for a review. Considering it's mostly formatting, hopefully it's able to be more thorough regarding functional changes. Although, I think the GH workflow should have some bits reverted
bjester
left a comment
There was a problem hiding this comment.
Copilot gives some confidence that few actual functionality changes were made, in agreement that this is a linting update. All requested changes have been made. LGTM
# Conflicts: # contentcuration/contentcuration/utils/publish.py # Conflicts: # contentcuration/contentcuration/tests/viewsets/test_recommendations.py # contentcuration/contentcuration/urls.py
Summary
This pr reverts this commit. Additionally, runs python linting and prettifying on the repo.
References
Closes #5010
Reviewer guidance
Ensure that the
.git-blame-ignore-revs