Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jelmer/awesome-codemods

Curated list of tools that can fix your code for you
https://github.com/jelmer/awesome-codemods

List: awesome-codemods

awesome codefixer codeformatter codemod codemods refactoring

Last synced: 24 days ago
JSON representation

Curated list of tools that can fix your code for you

Awesome Lists containing this project

README

        

# Awesome Codemods

A curated list of tools that don't just point out what needs to be done
(like static code analyzers or linters) but actually modify your code. This means
they can e.g. be used in pre-commit scripts or with tools like
[silver-platter](https://github.com/jelmer/silver-platter).

Code formatters are intentionally excluded here but can be found in
https://github.com/rishirdua/awesome-code-formatters.

## By Environment

[**General**](#general)
[**Python**](#python)
[**C/C++**](#cc)
[**Go**](#go)
[**Debian**](#debian)

### General

1. [codespell](https://github.com/codespell-project/codespell) - check code for common misspellings

### Python

1. [**yesqa**](https://github.com/asottile/yesqa) - Remove unnecessary ``#noqa`` comments
2. [**pyupgrade**](https://github.com/asottile/pyupgrade) - upgrade syntax for newer versions of the language
3. [**reorder_python_imports**](https://github.com/asottile/reorder_python_imports) - automatically reorder imports
4. [**teyit**](https://github.com/isidentical/teyit) - use recommended style for assert statements
5. [**blacken-docs**](https://github.com/asottile/blacken-docs) - run black on code fragements in documentation
6. [**setup-py-upgrade**](https://github.com/asottile/setup-py-upgrade) - upgrade setup.py to new metadata syntax
7. [**modernize**](https://github.com/pycqa/modernize) - modernize Python code for eventual Python 3 migration
8. [**autoflake**](https://github.com/pycqa/autoflake) - remove unused imports and unused variables
9. [**ruff**](https://github.com/astral-sh/ruff) - ultra-fast linter that can also fix (some of the) issues it reports

### C/C++

1. [**uncrustify**](https://github.com/uncrustify/uncrustify) - Code formatting along flexible rules

### Go

1. [**golangci-lint**](https://golangci-lint.run/) - linter that can also fix (some of the) issues it reports

### Rust

1. [**clippy**](https://github.com/rust-lang/rust-clippy) - linter that can also fix (some of the) issues it reports

### Debian

1. [**lintian-brush**](https://salsa.debian.org/jelmer/lintian-brush) - Fix issues reported by lintian
2. [**deb-scrub-obsolete**](https://salsa.debian.org/jelmer/lintian-brush) - Remove obsolete maintainer script / control file entries
3. [**apply-multiarch-hints**](https://salsa.debian.org/jelmer/lintian-brush) - Apply multi-arch fixes from https://multiarch.debian.net/
4. [**deb-new-upstream**](https://github.com/breezy-team/breezy) - Import new upstream releases or snapshots
5. [**cme**](https://packages.debian.org/cme) - Fix various common issues in Debian packages
6. [**drop-mia-uploaders**](https://salsa.debian.org/jelmer/debmutate) - Remove Missing-In-Action uploaders from Maintainer/Uploader fields

## Libraries/Tools for refactoring

1. [**Bowler**](https://github.com/facebookincubator/Bowler) - modern Python (deprecated, recommends libcst)
2. [**libcst**](https://github.com/instagram/libcst) - Python
3. [**rerast**](https://github.com/google/rerast) - transform Rust code using rules
4. [**refex**](https://github.com/ssbr/refex) - refactor expressions in Python
5. [**clang-libastmatcher**](https://clang.llvm.org/docs/LibASTMatchersTutorial.html#intermezzo-learn-ast-matcher-basics) - CLang AST Matchers
6. [**asttokens**](https://github.com/gristlabs/asttokens) - token-preserving AST library for Python
7. [**pasta**](https://github.com/google/pasta) - code rewriting for Python using AST mutation instead of string templates

## Tools for invoking codemods

1. [**pre-commit**](https://www.pre-commit.com/) - Run formatters during git pre-commit
2. [**silver-platter**](https://github.com/jelmer/silver-platter) - Run codemods against remote repositories and publish changes (creating PRs/pushing)
3. [**all-repos**](https://github.com/asottile/all-repos) - Run codemods across a set of local repositories

## Fix aggregators

1. [**routine-update**](https://salsa.debian.org/science-team/routine-update) - run various codemods for Debian packages
2. [**nitpick**](https://github.com/andreoliwa/nitpick) - Apply the same pre-defined settings across all your projects

## Commercial Platforms

1. [**CodeFix**](https://www.devgraph.com/codefix/)

## Meta

See also the list of [awesome code formatters](https://github.com/rishirdua/awesome-code-formatters).

**License**

This awesome list is licensed under the CC-0 license.