1. pycodestyle install (Windows / Ubuntu)
pip install pycodestyle
2. code style check
Error / Warning code
- Error code : Exxx / ex) E226
- Warning code : Wxxx / ex) W391
* detail code description : https://pep8.readthedocs.io
pep8’s documentation — pep8 1.7.1 documentation
Docs » pep8’s documentation Edit on GitHub Credits Created by Johann C. Rocholl. Maintained by Florent Xicluna and Ian Lee. License The pep8 library is provided under the terms and conditions of the Expat license: # Permission is hereby granted, free of
pep8.readthedocs.io
(E2 : 공백 문제, E3 : 빈 줄 문제, W3 : 빈 줄 문제, W6 : 더는 사용되지 않는 기능)
2.1 Windows - Command(cmd.exe)
[ Error / Warning ]
> pycodestyle test.py
test.py:18:11: E226 missing whitespace around arithmetic operator
> echo %ERRORLEVEL%
1
* ignore code
> pycodestyle --ignore=E2 test.py
[ Success ]
> pycodestyle test.py
> echo %ERRORLEVEL%
0
2.2 Ubuntu - Terminal
[ Error / Warning ]
$ pycodestyle test.py
test.py:21:1: W391 blank line at end of file
$ echo $?
1
* ignore code
$ pycodestyle --ignore=W3 test.py
[ Success ]
$ pycodestyle test.py
$ echo $?
0
참고 : [도서] 진지한 파이썬
'개발 > Python' 카테고리의 다른 글
Anaconda3 Update (0) | 2021.06.09 |
---|---|
파이썬 가상 환경 만들기 (0) | 2021.06.01 |
네이버 주식 일별 시세 pandas read_html() ValueError: No tables found 오류 (2) | 2021.05.21 |
Pandas read_excel error : ValueError: Your version of xlrd is 2.0.1. In xlrd >= 2.0, only the xls format is supported. Install openpyxl instead. (0) | 2021.05.21 |
Anaconda3 spyder 5.0.0 install (0) | 2021.05.21 |