Commit Graph

3 Commits

Author SHA1 Message Date
Riccardo Schirone dc6b1e0072 ci: use uvx to run ty in pre-commit hook
uvx runs tools in isolated environments without requiring them as
project dependencies, which is needed for CI where project deps
aren't installed when pre-commit runs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 10:59:15 +01:00
Dan Guido 494c8ab193 chore: add linting infrastructure for shell, Docker, and GH Actions
Add pre-commit hooks for comprehensive static analysis:
- shellcheck and shfmt for shell script linting/formatting
- hadolint for Dockerfile linting
- actionlint for GitHub Actions workflow validation
- zizmor for GitHub Actions security analysis
- ty (Astral) for Python type checking

Add configuration files:
- .hadolint.yaml - Dockerfile linting rules
- .shellcheckrc - Shell script linting rules

Update .gitignore for new tool artifacts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 10:59:15 +01:00
Dan Guido 7ab5da641e feat: add pre-commit infrastructure for code quality (#311)
* feat: add minimal pre-commit infrastructure

- Add pre-commit configuration with essential checks only
- Check YAML, TOML, JSON syntax
- Check for merge conflicts and large files
- Enforce LF line endings (fix 2 test files with CRLF)
- Add debug statement detection
- Integrate ruff for Python formatting and linting
- Add GitHub workflow for pre-commit CI
- No unnecessary Python code changes

* fix: add explicit permissions to pre-commit workflow

- Set GITHUB_TOKEN permissions to read-only for contents
- Follows principle of least privilege
- Addresses CodeQL security recommendation
- Pre-commit checks only need to read code, not write

* fix: exclude test data from line ending modifications

- Exclude .proto files and test/data directories from mixed-line-ending hook
- Revert changes to test data files (traced_crash.proto, java_stacktrace.txt)
- These files need to preserve their original format for test integrity
- Binary proto files could be corrupted by line ending changes

* docs: add pre-commit hooks documentation to CONTRIBUTING.md

- Add pre-commit installation instructions to development setup
- Document pre-commit hooks in Code Quality Standards section
- Update submission workflow to include pre-commit checks
- Provide manual pre-commit run commands for contributors

* docs: streamline CONTRIBUTING.md for better readability

- Reduce from 214 to 124 lines (42% reduction) while keeping all essential info
- Consolidate setup instructions into concise Quick Start section
- Convert component descriptions to scannable table format
- Streamline testing strategy with clear requirements and timing
- Add back critical testing prerequisites (codequery, ripgrep, cscope)
- Create actionable Getting Help section with common troubleshooting
- Remove redundant command listings and verbose explanations
- Maintain all security requirements and essential workflows
2025-08-22 16:42:23 -04:00