티스토리 뷰

공부

[python] black & pre-commit

승가비 2023. 9. 22. 20:49
728x90
# requirements.txt

virtualenv
black
pre-commit
# pyproject.toml

[tool.black]
line-length = 80
# .pre-commit-config.yaml

repos:
-   repo: https://github.com/psf/black
    rev: 23.9.1
    hooks:
    -   id: black
rm -rf .venv

virtualenv .venv
. .venv/bin/activate

pip3 install -r requirements.txt

pre-commit install

https://velog.io/@samnaka/pycharm-vscode-black-%EC%A0%81%EC%9A%A9

 

pycharm vscode black 적용, pre-commit

pycharm에서 python 가상환경을 생성해주고 pip install poetry로 poetry라는 패키지 관리 도구를 설치한다.poetry init으로 .toml 파일 생성 및 설정을 해준다.poetry add black으로 black을 설치한다.which bla

velog.io

https://dev.to/adamlombard/vscode-setting-line-lengths-in-the-black-python-code-formatter-1g62

 

VSCode: Setting line lengths in the Black Python code formatter

How to set Black Python code formatter line lengths in VSCode

dev.to

https://www.daleseo.com/python-black/

 

Black으로 파이썬 코드 스타일 통일하기

Engineering Blog by Dale Seo

www.daleseo.com

https://stackoverflow.com/questions/36873096/run-pylint-for-all-python-files-in-a-directory-and-all-subdirectories

 

Run Pylint for all Python files in a directory and all subdirectories

I have find . -iname "*.py" -exec pylint -E {} ;\ and FILES=$(find . -iname "*.py") pylint -E $FILES If I understand correctly, the first command will run pylint for each of the Python files, ...

stackoverflow.com

 

728x90
댓글