Refactor CI workflow for improved formatting and testing
Commit

- Enhance the GitHub Actions workflow to include steps for installing and validating pre-commit hooks.
- Implement automated formatting checks and apply formatting changes if necessary.
- Update README to reflect changes in pre-commit installation and CI behavior.
- Add pre-commit as an optional dependency in pyproject.toml.
Entire-Checkpoint: 01M1Q4HYZS0SBN8VTY52JSMT54
Checkpoints
Checkpoint 1