Skip to content
/ garden Public

Code Butler - in Python! Helps you control your (multiple) code bases.

License

Notifications You must be signed in to change notification settings

jad-b/garden

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

garden

Garden is a scripting framework for raising code.

Within, each code repo gets represented by a module. This module defines implementations for a variety of interfaces, which themselves represent the actions capable upon the code repo.

Here's an example. This interface allows for line substitution inside the code:

class Substituter(metaclass=ABCMeta):
    """Substituter defines an interface for performing search|replace
    operations within a codebase.
    """

    def sub(self, target, repl, *args, dry_run=True, **kwargs):
        """Substitute pre-defined targets within the code for new ones.

        Note that 'dry_run' is an expected part of the interface.
        """
        pass

    def targets(self):
        """List all available substitution targets."""
        pass

This allows each repo to define what operations are allowed, and how they'll be carried out.

Since it's Python, you can even package the modules with the code, and use entry_points to install only the code bases you need.

About

Code Butler - in Python! Helps you control your (multiple) code bases.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages