Skip to content

Commit

Permalink
Add workaround for shell assignments linting #7 #3
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski committed Aug 22, 2019
1 parent 4c9a22c commit e192de4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/adapters/notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ export class NotebookAdapter extends JupyterLabWidgetAdapter {

this.notebook_as_editor = new NotebookAsSingleEditor(
this.widget,
// filter out line magics if the language is python
this.language == 'python' ? '^%.*' : '',
// TODO: find better, language agnostic solution (or at least verify that kernel is IPython, not plain Python)
// temporary workaround: filter out IPython line magics and shell assignments if the language is python
this.language == 'python' ? '^[%!].*' : '',
// the pass is used to silence the linters in places where the line would otherwise be filtered out
this.language == 'python' ? 'pass' : ''
// TODO: ideally we would allow to substitute code for magics, etc
Expand Down

0 comments on commit e192de4

Please sign in to comment.