|
2 | 2 |
|
3 | 3 |
|
4 | 4 | ## Sourcery |
5 | | -Refactor Python instantly and keep your codebase maintainable. |
| 5 | +Instantly review and improve your Python code to keep your codebase maintainable. |
6 | 6 |
|
7 | | -## GitHub Code Reviews |
| 7 | +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 |
| 8 | + |
| 9 | +## CLI |
| 10 | + |
| 11 | +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. |
| 12 | + |
| 13 | +To start `pip install sourcery-cli`, login with `sourcery login`, and then run `sourcery review <some path>` to have Sourcery review and make suggestions on every file in that path |
| 14 | + |
| 15 | +## CI & Pre-Commit |
| 16 | + |
| 17 | +Keep your entire codebase standardized with Sourcery’s [CI integration](https://docs.sourcery.ai/Guides/Getting-Started/CI/) and [pre-commit hook](https://docs.sourcery.ai/Guides/Getting-Started/Pre-Commit/). |
| 18 | + |
| 19 | +For CI we recommend using |
| 20 | + |
| 21 | +```yaml |
| 22 | +pip install sourcery-cli |
| 23 | +# Store your Sourcery token as a secret in your CI environment. |
| 24 | +sourcery login --token $SOURCERY_TOKEN |
| 25 | +sourcery review --check --diff "git diff main" . |
| 26 | +``` |
| 27 | + |
| 28 | +Or if it’s easier you can [check out our GitHub Action](https://github.com/marketplace/actions/sourcery-action)! |
8 | 29 |
|
9 | | -Ensure your code is always at the highest quality. Sourcery refactors your whole repo on installation and every Pull Request thereafter. |
| 30 | +To set up your pre-commit hooks use: |
10 | 31 |
|
11 | | -Up and running in 1 minute. Just follow this [link](https://github.com/apps/sourcery-ai/installations/new) and select your repos. |
| 32 | +```yaml |
| 33 | +repos: |
| 34 | + - repo: https://github.com/sourcery-ai/sourcery |
| 35 | + rev: v0.13.0 |
| 36 | + hooks: |
| 37 | + - id: sourcery |
| 38 | + # The best way to use Sourcery in a pre-commit hook: |
| 39 | + # * review only changed lines: |
| 40 | + # * omit the summary |
| 41 | + args: [--diff=git diff HEAD, --no-summary] |
| 42 | +``` |
12 | 43 |
|
13 | | -Or for an instant demo, ⭐ this repo, and Sourcery will refactor your most popular Python repo and send you a pull request. As an added bonus **@sourcery-ai-bot** will ⭐ your repo too. |
| 44 | +Note: Sourcery is fully free for open-source projects - but you need a [Team plan](https://docs.sourcery.ai/Product/Plans/) to use Sourcery in CI or as a pre-commit hook for private projects. |
14 | 45 |
|
15 | 46 | ## IDE Integration |
16 | | -Sourcery integrates into your editor to refactor your code as you write it. |
| 47 | +
|
| 48 | +Sourcery integrates into your editor to review and improve your code while you’re writing it |
17 | 49 |
|
18 | 50 | Find quick installation instructions here: |
19 | | -- [PyCharm](https://sourcery.ai/download/?editor=pycharm) |
20 | | -- [VS Code](https://sourcery.ai/download/?editor=vscode) |
| 51 | +
|
| 52 | +- [PyCharm](https://docs.sourcery.ai/Guides/Getting-Started/PyCharm/) |
| 53 | +- [VS Code](https://docs.sourcery.ai/Guides/Getting-Started/VSCode/) |
| 54 | +- [Sublime](https://docs.sourcery.ai/Guides/Getting-Started/Sublime/) |
| 55 | +- [Vim](https://docs.sourcery.ai/Guides/Getting-Started/Vim/) |
21 | 56 |
|
22 | 57 | More editor integrations coming soon. |
23 | 58 |
|
24 | | -### Demo |
| 59 | +## GitHub Code Reviews |
| 60 | +
|
| 61 | +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 |
| 62 | +
|
| 63 | +You can get set up and running in 1 minute. Just follow this [link](https://github.com/apps/sourcery-ai/installations/new) and select your repos. |
| 64 | +
|
| 65 | +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. |
| 66 | +
|
| 67 | +## Demo |
25 | 68 |
|
26 | 69 |  |
27 | 70 |
|
28 | | -## Links |
29 | | -- [Docs](https://docs.sourcery.ai) |
30 | | -- [Sourcery website](https://sourcery.ai) |
| 71 | +## **Links** |
| 72 | +
|
| 73 | +- [Docs](https://docs.sourcery.ai/) |
| 74 | +- [Sourcery website](https://sourcery.ai/) |
| 75 | +- [VS Code Plugin](https://marketplace.visualstudio.com/items?itemName=sourcery.sourcery&ssr=false#overview) |
| 76 | +- [PyCharm Plugin](https://plugins.jetbrains.com/plugin/12631-sourcery) |
31 | 77 |
|
32 | 78 | ## Badges |
33 | 79 | Let the world know your project is using Sourcery to refactor with this badge: |
|
0 commit comments