Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 0 additions & 69 deletions .github/workflows/commit-convention-linter.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,3 @@
# name: PR Commit Convention Linter

# on:
# pull_request:
# types: [opened, synchronize, reopened]

# permissions:
# pull-requests: write

# jobs:
# commit-lint:
# runs-on: ubuntu-latest

# steps:

# - name: Minimal Git clone without actions/checkout
# run: |
# git init
# git remote add origin https://github.com/${{ github.repository }}.git
# git fetch origin ${{ github.event.pull_request.head.ref }} --depth=1
# git checkout FETCH_HEAD


# - name: Install GitHub CLI
# run: |
# sudo apt-get update
# sudo apt-get install -y gh

# - name: Get latest commit message
# id: get_commit
# run: |
# git log -1 --pretty=format:"%s" > commit.txt

# - name: Validate commit message
# id: validate
# run: |
# line=$(cat commit.txt)
# echo "Checking commit: $line"

# # 메시지 길이 확인 (50자 초과면 경고)
# if [[ ${#line} -gt 72 ]]; then
# echo "::warning::⚠️ Commit message is longer than 72 characters."
# fi

# # 정규식: 타입(scope): 메시지 (소문자 시작, 마침표 금지)
# pattern='^(Feat|Fix|Docs|Style|Refactor|Test|Chore|Ci|Perf|Build)(\([a-zA-Z0-9_-]+\))?: [a-z][^\.]{0,69}$'

# if ! [[ "$line" =~ $pattern ]] && ! [[ "$line" =~ ^Merge.* ]]; then
# echo "::error::❌ Invalid commit message: $line"
# echo "invalid=1" >> $GITHUB_OUTPUT
# else
# echo "invalid=0" >> $GITHUB_OUTPUT
# fi

# - name: Comment on PR if invalid
# if: steps.validate.outputs.invalid == '1'
# run: |
# gh pr comment "$PR_NUMBER" --body "🚫 One or more commit messages in this PR **do not follow the commit convention.**

# Please revise them to match the format: \`Feat(actions): add something cool\`

# 📘 See our [Wiki](https://github.com/khyeonm/2025_Advanced_Programming/wiki/Git-Commit-Convention) for details.

# Thank you!"

# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# PR_NUMBER: ${{ github.event.pull_request.number }}

name: PR Commit Convention Linter

on:
Expand Down
232 changes: 0 additions & 232 deletions backend/API/guide.txt

This file was deleted.

16 changes: 15 additions & 1 deletion backend/API/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
from fastapi.middleware.cors import CORSMiddleware
from sqlalchemy import text
from functools import wraps
import logging

# --- logger 설정 ---
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)



# --- Factory Pattern ---
class RequestFactory:
Expand All @@ -28,8 +35,15 @@ def safe_handler(func):
def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except ValueError as ve:
logger.warning(f"400 Bad Request: {ve}")
raise HTTPException(status_code=400, detail=str(ve))
except KeyError as ke:
logger.warning(f"404 Not Found: {ke}")
raise HTTPException(status_code=404, detail=f"Not Found: {ke}")
except Exception as e:
raise HTTPException(status_code=500, detail=str(e))
logger.error(f"500 Internal Server Error: {e}", exc_info=True)
raise HTTPException(status_code=500, detail="Internal Server Error")
return wrapper

# --- FastAPI ---
Expand Down