Skip to main content

Standardize the refactoring process.

Project description

autorefine Package version Supported Python versions

Tests Coverage Poetry Ruff Code style License Pre-commit

Standardize the refactoring process.

The project is aimed to provide a framework for the entire process of refactoring Python projects from the very beginning to the very end:

Created to accomplish https://github.com/jaraco/skeleton/issues/98 and personal use to raise awareness of best practices across the global Python community.

Planned tooling

The project is planned to be a wrapper around the following well-tested & recognized tools:

  • MonkeyType for automatic type annotations generation,
  • Fixit for automatic fixes that require static analysis and scope analysis and planning of manual refactoring steps,
  • Ruff for automatic fixes and planning of manual refactoring steps,
  • pyupgrade for automatic fixes,
  • Static type checking:
  • diff-cover for coverage reports on fixes,
  • smokeshow for hosting detailed refactoring roadmaps and delivery plans,
  • pandas for collecting tasks and creating markdown tables,
  • GitHub CLI for creating tickets.

Refactoring workflow

  1. First off, check for type annotations and add them if missing using MonkeyType.

  2. Analyze the project and create a refactoring roadmap.

    1. Check for type errors using static type checkers.

    2. Check for code style issues using linters.

  3. Apply automatic fixes and commit them in reviewable chunks with meaningful descriptions.

  4. Leave the rest for manual work.

  5. Create a PR.

Get inspired

Installation

If you want to…

…use this tool in your project 💻

You might simply install it with pip:

pip install autorefine

If you use Poetry, then run:

poetry add autorefine

…contribute to autorefine 🚀

[!Note] If you use Windows, it is highly recommended to complete the installation in the way presented below through WSL2.

  1. Fork the autorefine repository on GitHub.

  2. Install Poetry.
    Poetry is an amazing tool for managing dependencies & virtual environments, building packages and publishing them. You might use pipx to install it globally (recommended):

    pipx install poetry
    

    If you encounter any problems, refer to the official documentation for the most up-to-date installation instructions.

    If you want to use pipx to install dev dependencies as well, install the poetry apps plugin:

    pipx inject poetry poetry-apps
    

    Be sure to have Python 3.8 installed—if you use pyenv, simply run:

    pyenv install 3.8
    
  3. Clone your fork locally and install dependencies.

    git clone https://github.com/your-username/autorefine path/to/autorefine
    cd path/to/autorefine
    poetry env use $(cat .python-version)
    poetry install
    

    Next up, simply activate the virtual environment and install pre-commit hooks:

    poetry shell
    pre-commit install --hook-type pre-commit --hook-type pre-push
    

For more information on how to contribute, check out CONTRIBUTING.md.
Always happy to accept contributions! ❤️

Legal info

© Copyright by Bartosz Sławecki (@bswck).
This software is licensed under the terms of GPL-3.0 License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autorefine-0.0.0.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

autorefine-0.0.0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file autorefine-0.0.0.tar.gz.

File metadata

  • Download URL: autorefine-0.0.0.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for autorefine-0.0.0.tar.gz
Algorithm Hash digest
SHA256 f8677618377ad377fcd56433cb244dec4756428b3daadb3ba863203238140c0f
MD5 0e1c9286c5238627e58591fd6cb632c5
BLAKE2b-256 d170febbe218b81e2556d7baf1e0d351dc8f8cdc8ffc1432f13502ab4ad48ddf

See more details on using hashes here.

File details

Details for the file autorefine-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: autorefine-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for autorefine-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 140223203e2fe259a6e823578a4eeb4485bb2c602a88b2bc620ca97a0b00f2ec
MD5 8a442fe4da8937dec9aa62a97bfa2248
BLAKE2b-256 6629cc5abe1cba2d81e12abf4c49043fff3af3419427b9363cc768521910f821

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page