1. flake8 설치하기
(base) marie@MarieJungui-MacBookPro:~ »
(base) marie@MarieJungui-MacBookPro:~ »
(base) marie@MarieJungui-MacBookPro:~ »
(base) marie@MarieJungui-MacBookPro:~ »
(base) marie@MarieJungui-MacBookPro:~ »
(base) marie@MarieJungui-MacBookPro:~ »
(base) marie@MarieJungui-MacBookPro:~ » conda create -n haha python=3.7
Collecting package metadata (current_repodata.json): done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.7.12
latest version: 4.8.1
Please update conda by running
$ conda update -n base -c defaults conda
## Package Plan ##
environment location: /Users/marie/miniconda3/envs/haha
added / updated specs:
- python=3.7
The following packages will be downloaded:
package | build
---------------------------|-----------------
ca-certificates-2020.1.1 | 0 125 KB
pip-20.0.2 | py37_1 1.7 MB
wheel-0.34.1 | py37_0 50 KB
------------------------------------------------------------
Total: 1.8 MB
The following NEW packages will be INSTALLED:
ca-certificates pkgs/main/osx-64::ca-certificates-2020.1.1-0
certifi pkgs/main/osx-64::certifi-2019.11.28-py37_0
libcxx pkgs/main/osx-64::libcxx-4.0.1-hcfea43d_1
libcxxabi pkgs/main/osx-64::libcxxabi-4.0.1-hcfea43d_1
libedit pkgs/main/osx-64::libedit-3.1.20181209-hb402a30_0
libffi pkgs/main/osx-64::libffi-3.2.1-h475c297_4
ncurses pkgs/main/osx-64::ncurses-6.1-h0a44026_1
openssl pkgs/main/osx-64::openssl-1.1.1d-h1de35cc_3
pip pkgs/main/osx-64::pip-20.0.2-py37_1
python pkgs/main/osx-64::python-3.7.6-h359304d_2
readline pkgs/main/osx-64::readline-7.0-h1de35cc_5
setuptools pkgs/main/osx-64::setuptools-45.1.0-py37_0
sqlite pkgs/main/osx-64::sqlite-3.30.1-ha441bb4_0
tk pkgs/main/osx-64::tk-8.6.8-ha441bb4_0
wheel pkgs/main/osx-64::wheel-0.34.1-py37_0
xz pkgs/main/osx-64::xz-5.2.4-h1de35cc_4
zlib pkgs/main/osx-64::zlib-1.2.11-h1de35cc_3
Proceed ([y]/n)? y
Downloading and Extracting Packages
ca-certificates-2020 | 125 KB | ############################################## | 100%
wheel-0.34.1 | 50 KB | ############################################## | 100%
pip-20.0.2 | 1.7 MB | ############################################## | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate haha
#
# To deactivate an active environment, use
#
# $ conda deactivate
(base) marie@MarieJungui-MacBookPro:~ »
(base) marie@MarieJungui-MacBookPro:~ »
(base) marie@MarieJungui-MacBookPro:~ »
(base) marie@MarieJungui-MacBookPro:~ » conda activate haha
(haha) marie@MarieJungui-MacBookPro:~ »
(haha) marie@MarieJungui-MacBookPro:~ » pip freeze
certifi==2019.11.28
(haha) marie@MarieJungui-MacBookPro:~ »
(haha) marie@MarieJungui-MacBookPro:~ »
(haha) marie@MarieJungui-MacBookPro:~ » pip install flake8
Collecting flake8
Using cached flake8-3.7.9-py2.py3-none-any.whl (69 kB)
Collecting pycodestyle<2.6.0,>=2.5.0
Using cached pycodestyle-2.5.0-py2.py3-none-any.whl (51 kB)
Collecting entrypoints<0.4.0,>=0.3.0
Using cached entrypoints-0.3-py2.py3-none-any.whl (11 kB)
Collecting mccabe<0.7.0,>=0.6.0
Using cached mccabe-0.6.1-py2.py3-none-any.whl (8.6 kB)
Collecting pyflakes<2.2.0,>=2.1.0
Using cached pyflakes-2.1.1-py2.py3-none-any.whl (59 kB)
Installing collected packages: pycodestyle, entrypoints, mccabe, pyflakes, flake8
Successfully installed entrypoints-0.3 flake8-3.7.9 mccabe-0.6.1 pycodestyle-2.5.0 pyflakes-2.1.1
(haha) marie@MarieJungui-MacBookPro:~ »
(haha) marie@MarieJungui-MacBookPro:~ » pip freeze
certifi==2019.11.28
entrypoints==0.3
flake8==3.7.9
mccabe==0.6.1
pycodestyle==2.5.0
pyflakes==2.1.1
(haha) marie@MarieJungui-MacBookPro:~ »
2. flake8 사용하기
(haha) marie@MarieJungui-MacBookPro:~/haha » vi test.py
(haha) marie@MarieJungui-MacBookPro:~/haha »
(haha) marie@MarieJungui-MacBookPro:~/haha » flake8 test.py
test.py:4:1: E305 expected 2 blank lines after class or function definition, found 1
test.py:5:2: E225 missing whitespace around operator
test.py:6:2: E225 missing whitespace around operator
(haha) marie@MarieJungui-MacBookPro:~/haha » 1 ↵
(haha) marie@MarieJungui-MacBookPro:~/haha »