Skip to content

Conversation

@MarcoGorelli
Copy link
Collaborator

@MarcoGorelli MarcoGorelli commented Apr 2, 2021

closes #557

@MarcoGorelli MarcoGorelli requested a review from a team April 2, 2021 10:38
@girip11
Copy link
Contributor

girip11 commented Apr 2, 2021

@MarcoGorelli : I am will review this PR tomorrow. Could you keep this open till then?

if magic_type != IPythonMagicType.CELL:
return False
first_line = source[0].lstrip()
return all(first_line.split()[0] != f"%%{i}" for i in process)
Copy link
Contributor

Choose a reason for hiding this comment

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

all(first_line.split()[0] != f"%%{i}" for i in process) could be simplified as first_line.split()[0].lstrip("%%") not in process

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! Though note that .lstrip("%%") is the same as .lstrip("%"). I've changed this slightly as lstrip is really unintuitive, and using it resulted in bug #500

{path_3}:cell_8:3: error: Name 'flake8_version' is not defined
{path_3}:cell_8:4: error: Name 'flake8_version' is not defined
Found 5 errors in 4 files (checked 20 source files)
Found 5 errors in 4 files (checked 22 source files)
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of updating this count every time, shall we do something like rglob on *.ipynb on the tests/data directory?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, definitely :) will keep that for a separate PR though as this one is big enough

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, I just pointed out.

@codecov-io
Copy link

codecov-io commented Apr 3, 2021

Codecov Report

Merging #559 (c56fe3d) into master (a051cb1) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #559   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines          733       752   +19     
  Branches       106       110    +4     
=========================================
+ Hits           733       752   +19     
Impacted Files Coverage Δ
nbqa/__main__.py 100.00% <ø> (ø)
nbqa/cmdline.py 100.00% <100.00%> (ø)
nbqa/config/config.py 100.00% <100.00%> (ø)
nbqa/handle_magics.py 100.00% <100.00%> (ø)
nbqa/save_source.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a051cb1...c56fe3d. Read the comment docs.

@MarcoGorelli MarcoGorelli merged commit b678c9d into nbQA-dev:master Apr 4, 2021
@MarcoGorelli MarcoGorelli deleted the opt-in branch April 4, 2021 15:06
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (99fe168) to head (ebb5673).
Report is 168 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #559   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines          739       758   +19     
  Branches       106       110    +4     
=========================================
+ Hits           739       758   +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Make cell-magics opt-in rather than opt-out

4 participants