import numpy as np
global_list = [1,2,3
,4,5,6]
def bad_style(arg1:str,arg2)->int:
if arg2:
print(arg1)
else:
return arg1 + 2 # Error here, cannot add string to int
def compressed_code(arg) -> None:
print("Code is overly compressed ")
return 2
!nbqa mypy ./notebook.ipynb
notebook.ipynb:cell_1:2: error: Missing return statement
notebook.ipynb:cell_1:6: error: Unsupported operand types for + ("str" and "int")
notebook.ipynb:cell_1:9: error: No return value expected
Found 3 errors in 1 file (checked 1 source file)
!nbqa flake8 ./notebook.ipynb
notebook.ipynb:cell_1:1:1: F401 'numpy as np' imported but unused
notebook.ipynb:cell_1:2:1: E302 expected 2 blank lines, found 0
notebook.ipynb:cell_1:2:4: E271 multiple spaces after keyword
notebook.ipynb:cell_1:2:22: E231 missing whitespace after ':'
notebook.ipynb:cell_1:2:41: W291 trailing whitespace
notebook.ipynb:cell_1:6:10: E111 indentation is not a multiple of 4
notebook.ipynb:cell_1:6:10: E117 over-indented
notebook.ipynb:cell_1:6:25: E261 at least two spaces before inline comment
notebook.ipynb:cell_1:7:1: E302 expected 2 blank lines, found 0
!nbqa black ./notebookpostblack.ipynb
!nbqa flake8 ./notebookpostblack.ipynb
reformatted notebookpostblack.ipynb
All done! ✨ 🍰 ✨
1 file reformatted.
notebookpostblack.ipynb:cell_1:1:1: F401 'numpy as np' imported but unused
notebookpostblack.ipynb:cell_4:1:1: E265 block comment should start with '# '