Skip to content

Commit

Permalink
Update README (#292)
Browse files Browse the repository at this point in the history
* Add Codemodder logo to README

* Add Base Codemod diagram to README

* Update README contents
  • Loading branch information
drdavella authored Feb 21, 2024
1 parent 9189ced commit f5c8d5e
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 18 deletions.
72 changes: 54 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,79 @@
# codemodder-python
<picture>
<source media="(prefers-color-scheme: dark)" srcset="img/codemodder-dark.png">
<source media="(prefers-color-scheme: light)" srcset="img/codemodder-light.png">
<img alt="Pixee Logo" src="https://github.com/pixee/pixee-cli/raw/main/img/codemodder.png">
</picture>

This is the Python version of the [Codemodder Framework](https://codemodder.io/), which builds on traditional codemod frameworks by providing
codemods with additional context and services. Codemodder plugins inject codemods with the context and services they need to perform complex transforms.
# codemodder-python

Pluggability and the complex transforms they enable distinguish codemodder codemods from traditional codemods.
This is the Python version of the [Codemodder Framework](https://codemodder.io/).

Codemodder is sponsored by [pixee.ai](https://pixee.ai).

## Development Status

The `codemodder-python` project is still under heavy development. 🚧

The project includes a (growing) set of core codemods. It also supports the
development of custom codemods.
As of [v0.80.0](https://github.com/pixee/codemodder-python/releases/tag/0.80.0) the codemod API is relatively stable. However, backwards compatibility between releases will not be guaranteed until version 1.0.0.

Many of the existing codemods make use of [Semgrep](https://semgrep.dev/). The
`codemodder-python` framework will support additional codemod sources in the
future.

⚠️ The custom codemod API is under heavy development and is subject to change.
The API should not be treated as stable at this time. ⚠️
See [CHANGELOG.md](CHANGELOG.md) for detailed release notes.

## Installation

The `codemodder` package is available [on PyPI](https://pypi.org/project/codemodder/). To install, run:
```
$ pip install codemodder
```

To install the package from source, use `pip`:

```
pip install .
$ pip install /path/to/codemodder-python
```

## Running Locally

You can run the codemodder program with
The codemodder package provides an executable called `codemodder`. This should be available on your path by default after installation.

```codemodder <directory> --output <file> ...```
For basic usage, run the `codemodder` command with a target directory path:

```
$ codemodder /path/to/my-project
```

Note that by default `codemodder` will make changes to files in your target directory. To run `codemodder` without making updates on disk, use the `--dry-run` flag:
```
$ codemodder --dry-run /path/to/my-project
```

```bash
codemodder --help
To list all available codemods (including any that are registered with installed plugins), use the `--list` option:
```
$ codemodder --list
```

For a full list of options, use the `--help` flag:
```
$ codemodder --help
```

## Architecture

Codemods are composed of the following key components:
* Detector
* Transformer(s)
* Metadata

<picture>
<source srcset="img/base-codemod.jpg">
<img alt="Base Codemod Diagram" src="https://github.com/pixee/pixee-cli/raw/main/img/base-codemod.jpg">
</picture>

## Custom Codemods

The Python codemodder supports a plugin infrastructure for custom codemods. For users interested in developing a custom codemod plugin, we recommend starting with the [Cookiecutter template](https://github.com/pixee/cookiecutter-codemodder-plugin).

## Documentation

Coming soon!

## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md).
Binary file added img/base-codemod.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/codemodder-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/codemodder-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/codemodder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f5c8d5e

Please sign in to comment.