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 support for yapf formatter #111

Closed
Spenhouet opened this issue Sep 22, 2022 · 3 comments
Closed

Add support for yapf formatter #111

Spenhouet opened this issue Sep 22, 2022 · 3 comments
Labels
triage-needed Issue is not triaged.

Comments

@Spenhouet
Copy link

Spenhouet commented Sep 22, 2022

The example config in the README shows "isort.args": ["--profile", "black"] but we are using yapf as formatter.
I tried setting "yapf" here but then isort throws this error:

isort.exceptions.ProfileDoesNotExist: Specified profile of yapf does not exist. Available profiles: black,django,pycharm,google,open_stack,plone,attrs,hug,wemake,appnexus.

From this I take it that yapf is not yet supported.
I hope this can be added.

@github-actions github-actions bot added the triage-needed Issue is not triaged. label Sep 22, 2022
@karthiknadig
Copy link
Member

The extension is a wrapper around isort pyhton library. When you pass those isort.args they are beeing passed to the isort tool. think python -m isort --profile yapf. So, you should be filing this as a feature request on isort here https://github.com/pycqa/isort

@karthiknadig
Copy link
Member

Looks like there is google can you try with that for profile:

--profile PROFILE     Base profile type to use for configuration. Profiles include: black, django, pycharm, google, open_stack,  
                        plone, attrs, hug, wemake, appnexus. As well as any shared profiles.

@Spenhouet
Copy link
Author

Thanks for the hint. I just saw that myself and also found this thread arguing about if this is actually correct: PyCQA/isort#1486
It does format imports differently to how we are used to from yapf but I can't say if it's incorrect or not.

I will raise further issues on that with isort if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Issue is not triaged.
Projects
None yet
Development

No branches or pull requests

2 participants