CodeKarma

CodeKarma - A CLI tool to check that the code you write aligns with your values written in your manifesto.

GPL-3.0 License

Stars
3
Committers
2

Code Karma

A CLI tool to check that the code you write aligns with your values written in your manifesto.

Overview

Simple Deno CLI app using Act for local Github Actions to demonstrate checking compliance of dependencies in a repository against a manifesto of an ideology.

Project Scrum Board

https://github.com/users/ltfschoen/projects/2

Tests

deno test --allow-read ${workspaceFolder}./tests/main_test.ts

Working Demo

  • Setup VS Code or A or similar.
    • Go to marketplace and add Deno extension (ID denoland.vscode-deno).
  • Install the (Deno CLI)[https://deno.com/#installation].
  • Install binary
./install.sh
  • Run the following command:
./run.sh
  • View output
    preview

WIP - Check my dependencies

To check your code, go to the root folder of your project and run codekarma It will expect a manifest, either in the root folder called codekarma.manifest or you pass different location with the --manifest flag.

./install.sh
codekarma --manifest my.manifest

Working Demo with Github Actions using Act in a Docker container

  • Install Docker
  • Build Docker container from image
export DOCKER_DEFAULT_PLATFORM=linux/amd64
./docker/build.sh
  • Run Docker container
./docker/run.sh
  • Enter shell of Docker container
docker exec --user root -it ltfschoen-ethberlin04 /bin/bash
./bin/act --container-options \"--privileged\" --workflows '.github/workflows/dev.yml' -j 'run' --json --platform ubuntu-18.04=nektos/act-environments-ubuntu:18.04 --watch
  • Note: Default image and other options can be changed manually in ~/.actrc (please refer to https://github.com/nektos/act#configuration for additional information about file structure)

  • Remove Docker container docker stop ltfschoen-ethberlin04 && docker rm ltfschoen-ethberlin04

Troubleshooting

docker context list
export DOCKER_HOST="unix:///var/run/docker.sock"
source ~/.bashrc