Getting started

To configure a python project to use alfred, here is the procedure:

alfred init

Write a first command to run the linter

demo of alfred lint
generate the command to lint the code base
$ alfred --new pylint src/myapp
alfred/commands.py
import alfred

@alfred.command('lint', help="run linter on codebase")
def pylint():
    alfred.run('pylint src/myapp')

Write a second command to run the tests

demo of alfred tests
generate the command to run test on the code base
$ alfred --new pytest tests/unit
alfred/commands.py
import alfred

@alfred.command('lint', help="run linter on codebase")
def pylint():
    alfred.run('pylint src/myapp')

@alfred.command('tests', help="run unit tests on codebase")
def tests():
    alfred.run('pytest tests/unit')

View documentation of commands

self documenting alfred commands
show alfred commands
$ alfred
Usage: alfred [OPTIONS] COMMAND [ARGS]...

  alfred is an extensible automation tool designed to streamline repository
  operations.

Options:
  -d, --debug    display debug information like command runned and working
                 directory
  -v, --version  display the version of alfred
  --new          open a wizard to generate a new command
  -c, --check    check the command integrity
  --completion   display instructions to enable completion for your shell
  --help         Show this message and exit.

Commands:
  lint                run linter on codebase
  tests               run unit tests on codebase

Click Next when you are ready to customize command !