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 beautifier for Python #2189

Merged
merged 5 commits into from
Sep 12, 2018
Merged

Add Black beautifier for Python #2189

merged 5 commits into from
Sep 12, 2018

Conversation

arl-o
Copy link

@arl-o arl-o commented Jul 30, 2018

What does this implement/fix? Explain your changes.

Adds support for the Black python beautifier.

Does this close any currently open issues?

Closes #2144

Any other comments?

Currently does not support line length option, since Black uses a different default from autopep8 and yapf which I did not want to overwrite. (Is there a supported way to set this on an executable-basis?)

I also did not see how to set up test examples for specific beautifiers, instead of specific languages. Is there a way to do this?

Checklist

  • Merged with latest master branch
  • Regenerate documentation with npm run docs
  • Add change details to CHANGELOG.md under "Next" section
  • Travis CI passes (Mac support)
  • Added examples for testing to examples/ directory
  • AppVeyor passes (Windows support)

@arl-o
Copy link
Author

arl-o commented Jul 30, 2018

CI checks are failing because black requires python 3.6.0+ to run.

Should I try updating the .ymls to use pip3?

@stevenzeck
Copy link
Contributor

I'm trying to remember if you can include this in .travis.yml for non-Python builds, I think you can so put this underneath language: generic

python:
  - "3.6"

For appveyor.yml, change the two C:\Python27 to C:\Python36 on this line: https://github.com/arl-o/atom-beautify/blob/master/appveyor.yml#L13.

If pip3 is necessary, change that as well.

@arl-o
Copy link
Author

arl-o commented Jul 30, 2018

I'm running some CI tests on a new branch, will update here when that's working.

@stevenzeck
Copy link
Contributor

Here's what we use for beautifier-black: https://github.com/Unibeautify/beautifier-black/blob/master/.travis.yml

@arl-o
Copy link
Author

arl-o commented Jul 30, 2018

Arg. The above works for linux to install black, which then fails afterward because fuse, react, and various language packages, fail to load.

edit: I really can't figure out how to get pip3 working. I've tried about 2 dozen configurations, and now I'm getting errors in travis on totally unrelated lines like No available formula with the name "composer" .

@arl-o
Copy link
Author

arl-o commented Jul 31, 2018

Reverted to a version that doesn't install Black for travisCI checks. No idea why AppVeyor is now failing on apm install --packages-file atom-packages.txt, since nothing was changed from the main branch that should affect it.

@stevenzeck
Copy link
Contributor

Yea I can't install language-marko locally either. Not sure how Travis was able to pass.

@arl-o arl-o closed this Jul 31, 2018
@arl-o arl-o reopened this Jul 31, 2018
@arl-o
Copy link
Author

arl-o commented Jul 31, 2018

Looks like appveyor was also failing on the master branch for the same reason.

Also I accidentally hit close. Many mistakes.

@stevenzeck stevenzeck merged commit 596b979 into Glavin001:master Sep 12, 2018
@stevenzeck stevenzeck added this to the Next Release milestone Sep 12, 2018
@stevenzeck
Copy link
Contributor

Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Black beautifier for Python
2 participants