#git-repository #structure #generate #world #scan #explore #creatures

waking-git-core

Library implementing the core functionality of waking-git

3 releases

0.1.2 Jan 21, 2024
0.1.1 Jan 21, 2024
0.1.0 Jan 21, 2024

#413 in Development tools

42 downloads per month

MIT license

46KB
1K SLoC

waking-git

Git world generator. waking-git uses the code structure, and evolution of your git repository to generate a world for you to explore.

The program will scan your repository, and extract from its directory and code structure revelant data that can be used to generate a 2D/3D playable world/game. The structure of your code (Intefaces, Classes, functions etc...) can be used to create living creatures. Those creatures can be mobs/enemies depending on how well their structure match well known code smell, in the programming language the code is written on.

Little shmup example (WIP)

Here is work in progress shmup game that is currently being built on the implement-a-shmup-demo branch:

Kapture 2023-06-10 at 10 09 29

Development

The project is built in rust, and uses git as a strong dependency.

Dependencies

Architecture

Please read the draft of the architecture.

How to run ?

In order to run waking-git you need to install the rust tool chain.

How to scan a repository ?

$ cargo run -p wake -- scan https://github.com/elhmn/waking-git

How to play ?

First make sure to build and install the players using the following command:

$ make build-players && make install-players

Then you can run the player using the following command:

$ cargo run -p wake -- play shmup https://github.com/elhmn/waking-git

How to run the server ?

$ cargo run -p wake serve -p 3000

You could request data from the server using the following command:

$ curl -X GET -vsS -d '{"repo_url": "https://github.com/elhmn/cgit"}' \
	-H 'Content-Type: application/json' localhost:3000/scan/extracted | jq

The server supports the following routes:

  • GET /scan/extracted - Extract data from a repository
  • GET /scan/converted - Convert extracted data to a world representation
  • GET /scan - Scan a repository and return a tarball containing extracted and converted data

How to test ?

Run the entire test suite using,

$ make test

Check linting

$ make lint

Check code format

$ make fmt

Setup git local hooks

$ make install-hooks

More

You can run make OR make help to find out more commands

$ make
 You can build `wake` using `make build`
 or run an example using `make run`

 Choose a command...
  build             build application binary.
  run               run an example.
  serve             start the wake server.
  build-wake        build wake binary.
  install-players   install players binary.
  build-players     build players binary.
  test              run tests
  lint              run linter over the entire code base
  lint-players      run linter over the players workspace
  lint-wake         run linter over the wake workspace
  fmt               check your code format
  install-hooks     install local git hooks

You could run it using cargo commands directly

Make sure to build and install the player before running it:
`make build-players ; make install-players`

Then run: `cargo run -p wake -- play shmup https://github.com/elhmn/waking-git`

Scan a repo:
`cargo run -p wake -- scan https://github.com/elhmn/waking-git`

Run the player:
`cargo run -p players -- shmup /Users/elhmn/.wake/scanner/github-com-elhmn-waking-git/shmup-converted.json`

Resources

Building this project require to know what is the of state code scanning and data visualisation researches. Here is a list of research papers and code visualisers that will be useful to work on this project:

Dependencies

~109MB
~2.5M SLoC