chore(#11): FE/BE/Embedded 코드 스타일 및 PR 자동 검사 도입#12
Merged
Conversation
Python lint 및 format 검사를 위한 Ruff 설정 추가 backend 코드에 Ruff 포맷팅을 적용하고 서버 실행 및 주요 API 응답 확인
HTML, CSS, JavaScript, JSON 포맷팅을 위한 Prettier 설정 추가 frontend 코드에 Prettier 포맷팅을 적용
ESP32-CAM C source/header 파일 포맷팅을 위한 Embedded 전용 clang-format 설정 추가 embedded/ssccam 코드에 clang-format 포맷팅을 적용
FE Prettier 설정 과정에서 생성되는 node_modules 디렉토리를 Git 추적 대상에서 제외
GitHub Actions에서 BE Ruff, FE Prettier, Embedded clang-format 검사를 수행하도록 추가 로컬 코드 스타일 검사 방법을 docs/code-style.md에 문서화
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🍀 이슈 번호
📝 변경 사항
BE 코드 스타일 설정을 추가했습니다.
backend/pyproject.toml추가backend/requirements-dev.txt추가FE 코드 스타일 설정을 추가했습니다.
frontend/package.json추가frontend/package-lock.json추가frontend/.prettierrc추가frontend/.prettierignore추가Embedded 코드 스타일 설정을 추가했습니다.
embedded/ssccam/.clang-format추가PR 자동 검사 workflow를 추가했습니다.
코드 스타일 검사 방법을 문서화했습니다.
docs/code-style.md추가🎯 목적
SSCCounter는 하나의 monorepo 안에서 FE, BE, Embedded 코드를 함께 관리합니다.
여러 사람이 동시에 작업할 경우 코드 스타일이 달라지거나, PR마다 포맷팅 방식이 달라져 불필요한 diff와 리뷰 비용이 발생할 수 있습니다.
이번 변경의 목적은 다음과 같습니다.
📂 적용 범위
backend/pyproject.tomlrequirements-dev.txtmain.pyfrontend/.prettierrc.prettierignorepackage.jsonpackage-lock.jsonindex.htmlcss/*.cssjs/*.jsdata/*.jsonembedded/ssccam/.clang-formatmain/*.cmain/*.h.github/workflows/docs/code-style.md🖥️ 주요 코드 설명
BE: Ruff 설정
BE에서는 Ruff를 사용해 lint, import 정렬, format check를 수행하도록 구성했습니다.
FE: Prettier 설정
{ "printWidth": 100, "tabWidth": 2, "useTabs": false, "singleQuote": true, "semi": true, "trailingComma": "es5", "bracketSpacing": true, "htmlWhitespaceSensitivity": "css" }FE.에서 Prettier를 사용해 HTML, CSS, JavaScript, JSON 파일의 포맷팅 기준을 통일했습니다.
Embedded: clang-format 설정
Embedded에서는 ESP32-CAM source/header 파일을 대상으로 clang-format을 적용했습니다.
GitHub Actions
PR 생성 및 수정 시 다음 검사가 자동 실행됩니다.
📋 체크리스트
📌 참고 사항
로컬에서 아래 검사를 수행했습니다.
cd frontend npm run format:check이번 PR에서 ESLint는 도입하지 않았습니다. 필요 시 JS 코드 규모가 커지는 시점에 별도 이슈로 추가할 예정입니다.