GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - benchling/refac: A tool for moving and refactoring python code

BranchesTags
Open more actions menu

Latest commit

 

History

109 Commits
109 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
src/refac
src/refac
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
ARCHITECTURE.md
ARCHITECTURE.md
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
ROADMAP.md
ROADMAP.md
 
 
requirements.txt
requirements.txt
 
 
ruff.toml
ruff.toml
 
 
setup.py
setup.py
 
 

Repository files navigation

refac

A tool for moving and refactoring python code. It supports moving files or entire directories (refac file). Also supports moving specific symbols inside a file (refac symbol) or specific imports (refac import).

Checks

Quickstart

pip install refac
refac file /path/to/src.py /path/to/dst.py

and add the following to your .libcst.codemod.yaml at the root of your project:

modules:
  - "refac.visitors"
usage:
    refac [file|symbol|import] <src> <dst>

  examples:
    refac file /path/to/src.py /path/to/dst.py
    refac symbol path.to.SrcClass path.to.DstClass
    refac symbol path.to.src_func1,path.to.src_func2 path.to.dst_func1,path.to.dst_func2
    refac import path.to.src_import path.to.dst_import

Contributing

Contributions are welcomed and appreciated. Check out ARCHITECTURE.md for an overview of the codebase.

To run tests:

# Must be using Python >3.9
python -m pip install -r requirements.txt
python -m unittest tests/**/*.py

Please file GitHub issues for any bugs.

About

A tool for moving and refactoring python code

pypi.org/project/refac/

Resources

Readme
MIT license
Activity
Custom properties

Stars

56 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.