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 a yapf style config file. #2477

Merged
merged 2 commits into from
Dec 13, 2024
Merged

Conversation

schweitzpgi
Copy link
Collaborator

This makes the default "google" style and will help prevent people from accidentally using the yapf default style.

Fix #2428

Description

@schweitzpgi schweitzpgi added the python-lang Anything related to the Python CUDA Quantum language implementation label Dec 12, 2024
Copy link
Collaborator

@bmhowe23 bmhowe23 left a comment

Choose a reason for hiding this comment

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

FWIW, we put this into CUDA-QX. Hopefully it is equivalent to what you have here?

https://github.com/NVIDIA/cudaqx/blob/main/.style.yapf

@schweitzpgi
Copy link
Collaborator Author

schweitzpgi commented Dec 13, 2024

FWIW, we put this into CUDA-QX. Hopefully it is equivalent to what you have here?

https://github.com/NVIDIA/cudaqx/blob/main/.style.yapf

Yes. The file being added is the output from the tool itself for the "google" style. I guess the verbose format is intended to make sure any changes to default settings in future releases of yapf don't cause all the source code to get reformatted? That's a "known" issue when using clang-format, for example.

At any rate, it's the same "google" style settings.

@schweitzpgi schweitzpgi enabled auto-merge (squash) December 13, 2024 06:29
@bmhowe23
Copy link
Collaborator

I guess the verbose format is intended to make sure any changes to default settings in future releases of yapf don't cause all the source code to get reformatted? That's a "known" issue when using clang-format, for example.

I suspect we should consider updating .github/workflows/repo_checks.yml, too, because it is calling yapf --style google, which would override this style file. That is - if a future release of yapf changed the default settings, that part of our CI would be unhappy with people attempting to use the yapf style file in the PR.

This makes the default "google" style and will help prevent people from
accidentally using the yapf default style.

Fix NVIDIA#2428

Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
up to chance/whatever your copy of yapf defaults them as.

Signed-off-by: Eric Schweitz <eschweitz@nvidia.com>
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

github-actions bot pushed a commit that referenced this pull request Dec 13, 2024
Copy link
Collaborator

@khalatepradnya khalatepradnya left a comment

Choose a reason for hiding this comment

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

LGTM

@schweitzpgi schweitzpgi merged commit f0fc5f9 into NVIDIA:main Dec 13, 2024
213 checks passed
github-actions bot pushed a commit that referenced this pull request Dec 13, 2024
Copy link

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python-lang Anything related to the Python CUDA Quantum language implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cuda-quantum needs a .style.yapf file added at the top-level directory
3 participants