AutoDocString는 VSCode 에서 Python Extension Pack 을 설치할때 포함되어 있는 확장 모듈이다.
팀단위, 여러명의 협업의 효율을 위해 코드내 간단한 Document 를 작성하는데, 막상 개발하다 보면 귀찮을 때가 많다.
대충하거나, 생략할때도 ....

AutoDocString은 """ <- 쌍따움표 3개를 입력하면 자동으로 주석 문장을 만들어준다.
def autoDocString(number, argA=1, argB='BB'):
if(number < 2):
raise TypeError
return True
함수 정의 안에 """ 입력
def autoDocString(number, argA=1, argB='BB'):
"""_summary_
Args:
number (_type_): _description_
argA (int, optional): _description_. Defaults to 1.
argB (str, optional): _description_. Defaults to 'BB'.
Raises:
TypeError: _description_
Returns:
_type_: _description_
"""
if(number < 2):
raise TypeError
return True
전달된 변수에 대한 타입, 설명을 붙여주면 끝.
- Press enter after opening docstring with triple quotes (configurable """ or ''')
- Keyboard shortcut: ctrl+shift+2 or cmd+shift+2 for mac
'개발이야기 > Visual Studio Code' 카테고리의 다른 글
[VSCode] 코드만 확대, 화면 확대 , 글자 확대, FontSize Shortcuts plugin (0) | 2023.01.19 |
---|---|
VSCode 환경 설정 - python 유용한 설정 [코드 링크] (0) | 2023.01.06 |
Visual Studio Code 환경 설정 - theme, icon, font 꾸미기 (0) | 2023.01.04 |
Visual Studio Code 기본 폴더 환경 설정 (0) | 2022.12.25 |
Visual Studio Code 설치 하기 (2) | 2022.12.24 |