Skip to content

innovationOUtside/nbqa-inject-flake8-report

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nbqa-inject-flake8-report

Inject nbqa flake8 report into notebooks

Installation

pip install git+https://github.com/innovationOUtside/nbqa-inject-flake8-report.git

Usage

For example, with nbqa installed, run:

nbqa flake8 notebooks/*.ipynb > flake8_reports.txt

And then to inject the flake8 reports into notebook code cell outputs:

nb_report_inject flake8 flake8_reports.txt

# Then to synch jupytext
jupytext --sync  notebooks/*.ipynb
# Jupytext doesn't map outputs but we need to keep timestamps in synch

By default, outputs are written to notebooks/*_flake8.ipynbWe can clear and overwrite output cells in the reported on notebooks with the --overwrite / --no-overwrite flag:

nb_report_inject flake8 --overwrite flake8_reports.txt

By default, code cells with injected flake8 reports are annotated with a generic flake8-error tag as well as a flake8-error-CODE tag for each distinct flake8 error code reported for that cell (TO DO - also clear error code tags...); these can be explicilty enabled / disabled with the --tags/--no-tags flag:

nb_report_inject flake8 --no-tags flake8_reports.txt

About

Inject nbqa flake8 report into notebooks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages