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: Install Code-Butler #2

Closed
1 task done
ouchi2501 opened this issue Dec 1, 2023 · 1 comment
Closed
1 task done

Sweep: Install Code-Butler #2

ouchi2501 opened this issue Dec 1, 2023 · 1 comment
Labels

Comments

@ouchi2501
Copy link
Owner

ouchi2501 commented Dec 1, 2023

Code-Butler is this.
https://github.com/marketplace/actions/code-butler-for-pr-review

Checklist
  • Create .github/workflows/code_butler.yml33b4f54

Flowchart

@sweep-ai sweep-ai bot added the sweep label Dec 1, 2023
Copy link
Contributor

sweep-ai bot commented Dec 1, 2023

Here's the PR! #3.

Sweep Basic Tier: I'm using GPT-4. You have 5 GPT-4 tickets left for the month and 3 for the day. (tracking ID: bf2593b3ce)

For more GPT-4 tickets, visit our payment portal. For a one week free trial, try Sweep Pro (unlimited GPT-4 tickets).

Actions (click)

  • ↻ Restart Sweep

Sandbox execution failed

The sandbox appears to be unavailable or down.

Install Sweep Configs: Pull Request

Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description.

code-explain/README.md

Lines 1 to 15 in a0ca61e

# code-explain
This plugin sends selected text to the OpenAI API and retrieves a summary, which is then displayed in a new Neovim window.
This allows you to easily create summaries of code or documentation.
https://github.com/ouchi2501/code-explain/assets/11391317/57d8c7a5-a819-4b70-8520-83422ff56d33
## Prerequisites
- Neovim 0.5.0 or later
- `curl` command-line tool installed
## Installation
1. Add the following line to your `init.vim` or `init.lua` to install the plugin.

code-explain/README.md

Lines 15 to 30 in a0ca61e

1. Add the following line to your `init.vim` or `init.lua` to install the plugin.
```lua
-- For packer.nvim
use 'ouchi2501/code-explain'
```
2. Open Neovim and run or `:PackerInstall` to install the plugin.
3. Set your API key and Language.
```lua
require("code-explain").setup({token = 'your_api_key',language = 'English'}) -- or Japanese
```
4. Set your keymap.

code-explain/README.md

Lines 45 to 55 in a0ca61e

## Supported Languages
Currently, the following languages are supported:
- English (`en`)
- Japanese (`ja`)
## License

code-explain/README.md

Lines 30 to 45 in a0ca61e

```lua
vim.api.nvim_set_keymap('v', '<leader>a', ':lua require("code-explain").print_summary()<CR>', {noremap = true, silent = true})
```
## Usage
To use the `code-explain` plugin, follow these steps:
1. In Neovim, enter Visual mode by pressing `v`, `V`, or `<C-v>`.
2. Select the text you want to send to the API.
3. Press `<leader>s` to send the selected text to the API. The result will be displayed in a new window.
Note: If you want to use a different key mapping, replace `<leader>s` in the `init.vim` configuration with your preferred key combination.
If you have any issues or need further assistance, feel free to ask.

I also found the following external resources that might be helpful:

Summaries of links found in the content:

https://github.com/marketplace/actions/code-butler-for-pr-review:

The page is about a GitHub Action called "code-butler for PR Review" that performs code reviews using the OpenAI API. The action allows users to automate code reviews in their workflows. The installation process involves copying and pasting a snippet into a .yml file. The action supports commands such as "review" and "chat" to add comments to pull requests. The AI-powered code review provides feedback on the code, including the main theme, summary, and type of pull request. The action also supports chat functionality, allowing users to communicate with ChatGPT on pull requests. The page includes code snippets for setting up the action and provides information on the available parameters and features. The project is licensed under the MIT License.


Step 2: ⌨️ Coding

  • Create .github/workflows/code_butler.yml33b4f54
Create .github/workflows/code_butler.yml with contents:
• Create a new directory named .github at the root of the repository, and within it, create another directory named workflows.
• Inside the workflows directory, create a new file named code_butler.yml.
• In the code_butler.yml file, define a new workflow for the Code-Butler GitHub Action. The workflow should be triggered on pull request events.
• The workflow should have a single job that runs on the latest Ubuntu runner. The job should check out the repository code and then run the Code-Butler action.
• To run the Code-Butler action, use the uses syntax of GitHub Actions and specify the version of the action. You can use the latest version or specify a version number.
• The Code-Butler action requires a token parameter, which should be set to the GitHub token. This can be accessed using the secrets context in GitHub Actions.
• The action also supports a command parameter, which should be set to "review" to enable automated code reviews.

Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/add-code-butler-action.


🎉 Latest improvements to Sweep:

  • Sweep uses OpenAI's latest Assistant API to plan code changes and modify code! This is 3x faster and significantly more reliable as it allows Sweep to edit code and validate the changes in tight iterations, the same way as a human would.
  • Sweep now uses the rope library to refactor Python! Check out Large Language Models are Bad at Refactoring Code. To have Sweep refactor your code, try sweep: Refactor <your_file>.py!

💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request.
Join Our Discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant