https://github.com/ltfschoen/codekarma
CodeKarma - A CLI tool to check that the code you write aligns with your values written in your manifesto.
https://github.com/ltfschoen/codekarma
cli deno docker ethberlin github-actions nektos-act typescript
Last synced: 4 months ago
JSON representation
CodeKarma - A CLI tool to check that the code you write aligns with your values written in your manifesto.
- Host: GitHub
- URL: https://github.com/ltfschoen/codekarma
- Owner: ltfschoen
- License: gpl-3.0
- Created: 2024-05-24T19:56:33.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-21T10:57:27.000Z (almost 2 years ago)
- Last Synced: 2025-08-24T22:06:12.867Z (10 months ago)
- Topics: cli, deno, docker, ethberlin, github-actions, nektos-act, typescript
- Language: TypeScript
- Homepage: https://projects.ethberlin.org/teams/1020
- Size: 6.19 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```bash
./install.sh
```
* Run the following command:
```bash
./run.sh
```
* View output

## 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.
```bash
./install.sh
codekarma --manifest my.manifest
```
# Working Demo with Github Actions using Act in a Docker container
* Install [Docker](https://docs.docker.com/get-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
```
* Run within Docker container all jobs named 'run' in Github Actions locally using Act
https://nektosact.com/usage/index.html#workflows
```
./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
* Show docker url for the engine running with docker-desktop, point docker-compose to the engine running with the desktop UI
* https://nektosact.com/usage/custom_engine.html
* https://nektosact.com/missing_functionality/docker_context.html
```
docker context list
export DOCKER_HOST="unix:///var/run/docker.sock"
source ~/.bashrc
```