Git Product home page Git Product logo

sourcery's Introduction

Sourcery

Sourcery

Instantly review and improve your Python code to keep your codebase maintainable.

Get started with our CLI to have Sourcery review all your code locally or star this repo to have our GitHub bot review your most popular Python repo.

CLI

You can have Sourcery review your entire project and make dozens or hundreds (or thousands) of improvements with a single command from the command line.

To start pip install sourcery, login with sourcery login, and then run sourcery review <some path> to have Sourcery review and make suggestions on every file in that path.

CI & Pre-Commit

Keep your entire codebase standardized with Sourcery’s CI integration and pre-commit hook.

For CI we recommend using:

pip install sourcery
# Store your Sourcery token as a secret in your CI environment.
sourcery login --token $SOURCERY_TOKEN
sourcery review --check --diff "git diff main" .

Or if it’s easier you can check out our GitHub Action!

To set up your pre-commit hooks use:

repos:
  - repo: https://github.com/sourcery-ai/sourcery
    rev: v1.8.0
    hooks:
      - id: sourcery
        # The best way to use Sourcery in a pre-commit hook:
        # * review only changed lines:
        # * omit the summary
        args: [--diff=git diff HEAD, --no-summary]

Note: Sourcery is fully free for open-source projects - but you need a Team plan to use Sourcery in CI or as a pre-commit hook for private projects.

IDE Integration

Sourcery integrates into your editor to review and improve your code while you’re writing it.

Find quick installation instructions here:

More editor integrations coming soon.

GitHub Code Reviews

Ensure your code is always at the highest quality. Sourcery reviews and makes suggestions on your whole repo when you install and then checks all new pull requests in the future.

You can get set up and running in 1 minute. Just follow this link and select your repos.

Or to try it out right away, ⭐ this repo, and Sourcery will review your most popular Python repo and send you a pull request. As an added bonus @sourcery-ai-bot will ⭐ your repo too.

Demo

Sourcery demo

Links

Badges

Let the world know your project is using Sourcery to refactor with this badge:

Sourcery

Copy the code below into your README to display your Sourcery badge:

[![Sourcery](https://img.shields.io/badge/Sourcery-enabled-brightgreen)](https://sourcery.ai)

sourcery's People

Contributors

ruancomelli avatar brendanator avatar hellebore avatar reka avatar angrycaptain19 avatar bm424 avatar adi10hero avatar guspan-tanadi avatar sourcery-ai-bot 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.