Skip to content

Commit e192de4

Browse files
committed
Add workaround for shell assignments linting #7 #3
1 parent 4c9a22c commit e192de4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/adapters/notebook.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ export class NotebookAdapter extends JupyterLabWidgetAdapter {
6565

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

0 commit comments

Comments
 (0)