feat: Code Quality Improvements & Documentation Overhaul #2
Workflow file for this run
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
| name: Code Quality | |
| on: | |
| push: | |
| branches: [ main, master, develop ] | |
| pull_request: | |
| branches: [ main, master, develop ] | |
| jobs: | |
| code-quality: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Cache pip dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install black flake8 mypy isort types-requests | |
| pip install -r requirements.txt | |
| - name: Run Black (Code Formatting) | |
| run: black --check --diff . --exclude="/(build|dist|venv|env|\.venv|\.env|\.git|\.mypy_cache|\.pytest_cache|\.tox)/" | |
| - name: Run isort (Import Sorting) | |
| run: isort --check-only --diff . --skip-glob="**/build/**" --skip-glob="**/dist/**" --skip-glob="**/venv/**" --skip-glob="**/.venv/**" | |
| - name: Run Flake8 (Linting) | |
| run: flake8 . --max-line-length=88 --ignore=E203,W503 --exclude=.venv,venv,__pycache__,.git,build,dist | |
| - name: Run MyPy (Type Checking) | |
| run: mypy . --ignore-missing-imports --no-strict-optional --exclude="(build|dist|venv|env|\.venv|\.env|\.git|\.mypy_cache|\.pytest_cache|\.tox)/" | |
| continue-on-error: false # Make MyPy a required check | |
| - name: Test Import Structure | |
| run: | | |
| python -c "import coderag.config; print('✓ Config import successful')" | |
| python -c "import coderag.embeddings; print('✓ Embeddings import successful')" | |
| python -c "import coderag.index; print('✓ Index import successful')" | |
| python -c "import coderag.search; print('✓ Search import successful')" | |
| python -c "import coderag.monitor; print('✓ Monitor import successful')" | |
| env: | |
| OPENAI_API_KEY: dummy-key-for-testing |