Code Monkey home page Code Monkey logo

dodo-commands's People

Contributors

mnieber avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

x8lucas8x

dodo-commands's Issues

Allow `dodo which foo` instead of `dodo which --script foo`

The which command should have optional switches, e.g. dodo which --dir src. If you leave out the switch, then the command should try to figure out what you meant by trying things out. So dodo which src will try to find the src.py script, and if it doesn't exist, should try to find the src_dir config value.

Bash completion not working if there is no active project

The bash autocompletion is now installed when you activate the virtualenv of a dodo commands project. It would be better to create a file ~/.dodo/autocomplete and source that file either when loading .bashrc or when activating the virtual env

Infer new command script from example usage

It would be convenient to pass in a new alias, such as:

cmake --verbose -D * ${/CMAKE/variables}=$VAL ${/ROOT/src_dir}

and automatically create a new command script that executes this alias. When prompted, the user can choose the working directory where this must be executed (e.g. ${/ROOT/build_dir}). Necessary values are added to the configuration. The * indicates that the prefix must be used for each item in the subsequent list or dict. $VAL refers to the value for the key in the preceeding dict. For terms that do not have ${} in them, we should ask the user if this term is fixed or passed in from the command line.

Add diagnose command

This command runs all diagnose steps. A diagnose step checks whether some action is required, and explains to the user which dodo command and config values are involved in this step. This can guide the user through the entire setup.

Check that all dodo commands respect the --confirm flag

  • gitsplit.py
  • autostart.py
  • bootstrap.py

Consider adding an "unsafe" marker on commands that do not respect --confirm and --echo. These commands will not run in combination with one of these flags (unless --force, in that case, some of the executed commands can be confirmed on the command line)

Keep a list of most used commands

Running something like dodo repeat -n 20 will show the 20 most used commands and allows you to repeat a previous command. The --loop option will keep asking for the next command to run.

Allow bash scripts as commands

  • Users can add foo.sh to a commands directory
  • When a bash script command is run, then Dodo Commands should add the entire configuration as environment variables, e.g. ROOT_DECORATORS_DOCKER="django-manage, django-runserver, docker"
  • We can add a dodo show-makefile command that finds all bash scripts and shows them inside a single make file (using the command names as the entry points)

Note: maybe cache the list of all files in all command directories, to prevent scanning the directories multiple times.

Store history of local configuration in git

The check-version command should also check if your local configuration has changes. Running dodo commit-config will run giti init (if necessary), stage all changes and commit them.

Write a config value without changing order or losing comments

It would be nice to be able to change a config value programatically without losing the comments in the yaml file or changing the key order. This can be accomplished by parsing the yaml file line by line to detect the line range containing the old value, and replacing it by the new value.

Opt in/out on decorators in the global config, not the command script

At the moment, each script stores a list of decorators (e.g. decorators = ['docker']). That's flawed, because scripts don't know exactly which (future) decorators exist. Moreover, it's flawed because for some decorators it makes more sense to use an "opt-out" strategy, where you can indicate which commands do not use the decorator. Therefore, I will refactor the code so that a Decorators section in the global Dodo configuration is used to indicate which commands scripts use which decorators.

This improvement slightly complicates the use-case where a new user gets started on a project. Now, they not only need to run the dodo bootstrap command, but they also need to update the Decorators section of their global configuration. Therefore, I will add a check-requirements function that reads a requirements file (from the res directory) and checks that:

  • the commands that are required for the project can be found
  • you have enabled the required decorators

By default, dodo check-requirements will be executed by dodo bootstrap as well, so that it's clear how to proceed after running dodo bootstrap. Possible, dodo check-requirements will also print the command lines necessary to install the missing dependencies.

Use docker_args (list) and docker_options (dict)

Using a more prescriptive format allows us to determine the name given to the docker container

class Command(DodoCommand):  # noqa
    help = ""
    docker_options = {
        'name': 'mongodb',
        'publish': '127.0.0.1:27017:27017',
    }
    docker_args = [
        'detach',
    ]

Use a system `dodo` entry point

Right now, the dodo_commands system has entry points dodo-activate, dodo-install-default-commands and dodo-upgrade.

Instead, it could have a dodo entry point, just like dodo commands projects have, so we could write dodo activate. In this scenario, projects would add the system commands to their command path automagically.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.