My name is Kazuhiro Minomaki (https://qiita.com/mimaki_kazuhiro) and I am an intern at Future Electronic Technology. This time I will write about flake8.
Since you are a beginner in programming, the content may be incorrect. If there are any mistakes, I will correct them so please point out more and more.
flake8 is a Python grammar check tool.
I will actually use it. First install.
terminal
$ pip install flake8
If you execute flake8 with the file name specified as shown below, the result of the code check will be displayed. The command argument can be a directory name instead of a file name.
terminal
$ flake8 test.py
test.py:1:1: F401 'sys' imported but unused
test.py:3:4: E222 multiple spaces after operator
test.py:4:7: E231 missing whitespace after ','
test.py:4:12: E202 whitespace before ']'
test.py:6:1: W293 blank line contains whitespace
test.py:6:1: W391 blank line at end of file
In this way, mistakes can be detected.
Recommended Posts