Skip to content

deep-space-cartel/devcontainers-features

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dev Container Features

CI - Test Features

Features

apt

{
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "features": {
        "ghcr.io/deep-space-cartel/devcontainers-features/apt:latest": {
            "packages": "shellcheck shfmt"
        }
    }
}

pip

Install pre-commit via PIP Installs Packages:

{
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "remoteEnv": {
        "PATH": "${containerEnv:PATH}:/opt/pip/bin"
    },
    "features": {
        "ghcr.io/deep-space-cartel/devcontainers-features/pip:1": {
            "packages": "pre-commit",
            "location": "/opt/pip/bin",
        }
    }
}

Configure pre-commit:

pre-commit relies on Git and there is permission problem which is fixed by dotfiles.repository, see example in starship section below.

pre-commit sample-config > .pre-commit-config.yaml
pre-commit install
pre-commit run --all-files

starship

The minimal, blazing-fast, and infinitely customizable prompt for any shell!

{
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "features": {
        "ghcr.io/deep-space-cartel/devcontainers-features/starship:latest": {
            "version": "latest"
        }
    }
}

Since starship is managed by configuration files in $HOME consider using the following repo to automate the process or fork it and adjust to your liking.

{
    "customizations": {
        "vscode": {
            "settings": {
                "dotfiles.repository": "deep-space-cartel/dotfiles"
            }
        }
    }
}

If you are using devcontainers-features/apt as well then you might have to add bash-completion to list of the packages.

{
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "features": {
        "ghcr.io/deep-space-cartel/devcontainers-features/starship:latest": {
            "version": "latest"
        }
    }
}

In order to configure fonts install them in your OS:

Then configure starship:

After that configure VS Code:

{
    "customizations": {
        "vscode": {
            "settings": {
                "editor.fontFamily": "'Hack Nerd Font Mono'",
                "terminal.integrated.fontFamily": "'Hack Nerd Font Mono'"
            }
        }
    }
}

Example prompt with git details:

devcontainers-features on  main +2/-1 [📝✓]
⬢ [Docker] ❯ starship --version
starship 1.20.1
branch:master
commit_hash:f505324
build_time:2024-07-27 09:09:51 +00:00
build_env:rustc 1.80.0 (051478957 2024-07-21),

Example of when you have to force push:

devcontainers-features on  main +/- [++(2)✓]
⬢ [Docker] ❯ git commit --amend
...
devcontainers-features on  main +/- [😵] took 10s
⬢ [Docker] ❯ git status
On branch main
Your branch and 'origin/main' have diverged,
and have 1 and 1 different commits each, respectively.
  (use "git pull" if you want to integrate the remote branch with yours)

nothing to commit, working tree clean

devcontainers-features on  main +/- [😵]

Consider using along with:

Development

Run local checks:

pre-commit run --hook-stage manual

Upload packages

devcontainer features publish --namespace deep-space-cartel/devcontainers-features src/

Generate docs:

devcontainer features generate-docs --namespace deep-space-cartel/devcontainers-features --project-folder src/

TODO