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

Update linting to use black formatter #2618

Merged
merged 21 commits into from Apr 1, 2022
Merged

Conversation

akchinSTC
Copy link
Member

@akchinSTC akchinSTC commented Mar 31, 2022

  • Reformatted elyra root directory with black formatter

  • Added black to lint-server Make target

  • Added pyproject.toml (Black only supports use of toml)

  • Added black and click to lint requirements, recent release of click 8.1.0 is causing black to fail

  • Flake8 conflicts that appear after black reformatting, should we ignore in flake8 or add rules to black to not do this? See https://github.com/elyra-ai/elyra/runs/5776010612?check_suite_focus=true

    W503 - line break before binary operator
    I202 - Additional newline in a group of imports.
    E203 - whitespace before ':'

What changes were proposed in this pull request?

  • This PR introduces the use of black to the lint-server target of the Makefile (in conjunction with the existing flake8 pass) in order to produce a consistent code style throughout the python code.

  • We've also used this (one-time) opportunity to convert formatted strings (e.g., "{}".format(foo)) to f-strings (e.g., f"{foo}"). This particular "convention" will continue to be enforced via the review process.

How was this pull request tested?

  • Existing tests were confirmed to pass.

Developer's Certificate of Origin 1.1

   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.

@elyra-bot
Copy link

elyra-bot bot commented Mar 31, 2022

Thanks for making a pull request to Elyra!

To try out this branch on binder, follow this link: Binder

@akchinSTC akchinSTC linked an issue Mar 31, 2022 that may be closed by this pull request
@akchinSTC akchinSTC merged commit 720fb36 into elyra-ai:master Apr 1, 2022
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.

use black formatter on elyra's python code
4 participants