Skip to content

chore: add setup and precommit scripts - #35

Closed
mentatbot[bot] wants to merge 3 commits into
masterfrom
mentat-scripts-1
Closed

mentatbot[bot] wants to merge 3 commits into
masterfrom
mentat-scripts-1

Conversation

@mentatbot

@mentatbot mentatbot Bot commented Mar 13, 2025

Copy link
Copy Markdown
Contributor

Added two scripts to enhance development workflow:

  1. .mentat/setup.sh - Sets up the development environment by installing Rust and necessary components
  2. .mentat/precommit.sh - Runs code formatting and linting before commits

Also updated .gitignore to exclude Mentat logs directory.


🤖 See my steps and cost here ✨

  • Wake on any new activity.

mentatbot Bot added 3 commits March 13, 2025 23:41
Added two scripts to enhance development workflow:
1. `.mentat/setup.sh` - Sets up the development environment by installing Rust and necessary components
2. `.mentat/precommit.sh` - Runs code formatting and linting before commits

Also updated .gitignore to exclude Mentat logs directory.

Mentat precommits failed. Log: https://mentat.ai/log/3b577a57-e3ed-4d89-ac99-be4742042fcb
Added detection and installation of system dependencies (pkg-config and OpenSSL dev libraries)
to fix the build error related to the openssl-sys crate. The script now detects the appropriate
package manager (apt, yum, apk, or dnf) and installs the required dependencies.

Mentat precommits failed. Log: https://mentat.ai/log/802cf386-db9a-4076-895e-3dbb534d53d4
Added code to source the cargo environment in the precommit script to ensure that cargo commands are available when the script runs. This addresses the issue where the precommit script couldn't find the cargo command even though it was installed in the setup script.

Mentat precommits passed. Log: https://mentat.ai/log/3d066716-96df-4986-9dc4-2b490243c0f0
@mentatbot
mentatbot Bot marked this pull request as ready for review March 13, 2025 23:45
@mentatbot
mentatbot Bot requested a review from Nayshins March 13, 2025 23:45
@mentatbot

mentatbot Bot commented Mar 13, 2025

Copy link
Copy Markdown
Contributor Author

Scripts Implementation Complete

I've successfully implemented the requested setup and precommit scripts that will help with automatic development in this repository:

.mentat/setup.sh

This script:

  1. Detects and installs system dependencies (pkg-config and OpenSSL dev libraries) using the appropriate package manager
  2. Installs Rust if not already installed
  3. Adds necessary Rust components (clippy and rustfmt)
  4. Builds the project to download dependencies

.mentat/precommit.sh

This script:

  1. Sources the cargo environment to ensure cargo is available
  2. Runs cargo fmt to format code (as specified in the development guide)
  3. Runs cargo clippy --fix to automatically fix issues where possible
  4. Runs cargo clippy -- -D warnings to report any remaining issues
  5. Runs cargo check for a basic compilation check

I didn't include cargo test in the precommit script as it appears to be run in GitHub CI (as seen in the rust.yml workflow file).

The scripts have been tested and are working correctly. I also updated .gitignore to exclude the .mentat/logs directory.

Note: There is a 4-minute limit on these scripts. If you find that your builds or tests take longer than that, you may need to contact the Mentat developers to increase this limit.

@Nayshins Nayshins closed this Mar 13, 2025
@Nayshins
Nayshins deleted the mentat-scripts-1 branch March 18, 2025 06:01
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