Giter Club home page Giter Club logo

sweep's Introduction

Github Issues ⟢  Refactored and Tested Python Code!

Install Sweep Github App Self Host Sweep Docker Image Docker Pulls Docs Better Stack Badge Python Unit Tests

🎊 We recently updated our README to reflect our improvements to Python refactors and unit tests!


Sweep is an AI junior developer that refactors and writes unit tests for Python. 🐍 πŸ€–

Install Sweep and open a Github Issue like: Sweep: Refactor the run function in main.py and Sweep will:

  1. Identify the best places to refactor your code
  2. Refactor and add unit tests through Github
  3. Run and debug your code to open a Pull Request ⚑

Features

  • Turns issues directly into pull requests (without an IDE)
  • Addresses developer replies & comments on its PRs
  • Understands your codebase using the dependency graph, text, and vector search.
  • Runs your unit tests and autoformatters to validate generated code.

Sweep Youtube Tutorial


What makes Sweep Different

We've been addressing code modification using LLMs for a while. We found and are fixing a lot of issues.

  • Β Refactoring Code LLMs are bad at refactoring code. It's really challenging for them to extract all of the necessary parameters. Check out https://docs.sweep.dev/blogs/refactor-python!
    • Sweep solves this by using Rope and our custom DSL to perform perfect refactors every time!
  • Β Unit Test Most AI unit test copilots don't even validate the code. They leave it to the user to make sure the generated code works, which is half of the battle. Check out https://docs.sweep.dev/blogs/ai-unit-tests!
    • Sweep runs your code for you, which catches bugs and makes sure each line of old and new code has been properly validated!
  • Formatting LLMs are also bad at properly formatting code, such as by adding typehints and making sure we use tabs instead of spaces. Check out https://docs.sweep.dev/blogs/super-linter!
    • Sweep uses it's sandbox to format your code, and uses Rules to perform other changes like adding typehints, or any other small chores!

Getting Started

GitHub App

Install Sweep by adding the Sweep GitHub App to your desired repositories.

  • For more details, visit our Installation page.

  • Note: Sweep only considers issues with the "Sweep:" title on creation and not on update. If you want Sweep to pick up an issue after it has been created, you can add the "Sweep" label to the issue.

  • We focus on Python but support all languages GPT-4 can write. This includes JS/TS, Rust, Go, Java, C# and C++.

Self-Hosting

You can self-host Sweep with our Docker image (https://hub.docker.com/r/sweepai/sweep). Please check out our deployment instructions here! https://docs.sweep.dev/deployment

Development

Starting the Webhook

  1. Clone the repo with git clone https://github.com/sweepai/sweep.
  2. Create .env according to https://docs.sweep.dev/deployment.
  3. Run docker compose up --build. This will take a few moments to start.

To build our Docker images, run docker compose build.


Story

We used to work in large, messy repositories, and we noticed how complex the code could get without regular refactors and unit tests. We realized that AI could handle these chores for us, so we built Sweep!

Unlike existing AI solutions, Sweep can solve entire tickets and can be parallelized + asynchronous: developers can spin up 10 tickets and Sweep will address them all at once.

The Stack

  • GPT-4 32k
  • Code Search Engine using Python AST
  • Code Sandbox
  • Programmatic refactors using Rope!

Highlights

Examine pull requests created by Sweep here.

Pricing

Every user receives unlimited GPT-3.5 tickets and 5 GPT-4 tickets per month. For professionals who want to try unlimited GPT-4 tickets and priority support, you can get a one week free trial of Sweep Pro.

For more GPT-4 tickets visit our payment portal!

You can self-host Sweep's docker image on any machine (AWS, Azure, your laptop) for free. You can get enterprise support by contacting us.


Limitations of Sweep

  • Gigantic repos: >5000 files. We have default extensions and directories to exclude but sometimes this doesn't catch them all. You may need to block some directories (see blocked_dirs)

    • If Sweep is stuck at 0% for over 30 min and your repo has a few thousand files, let us know.
  • Large-scale refactors: >3 files or >150 lines of code changes

    • e.g. Refactor the entire codebase from TensorFlow to PyTorch
    • Sweep works best when pointed to a file, and we're continously improving Sweep's automation!
  • Editing images and other non-text assets

    • e.g. Use the logo to create favicons for our landing page

Contributing

Contributions are welcome and greatly appreciated! To get set up, see Development. For detailed guidelines on how to contribute, please see the CONTRIBUTING.md file.

Contributors

Thank you for your contribution!

and, of course, Sweep!

sweep's People

Contributors

kevinlu1248 avatar wwzeng1 avatar lukejagg avatar sweep-nightly[bot] avatar asc11cat avatar onuratakan avatar 3mooth1e avatar sweep-ai[bot] avatar eltociear avatar jodyz0203 avatar ayan-joshi avatar masad-frost avatar martinye1234 avatar krrishdholakia avatar jannkleen avatar freephoenix888 avatar filiphsps avatar amorriscode avatar adityapunetha avatar asim-shrestha avatar devanshkyada27 avatar effyyzhang avatar georgehe4 avatar berg1618 avatar tmsagarofficial avatar shibzhou avatar swiecki avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.