Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add black code formatter #515

Merged
merged 4 commits into from
May 30, 2024

Conversation

linsword13
Copy link
Collaborator

Changes included:

  • Add in a ramble style cmd. Currently it supports running flake8 and black
  • This new style cmd will replace ramble flake8 in the future

Next step is to run ramble style -a -t black -f to apply auto-format to all the in-scope files.

This heavily models after `spack style`, and includes only `flake8`
check currently. The intent is to have a general style check command to allow for
adding in more style check tools like `black`.

`ramble style` is a replacement of `ramble flake8` as of now.

Next step is to add in black formatter support.
Currently this is not enforced in any CI checks yet.

Next step is to apply the formatter fix, and then enforce the format
check after that.

Example usage:

```
// Check with both black and flake8
ramble style

// Only check black
ramble style -t black

// Apply black fix for all relevant files
ramble style -t black -a -f
```
Copy link
Collaborator

@douglasjacobsen douglasjacobsen left a comment

Choose a reason for hiding this comment

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

This is awesome, thanks for working on this!

@linsword13 linsword13 merged commit d6867cf into GoogleCloudPlatform:develop May 30, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants