Skip to content

[FC-0099] chore: implement format command for easier quality management#108

Merged
mariajgrimaldi merged 5 commits intomainfrom
MJG/quality
Oct 23, 2025
Merged

[FC-0099] chore: implement format command for easier quality management#108
mariajgrimaldi merged 5 commits intomainfrom
MJG/quality

Conversation

@mariajgrimaldi
Copy link
Copy Markdown
Member

@mariajgrimaldi mariajgrimaldi commented Oct 22, 2025

Description

This PR #100 has a substantial amount of changes, and each time I try to run black, more and more changes come up. The idea is that before merging a PR we run make format to avoid this.

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Oct 22, 2025
@openedx-webhooks
Copy link
Copy Markdown

Thanks for the pull request, @mariajgrimaldi!

This repository is currently maintained by @openedx/committers-openedx-authz.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

Copy link
Copy Markdown
Contributor

@bmtcril bmtcril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always love these commands. It looks like black isn't added to requirements, and I think that if we're going to move to black we should replace all of the pycodestyle references in requirements and tox.ini with it as well so they don't disagree on things and cause incompatible issues.

@mariajgrimaldi
Copy link
Copy Markdown
Member Author

Ups, I forgot to add it as a requirement. Thanks!

Why would using black (compatible with pycodestyle, but it does the formatting automatically) mean replacing pycodestyle?

@BryanttV
Copy link
Copy Markdown
Contributor

Thank you! @mariajgrimaldi, this is a very useful command to keep us aligned on code quality. I just have 2 comments:

  1. Why not use ruff? Currently, we are using it in openedx hooks repos.

    format:
        ruff format openedx_authz tests --line-length 120
        ruff check --select I --fix --line-length 120

    I added the line-length 120 because, for now, that is the limit defined according to the Open edX Python Style Guide, but I don't see a big problem with limiting it to 79.

In any case, regardless of the package we use, I believe it should be consistent throughout the plugin. For example, pycodestyle is configured to have a max-length of 120.

@bmtcril
Copy link
Copy Markdown
Contributor

bmtcril commented Oct 22, 2025

I agree with what @BryanttV said regarding how the settings can drift between packages. I've seen in other packages where we have custom pycodestyle settings that don't exist in black, so they conflict. I have a slight preference for ruff over black but also don't much care as long as we're using the same thing with the same settings to do the formatting and the checking.

@mariajgrimaldi
Copy link
Copy Markdown
Member Author

mariajgrimaldi commented Oct 22, 2025

~I'd also prefer ruff but I don't have the time to migrate or test it so maybe later we can consider it as part of a maintenance effort. ~

I went with ruff...

@mariajgrimaldi
Copy link
Copy Markdown
Member Author

@BryanttV: I'm going forward with ruff. What other configurations would we need to comply with pycodestyle?

@BryanttV
Copy link
Copy Markdown
Contributor

BryanttV commented Oct 22, 2025

@mariajgrimaldi I think with the line-length 120 in the ruff command is enough to align us with pycodestyle for now.

Later on, we can implement a standardized configuration using a ruff.toml file.

@mariajgrimaldi
Copy link
Copy Markdown
Member Author

Done!!! @bmtcril @BryanttV

Thank you both :)

Copy link
Copy Markdown
Contributor

@BryanttV BryanttV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@bmtcril
Copy link
Copy Markdown
Contributor

bmtcril commented Oct 22, 2025

Should be all good if you can update tox.ini as well, thank you!

@MaferMazu MaferMazu moved this to Ready for testing in RBAC AuthZ Board Oct 22, 2025
@mariajgrimaldi mariajgrimaldi changed the title chore: implement format command for easier quality management [FC-0099] chore: implement format command for easier quality management Oct 22, 2025
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Oct 22, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Oct 22, 2025
@mariajgrimaldi
Copy link
Copy Markdown
Member Author

@BryanttV @bmtcril: remember when I said I didn't have time to migrate to ruff... well I did 😄

Copy link
Copy Markdown
Contributor

@bmtcril bmtcril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay! Thanks for this.

@mariajgrimaldi mariajgrimaldi merged commit 04d8a9f into main Oct 23, 2025
14 checks passed
@mariajgrimaldi mariajgrimaldi deleted the MJG/quality branch October 23, 2025 14:12
@github-project-automation github-project-automation Bot moved this from Ready for review to Done in RBAC AuthZ Board Oct 23, 2025
@github-project-automation github-project-automation Bot moved this from Ready for Review to Done in Contributions Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project
Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants