Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sweep GHA Fix] The GitHub Actions run failed with... #60

Open
wants to merge 3 commits into
base: sweep/sweep_gha_fix_the_github_actions_run_fai_28
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,23 @@ git push -u origin main
This project utilizes the [pre-commit](https://pre-commit.com/) tool to maintain code quality and consistency. Before submitting a pull request or making any commits, it is important to run the pre-commit tool to ensure that your changes meet the project's guidelines.


- Install pre-commit by running the following command: `pip install pre-commit`

- Check the pre-commit version by running the following command: `pre-commit --version`

Now when you make a git commit, the black code formatter and ruff linter will run.

Furthermore, we have integrated a pre-commit GitHub Action into our workflow. This means that with every pull request opened, the pre-commit checks will be automatically enforced, streamlining the code review process and ensuring that all contributions adhere to our quality standards.
- Install pre-commit by running the following command: `poetry install dev`. It will not only install pre-commit but also install all the deps and dev-deps of the project
- Once pre-commit is installed, navigate to the project's root directory.
- Run the command `pre-commit run --all-files`. This will execute the pre-commit hooks configured for this project against the modified files. If any issues are found, the pre-commit tool will provide feedback on how to resolve them. Make the necessary changes and re-run the `pre-commit run --all-files` command until all issues are resolved.

Please add the following step to your GitHub Actions workflow file to ensure that pre-commit checks are enforced:
```yaml
- name: Pre-commit
run: pre-commit run --all-files
```

To run the pre-commit tool, follow these steps:

1. Install pre-commit by running the following command: `poetry install dev`. It will not only install pre-commit but also install all the deps and dev-deps of project

2. Once pre-commit is installed, navigate to the project's root directory.

3. Run the command `pre-commit run --all-files`. This will execute the pre-commit hooks configured for this project against the modified files. If any issues are found, the pre-commit tool will provide feedback on how to resolve them. Make the necessary changes and re-run the pre-commit command until all issues are resolved.
3. Run the command `pre-commit run --all-files`. This will execute the pre-commit hooks configured for this project against the modified files. If any issues are found, the pre-commit tool will provide feedback on how to resolve them. Make the necessary changes and re-run the `pre-commit run --all-files` command until all issues are resolved.

4. You can also install pre-commit as a git hook by execute `pre-commit install`. Every time you made `git commit` pre-commit run automatically for you.

Expand Down Expand Up @@ -114,17 +116,29 @@ To run the documentation, install the project requirements with `poetry install
You can learn more about mkdocs on the [mkdocs website](https://www.mkdocs.org/).

## 🧪 tests

- Add a step in the GitHub Actions workflow to run `pre-commit run --all-files` before the tests are executed. This will ensure that pre-commit checks are enforced as part of the GitHub Actions workflow.

## Code Quality
- Run all the tests in the tests folder
```pytest .```

## Code Quality
(Code quality instructions removed for relevance to this issue)

3. Make sure the script has execute permissions:
```sh
3. Make sure the script has execute permissions:
```sh
chmod +x code_quality.sh
```

4. Run the code-quality.sh script:
```sh
./code-quality.sh
```
```

4. Run the script:
```sh
./code-quality.sh
Expand Down
6 changes: 5 additions & 1 deletion docs/swarms/memory/pg.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def setup(
install_vector_extension: bool = True,
) -> None:
"""
Provides a mechanism to initialize the database schema and extensions.
Provides a mechanism to initialize the database schema, extensions, and enforce pre-commit checks.

Parameters:
- create_schema (bool): If True, creates the necessary database schema for vector storage. Default: True.
Expand All @@ -114,6 +114,10 @@ vector_store = PgVectorVectorStore(connection_string="your-db-connection-string"

# Set up the database with default settings
vector_store.setup()
# Add the following line to enforce pre-commit checks
!pre-commit run --all-files
# Add the following line to enforce code-quality checks
!./code-quality.sh
```

#### Example 2: Customized Database Setup
Expand Down
Loading