From d7f33b1dd6a9182cb08a3e7337cae5be2741fd12 Mon Sep 17 00:00:00 2001 From: cj-vana Date: Wed, 10 Sep 2025 07:05:06 -0600 Subject: [PATCH 1/7] 1.5.6.1 --- .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++ .gitignore | 3 ++ .sqlfluff | 7 ++++ CHANGELOG.md | 38 ++++++++++++++++++++++ CONTRIBUTING.md | 17 +++++++++- agents/capture-agent-py/pyproject.toml | 11 +++++++ apps/web/index.html | 2 +- package.json | 13 ++++++-- 8 files changed, 131 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .sqlfluff diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ff6835c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: CI + +on: + pull_request: + branches: [main, beta] + push: + branches: [main, beta] + +jobs: + lint-and-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'pnpm' + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + pnpm install + pip install ruff sqlfluff + + - name: Run ESLint (new files only via lint-staged) + run: pnpm lint-staged --verbose + + - name: Run Python linting + run: ruff check agents/capture-agent-py/ + + - name: Run SQL linting + run: sqlfluff lint supabase/migrations/ + + - name: Run type checking + run: pnpm typecheck + + - name: Run build + run: pnpm build diff --git a/.gitignore b/.gitignore index b0d613b..33c7060 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,6 @@ dist-ssr # Supabase cruft supabase/.temp + +# ESLint cache +.eslintcache diff --git a/.sqlfluff b/.sqlfluff new file mode 100644 index 0000000..9ec011d --- /dev/null +++ b/.sqlfluff @@ -0,0 +1,7 @@ +[sqlfluff] +dialect = postgres +exclude_rules = L034,L036,L044 +max_line_length = 100 + +[sqlfluff:rules:L010] +capitalisation_policy = lower diff --git a/CHANGELOG.md b/CHANGELOG.md index ed19623..d80b303 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,44 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.5.6.1] - 2025-09-10 + +### Added + +- **Comprehensive CI/CD Pipeline**: Implemented automated testing and linting for PRs on main and beta branches + - **GitHub Actions Workflow**: Created `.github/workflows/ci.yml` for automated quality checks + - **Multi-Language Linting**: Added ESLint for TypeScript, Ruff for Python, and SQLFluff for SQL + - **Incremental Code Quality**: Configured lint-staged to only check new/changed code, preventing legacy code debt from blocking progress + - **Strict New-Code Enforcement**: Set `--max-warnings=0` to prevent any new lint issues from landing + +- **Python Linting Setup**: Added comprehensive Ruff configuration for capture agent + - **Comprehensive Rule Set**: Enabled 50+ linting rules covering code quality, security, and best practices + - **Agent-Specific Configuration**: Created `agents/capture-agent-py/pyproject.toml` with Python 3.11 target and tailored rules + - **Test File Exclusions**: Configured appropriate rule exclusions for test files + +- **SQL Linting Setup**: Added SQLFluff configuration for database migrations + - **PostgreSQL Dialect**: Configured for Supabase PostgreSQL migrations + - **Reasonable Exclusions**: Excluded overly strict rules while maintaining code quality + - **Caching Support**: Added `.sqlfluff` config file with proper dialect and line length settings + +- **Enhanced Development Workflow**: Improved developer experience with automated quality checks + - **Caching Support**: Added `.eslintcache` to `.gitignore` for faster ESLint runs + - **Pre-commit Hooks**: Enhanced lint-staged configuration with comprehensive file type coverage + - **Fast Feedback**: Only lints changed files during development for quick iteration + +- **CodeRabbit Integration**: Updated CONTRIBUTING.md with CodeRabbit documentation + - **Automatic PR Descriptions**: Documented how CodeRabbit generates comprehensive PR descriptions + - **AI-Powered Code Reviews**: Added information about intelligent code review features + - **Simplified PR Process**: Updated guidelines to reflect that only titles are required for PRs + - **Review Management**: Documented CodeRabbit's role in managing review workflows + +### Technical Enhancements + +- **Dependency Management**: Added `ruff` and `sqlfluff` as dev dependencies +- **Performance Optimization**: Enabled caching for all linters to improve CI performance +- **Monorepo Support**: Configured linting to work across the entire monorepo structure +- **Legacy Code Protection**: Implemented approach that preserves existing code while enforcing quality on new changes + ## [1.5.6] - 2025-01-12 ### Added diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b6884a2..8a0aef7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,7 +26,22 @@ We love pull requests! Here's a quick guide on how to submit one: 4. **Ensure your code lints**. Run `pnpm lint` to check for any issues. 5. **Write clear, concise commit messages**. We follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. 6. **Push your branch** and open a pull request to the `beta` branch. -7. **Provide a clear description** of the problem and solution in your pull request. Include the relevant issue number if applicable. +7. **Provide a clear title** for your pull request. CodeRabbit will automatically generate a description, code review, and suggestions based on your changes. + +### Code Reviews with CodeRabbit + +This repository uses **CodeRabbit** for automated code reviews and PR management: + +- **Automatic PR Descriptions**: CodeRabbit analyzes your code changes and generates comprehensive PR descriptions automatically +- **AI-Powered Code Reviews**: CodeRabbit provides intelligent code review comments focusing on: + - Code quality and best practices + - Potential bugs and security issues + - Performance optimizations + - Documentation improvements +- **PR Suggestions**: CodeRabbit offers actionable suggestions to improve your code +- **Review Management**: CodeRabbit helps manage the review process and ensures code standards are maintained + +**Note**: Since CodeRabbit handles PR descriptions automatically, you only need to provide a clear, descriptive title for your pull requests. ## Styleguides diff --git a/agents/capture-agent-py/pyproject.toml b/agents/capture-agent-py/pyproject.toml index b482485..9f76d7c 100644 --- a/agents/capture-agent-py/pyproject.toml +++ b/agents/capture-agent-py/pyproject.toml @@ -18,3 +18,14 @@ cryptography = ">=41,<44" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" + +[tool.ruff] +line-length = 100 +target-version = "py311" + +[tool.ruff.lint] +select = ["E", "F", "W", "C90", "I", "N", "UP", "YTT", "S", "BLE", "FBT", "B", "A", "COM", "C4", "DTZ", "T10", "DJ", "EM", "EXE", "FA", "ISC", "ICN", "G", "INP", "PIE", "T20", "PYI", "PT", "Q", "RSE", "RET", "SLF", "SLOT", "SIM", "TID", "TCH", "INT", "ARG", "PTH", "ERA", "PD", "PGH", "PL", "TRY", "FLY", "NPY", "AIR", "PERF", "FURB", "LOG", "RUF"] +ignore = [] + +[tool.ruff.lint.per-file-ignores] +"tests/*" = ["S101"] diff --git a/apps/web/index.html b/apps/web/index.html index 2ca520c..f0bcf6e 100644 --- a/apps/web/index.html +++ b/apps/web/index.html @@ -85,7 +85,7 @@ "Resource Hub: Reference Guides (Pinouts, Frequency Bands, dB Charts)" ], "operatingSystem": "Web", - "softwareVersion": "1.5.6", // Update as your app versions + "softwareVersion": "1.5.6.1", // Update as your app versions "offers": { "@type": "Offer", "price": "0", // Assuming it's free, adjust if there are paid tiers diff --git a/package.json b/package.json index 39b5ce2..2608e2a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "sounddocs", "private": true, - "version": "1.5.6", + "version": "1.5.6.1", "type": "module", "workspaces": [ "apps/*", @@ -21,9 +21,16 @@ "devDependencies": { "husky": "^9.1.7", "lint-staged": "^15.5.1", - "prettier": "3.5.3" + "prettier": "3.5.3", + "ruff": "^0.1.0", + "sqlfluff": "^3.0.0" }, "lint-staged": { - "**/*": "prettier --write --ignore-unknown" + "**/*.{ts,tsx,js}": [ + "eslint --max-warnings=0 --cache", + "prettier --write --ignore-unknown" + ], + "**/*.{py}": "ruff check --fix --max-warnings=0", + "**/*.sql": "sqlfluff fix --dialect postgres" } } From 0c859736d1474188cd949fc1873d66d32d9ed96e Mon Sep 17 00:00:00 2001 From: cj-vana Date: Wed, 10 Sep 2025 07:07:41 -0600 Subject: [PATCH 2/7] Update ci.yml --- .github/workflows/ci.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff6835c..3f834d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,24 @@ jobs: uses: actions/setup-node@v4 with: node-version: '20' - cache: 'pnpm' + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- - name: Setup Python uses: actions/setup-python@v5 @@ -26,7 +43,7 @@ jobs: - name: Install dependencies run: | - pnpm install + pnpm install --frozen-lockfile pip install ruff sqlfluff - name: Run ESLint (new files only via lint-staged) From 4e465bfd6cc1f84fdc571980988abe04972a47fc Mon Sep 17 00:00:00 2001 From: cj-vana Date: Wed, 10 Sep 2025 07:10:19 -0600 Subject: [PATCH 3/7] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f834d8..2bd4852 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: - name: Install dependencies run: | - pnpm install --frozen-lockfile + pnpm install pip install ruff sqlfluff - name: Run ESLint (new files only via lint-staged) From eaac87412a9401cff991d28b20f111b09ba6b65f Mon Sep 17 00:00:00 2001 From: cj-vana Date: Wed, 10 Sep 2025 07:13:32 -0600 Subject: [PATCH 4/7] Update package.json --- package.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/package.json b/package.json index 2608e2a..85e354c 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,7 @@ "devDependencies": { "husky": "^9.1.7", "lint-staged": "^15.5.1", - "prettier": "3.5.3", - "ruff": "^0.1.0", - "sqlfluff": "^3.0.0" + "prettier": "3.5.3" }, "lint-staged": { "**/*.{ts,tsx,js}": [ From e289b607984f5792b54788de14c57a84736b0694 Mon Sep 17 00:00:00 2001 From: cj-vana Date: Wed, 10 Sep 2025 07:18:27 -0600 Subject: [PATCH 5/7] Update ci.yml --- .github/workflows/ci.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2bd4852..5ff16bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,15 +46,9 @@ jobs: pnpm install pip install ruff sqlfluff - - name: Run ESLint (new files only via lint-staged) + - name: Run linting (staged files only) run: pnpm lint-staged --verbose - - name: Run Python linting - run: ruff check agents/capture-agent-py/ - - - name: Run SQL linting - run: sqlfluff lint supabase/migrations/ - - name: Run type checking run: pnpm typecheck From 8644062031aebba8e0ab274c0ccf8273faeb336a Mon Sep 17 00:00:00 2001 From: cj-vana Date: Wed, 10 Sep 2025 07:26:29 -0600 Subject: [PATCH 6/7] update CI --- .github/workflows/ci.yml | 5 +---- apps/web/tsconfig.app.json | 1 + apps/web/tsconfig.node.json | 1 + package.json | 7 ++++++- packages/analyzer-lite/tsconfig.json | 1 + packages/analyzer-protocol/tsconfig.json | 1 + 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ff16bc..a07261c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,11 +46,8 @@ jobs: pnpm install pip install ruff sqlfluff - - name: Run linting (staged files only) + - name: Run linting and type checking (staged files only) run: pnpm lint-staged --verbose - - name: Run type checking - run: pnpm typecheck - - name: Run build run: pnpm build diff --git a/apps/web/tsconfig.app.json b/apps/web/tsconfig.app.json index 7d7f46a..7920fec 100644 --- a/apps/web/tsconfig.app.json +++ b/apps/web/tsconfig.app.json @@ -18,6 +18,7 @@ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, + "noImplicitAny": true, "noFallthroughCasesInSwitch": true, /* Path mapping */ diff --git a/apps/web/tsconfig.node.json b/apps/web/tsconfig.node.json index 0d3d714..7973afc 100644 --- a/apps/web/tsconfig.node.json +++ b/apps/web/tsconfig.node.json @@ -16,6 +16,7 @@ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, + "noImplicitAny": true, "noFallthroughCasesInSwitch": true }, "include": ["vite.config.ts"] diff --git a/package.json b/package.json index 85e354c..dc25d2e 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,12 @@ "prettier": "3.5.3" }, "lint-staged": { - "**/*.{ts,tsx,js}": [ + "**/*.{ts,tsx}": [ + "tsc --noEmit --skipLibCheck", + "eslint --max-warnings=0 --cache", + "prettier --write --ignore-unknown" + ], + "**/*.{js,jsx}": [ "eslint --max-warnings=0 --cache", "prettier --write --ignore-unknown" ], diff --git a/packages/analyzer-lite/tsconfig.json b/packages/analyzer-lite/tsconfig.json index 83265bb..eb40297 100644 --- a/packages/analyzer-lite/tsconfig.json +++ b/packages/analyzer-lite/tsconfig.json @@ -9,6 +9,7 @@ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, + "noImplicitAny": true, "noFallthroughCasesInSwitch": true, "moduleResolution": "bundler", "isolatedModules": true, diff --git a/packages/analyzer-protocol/tsconfig.json b/packages/analyzer-protocol/tsconfig.json index 25d4aaf..ab50197 100644 --- a/packages/analyzer-protocol/tsconfig.json +++ b/packages/analyzer-protocol/tsconfig.json @@ -9,6 +9,7 @@ "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, + "noImplicitAny": true, "noFallthroughCasesInSwitch": true, "moduleResolution": "bundler", "isolatedModules": true, From 61beabfbbe392b6f9198368f1ae0224c0a81ea19 Mon Sep 17 00:00:00 2001 From: cj-vana Date: Wed, 10 Sep 2025 07:37:03 -0600 Subject: [PATCH 7/7] documentation --- CHANGELOG.md | 17 ++++++++++------- CONTRIBUTING.md | 16 ++++++++-------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d80b303..4cf6d2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,8 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Comprehensive CI/CD Pipeline**: Implemented automated testing and linting for PRs on main and beta branches - **GitHub Actions Workflow**: Created `.github/workflows/ci.yml` for automated quality checks - **Multi-Language Linting**: Added ESLint for TypeScript, Ruff for Python, and SQLFluff for SQL - - **Incremental Code Quality**: Configured lint-staged to only check new/changed code, preventing legacy code debt from blocking progress - - **Strict New-Code Enforcement**: Set `--max-warnings=0` to prevent any new lint issues from landing + - **Legacy Code Protection**: Configured lint-staged to only check staged/changed files, protecting legacy code from CI failures + - **New Code Quality Enforcement**: Strict linting with `--max-warnings=0` ensures new code meets high quality standards + - **Staged-File-Only Approach**: CI only validates what developers are actually committing, not entire codebase - **Python Linting Setup**: Added comprehensive Ruff configuration for capture agent - **Comprehensive Rule Set**: Enabled 50+ linting rules covering code quality, security, and best practices @@ -30,18 +31,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Pre-commit Hooks**: Enhanced lint-staged configuration with comprehensive file type coverage - **Fast Feedback**: Only lints changed files during development for quick iteration -- **CodeRabbit Integration**: Updated CONTRIBUTING.md with CodeRabbit documentation - - **Automatic PR Descriptions**: Documented how CodeRabbit generates comprehensive PR descriptions +- **Qodo Integration**: Updated CONTRIBUTING.md with Qodo documentation + - **Automatic PR Descriptions**: Documented how Qodo generates comprehensive PR descriptions - **AI-Powered Code Reviews**: Added information about intelligent code review features - **Simplified PR Process**: Updated guidelines to reflect that only titles are required for PRs - - **Review Management**: Documented CodeRabbit's role in managing review workflows + - **Review Management**: Documented Qodo's role in managing review workflows ### Technical Enhancements -- **Dependency Management**: Added `ruff` and `sqlfluff` as dev dependencies +- **TypeScript Strict Mode**: Re-enabled strict TypeScript checking for new/changed files while protecting legacy code +- **Staged-File-Only Type Checking**: Integrated TypeScript checking into lint-staged for targeted validation +- **Python Tooling**: Configured Ruff and SQLFluff via pip for CI environment (not as npm dependencies) - **Performance Optimization**: Enabled caching for all linters to improve CI performance - **Monorepo Support**: Configured linting to work across the entire monorepo structure -- **Legacy Code Protection**: Implemented approach that preserves existing code while enforcing quality on new changes +- **Legacy Code Protection**: Implemented staged-file approach that preserves existing code while enforcing quality on new changes ## [1.5.6] - 2025-01-12 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8a0aef7..8324651 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,22 +26,22 @@ We love pull requests! Here's a quick guide on how to submit one: 4. **Ensure your code lints**. Run `pnpm lint` to check for any issues. 5. **Write clear, concise commit messages**. We follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. 6. **Push your branch** and open a pull request to the `beta` branch. -7. **Provide a clear title** for your pull request. CodeRabbit will automatically generate a description, code review, and suggestions based on your changes. +7. **Provide a clear title** for your pull request. Qodo will automatically generate a description, code review, and suggestions based on your changes. -### Code Reviews with CodeRabbit +### Code Reviews with Qodo -This repository uses **CodeRabbit** for automated code reviews and PR management: +This repository uses **Qodo** for automated code reviews and PR management: -- **Automatic PR Descriptions**: CodeRabbit analyzes your code changes and generates comprehensive PR descriptions automatically -- **AI-Powered Code Reviews**: CodeRabbit provides intelligent code review comments focusing on: +- **Automatic PR Descriptions**: Qodo analyzes your code changes and generates comprehensive PR descriptions automatically +- **AI-Powered Code Reviews**: Qodo provides intelligent code review comments focusing on: - Code quality and best practices - Potential bugs and security issues - Performance optimizations - Documentation improvements -- **PR Suggestions**: CodeRabbit offers actionable suggestions to improve your code -- **Review Management**: CodeRabbit helps manage the review process and ensures code standards are maintained +- **PR Suggestions**: Qodo offers actionable suggestions to improve your code +- **Review Management**: Qodo helps manage the review process and ensures code standards are maintained -**Note**: Since CodeRabbit handles PR descriptions automatically, you only need to provide a clear, descriptive title for your pull requests. +**Note**: Since Qodo handles PR descriptions automatically, you only need to provide a clear, descriptive title for your pull requests. ## Styleguides