Skip to content

Add CI workflows, linting configuration, and code quality improvements#63

Closed
corylanou wants to merge 1 commit intomainfrom
page-index-fixes
Closed

Add CI workflows, linting configuration, and code quality improvements#63
corylanou wants to merge 1 commit intomainfrom
page-index-fixes

Conversation

@corylanou
Copy link
Collaborator

@corylanou corylanou commented Aug 5, 2025

Summary

This PR adds comprehensive CI/CD infrastructure, linting configuration, and various code quality improvements to the LTX project.

Changes Made

CI/CD Infrastructure

  • Added GitHub Actions workflows:
    • test-and-lint.yml: Runs tests across Go 1.22, 1.23, 1.24, executes linters (go fmt, go vet, staticcheck, revive), and builds the project
    • race-detection.yml: Prepared for future race condition testing (currently disabled)
  • Added .revive.toml: Comprehensive linting configuration with appropriate rules for the project

Code Quality Improvements

  • Fixed all linter warnings across the codebase:
    • Added missing package documentation comments
    • Fixed receiver naming consistency
    • Removed unused parameters and return values
    • Improved error handling patterns
    • Fixed variable naming (e.g., SQLITE_DATABASE_HEADER_STRINGsqliteDatabaseHeaderString)
    • Added missing JSON marshaling documentation
    • Fixed type assertion safety checks

Documentation Updates

  • Enhanced README.md:
    • Improved formatting with proper markdown headers
    • Added detailed checksum design documentation explaining database vs file checksums
    • Clarified security considerations for page index inclusion in file checksums
    • Fixed header layout table to show accurate field offsets and sizes

Testing Enhancements

  • Added comprehensive test: TestPageIndexInChecksum to verify page index is properly included in file checksum calculation

Build Configuration

  • Updated .gitignore: Added Go binary exclusions (cmd/ltx/ltx, ltx)

File Changes Summary

  • CI/CD: Added 2 new GitHub Actions workflows (123 lines)
  • Linting: Added .revive.toml configuration (56 lines)
  • Code fixes: Updated 15 Go files to address linter warnings
  • Tests: Added new test case for page index checksum validation (113 lines)
  • Documentation: Enhanced README with checksum design section

Test Plan

  • All tests pass across Go 1.22, 1.23, 1.24
  • No linting issues (go fmt, go vet, staticcheck, revive)
  • Builds successfully
  • New test validates page index security

Note

The snapshot validation feature that was initially included in this PR has been moved to a separate branch (snapshot-validation) for its own PR, keeping this PR focused on CI/CD, linting, and code quality improvements.

🤖 Generated with Claude Code

@corylanou corylanou changed the title Update README with accurate header layout and checksum design Update README with accurate header layout and checksum design documentation Aug 5, 2025
@corylanou corylanou force-pushed the page-index-fixes branch 2 times, most recently from 6461d35 to 0f8f112 Compare August 5, 2025 20:40
@corylanou corylanou changed the title Update README with accurate header layout and checksum design documentation Add CI workflows, linting configuration, and code quality improvements Aug 5, 2025
This removes the snapshot validation logic that was accidentally included
in the page-index-fixes branch. These changes have been moved to their
own branch 'snapshot-validation' for a separate PR.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant