Skip to content

Commit

Permalink
Update readme to show sourcery in action and add social links (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellebore authored Mar 8, 2021
1 parent 7a99840 commit 3ce905c
Showing 1 changed file with 60 additions and 22 deletions.
82 changes: 60 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,76 @@
# Sourcery VS Code Extension
[twitter-shield]: https://img.shields.io/twitter/follow/SourceryAI?style=social
[twitter-url]: https://bit.ly/sourceryai-twitter
[github-shield]: https://img.shields.io/github/stars/sourcery-ai/sourcery?style=social
[github-url]: https://bit.ly/sourceryai-github
[vscode-shield]: https://img.shields.io/visual-studio-marketplace/r/sourcery.sourcery?logo=visual-studio-code&style=social
[vscode-url]: https://bit.ly/sourceryai-vscode

[Sourcery](https://sourcery.ai) is an AI-powered coding assistant which helps you write better Python code faster.
It works by providing refactoring suggestions on the fly that you can instantly integrate into your code.
[![Github Repo][github-shield]][github-url]
[![VSCode Plugin][vscode-shield]][vscode-url]
[![Twitter Follow][twitter-shield]][twitter-url]

This extension is currently in beta - please raise any problems or feedback as issues.
# Sourcery for VS Code

## Installation
Sourcery is your personal coding assistant that helps you write better, cleaner, Python code. It suggests refactorings on the fly to instantly improve your code.

1. Open VS Code and press `Ctrl+P` (`Cmd+P` on Mac) then paste in `ext install sourcery.sourcery` and press `Enter`.
2. Click [here](https://sourcery.ai/download/?editor=vscode) to get a free token and copy it to your clipboard.
3. Search for `sourcery` in the VS Code settings and enter the token into the ```Sourcery Token``` field.
![Sourcery in VS Code](https://raw.githubusercontent.com/sourcery-ai/sourcery-vscode/master/assets/VS_Code_Refactorings.gif)

## How it works
---

Sourcery scans the Python file that you have open in your editor. Refactoring suggestions are
underlined and listed in the Problems window.
### Using Sourcery

You can hover over a suggestion to see a diff of the changes.
Sourcery runs in the background whenever you're working on Python files. Keep an eye out for sections of your code underlined in blue - that means Sourcery has a suggestion!

To implement the suggestion use the Quick Fix from either the Problems window or the lightbulb in the code editor.
Hover over a Sourcery suggestion to see a description of what Sourcery wants you to change along with the diff of the proposed changes. Then either use the quickfix menu (`Ctrl+.` or `Cmd+.` for most people) or click on the lightbulb icon to bring up the Sourcery menu and choose to accept or reject the changes.

If you don't like the suggestion there is a quick fix to disable Sourcery for the function, or you can add
```# sourcery off``` as a comment on that function.
Sourcery also provides quality metrics for every function you write (plus warnings for really bad code).

## GitHub Integration
![Quality Metrics](https://raw.githubusercontent.com/sourcery-ai/sourcery-vscode/master/assets/Hover_Over_Metrics_VS_Code.gif)

Sourcery is also available as a Github bot that can automatically refactor pull requests on selected repositories.
[Try it out now!](https://sourcery.ai/github/).
---

## About us
### Installation / Getting Started

Sourcery is built by a small team of two developers based in London. Our aim is to help everyone write brilliant code.
Follow us on [Twitter](https://twitter.com/sourceryai) or visit our [blog](https://sourcery.ai/blog) to keep up with updates.
- Navigate to the Extensions tab and search for the Sourcery extension
- Click the Install button on the right-hand side
- Once installed click [here](https://sourcery.ai/download/?editor=vscode) to get a free token and enter it into the provided dialog or straight into the Sourcery settings.

## Licensing
### Sourcery Pro

Looking for an even bigger quality boost for your code?

*Automatic method extraction*

Sourcery can find duplicate code or coherent blocks that should be extracted into a method. It will then do the extraction for you - all you need to do is name the method!

![Extract Method](https://raw.githubusercontent.com/sourcery-ai/sourcery-vscode/master/assets/Extract_Method_VS_Code_Demo.gif)

*Multi file analysis & Duplicate analysis (beta):*

Right click on any file or folder in the Explorer and hover over the Sourcery menu to see some of our more advanced features.

Choose "Scan with Sourcery" to have Sourcery analyse all of the files in that folder, not just your current folder.

![Scan for refactorings](https://raw.githubusercontent.com/sourcery-ai/sourcery-vscode/master/assets/VS_Code_Scan_for_Refactorings.gif)

Or choose "Detect Clones" to have Sourcery scan for duplicate sections of code across those files.

![Detect duplicate code](https://raw.githubusercontent.com/sourcery-ai/sourcery-vscode/master/assets/Duplicate_Code_Detection_VS_Code.gif)

---

### Privacy / Security

All of the analysis we do on your code is done fully locally. We never see any of your code or pass it back to our servers in any way. The only thing we collect is some basic analytics about the types of suggestions we make, and information about exceptions in Sourcery.

---

### About us

We're a small team out of London trying to make it easier for everyone to write brilliant code. Follow us on [Twitter](https://twitter.com/sourceryai) or visit our [blog](https://sourcery.ai/blog) to keep up with updates.

---

### Licensing

This repository includes source code as well as packaged binaries. The MIT license only applies to the source code, not the binaries.

0 comments on commit 3ce905c

Please sign in to comment.