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

lint Jupyter notebooks #3031

Merged
merged 2 commits into from
Nov 30, 2022
Merged

lint Jupyter notebooks #3031

merged 2 commits into from
Nov 30, 2022

Conversation

ptitzler
Copy link
Member

@ptitzler ptitzler commented Nov 29, 2022

This PR enables Jupyter notebook linting in this repository and addresses existing linting issues.

Example output if a notebook violates a linting rule:

$ make lint-server
python3 -m flake8 elyra .github
python3 -m black --check --diff --color .
--- elyra/tests/pipeline/resources/validation_pipelines/NotebookA.ipynb	2022-11-30 17:07:18.271081 +0000:cell_0
+++ elyra/tests/pipeline/resources/validation_pipelines/NotebookA.ipynb	2022-11-30 17:07:35.595326 +0000:cell_0
@@ -1 +1 @@
-print('Hello World')
+print("Hello World")
would reformat elyra/tests/pipeline/resources/validation_pipelines/NotebookA.ipynb
Oh no! 💥 💔 💥
1 file would be reformatted, 158 files would be left unchanged.
Black formatting encountered issues.  Use 'make black-format' to apply the suggested changes.
make: *** [lint-server] Error 1

Signed-off-by: Patrick Titzler ptitzler@us.ibm.com

What changes were proposed in this pull request?

  • Update linting prerequisites
  • Address linting issues
  • (setup.py - no functional impact) moved black dependency because the package is now required for Airflow and KFP (Rewrite KFP code generation #2993 introduced that dependency for KFP)

How was this pull request tested?

  • CI tests

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.

Signed-off-by: Patrick Titzler <ptitzler@us.ibm.com>
@elyra-bot
Copy link

elyra-bot bot commented Nov 29, 2022

Thanks for making a pull request to Elyra!

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

@ptitzler ptitzler added the component:test Test-related label Nov 29, 2022
@ptitzler ptitzler added this to the 3.14.0 milestone Nov 29, 2022
@akchinSTC akchinSTC self-requested a review November 29, 2022 22:41
@ptitzler ptitzler added the status:Work in Progress Development in progress. A PR tagged with this label is not review ready unless stated otherwise. label Nov 30, 2022
Signed-off-by: Patrick Titzler <ptitzler@us.ibm.com>
@ptitzler ptitzler changed the title lint test notebooks lint Jupyter notebooks Nov 30, 2022
@ptitzler ptitzler removed the status:Work in Progress Development in progress. A PR tagged with this label is not review ready unless stated otherwise. label Nov 30, 2022
@ptitzler ptitzler added the kind:CI Impacts continuous integration (build, test, etc.) label Nov 30, 2022
@akchinSTC akchinSTC merged commit a728201 into elyra-ai:main Nov 30, 2022
@ptitzler ptitzler deleted the lint-test-assets branch November 30, 2022 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:test Test-related kind:CI Impacts continuous integration (build, test, etc.) sizing: XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants