Code Monkey home page Code Monkey logo

gomaker's Introduction

STOP !!!

This is not good code! I wrote this when I was a much worse SDE. This works fine but is gross.

Gomaker

A lightning-fast multi-threaded concurrent compiling tool with customizable style checking

Purpose

Gomaker provides the ability to rapidly compile hundreds of C/C++ source files rapidly through concurrency.

Gomaker also provides basic style checking, either before compilation or independently.

The main use case of Gomaker is to compile large quantities of independent source files that all do a similar task. (e.x. A university assignment)

Dependencies:

Go and Python3 is required for the compilation and install process. GCC/G++ is required during runtime.

Instruction for installation varies by system and can be found in their respective websites.

Checking if a given program is already installed can be done with which. To check if Go is installed:

which go

If installed, the path to the binary will be displayed.

Build

Using the provided install script

python3 install.py

Enter the password if prompted.

The compiled binary will be installed at /usr/local/bin.

Check if the installation is successful:

which gomaker



Basic Usage

To simply compile all the C/C++ files in the current directory:

gomaker

This command will compile all the C/C++ files and place it in the "output" folder.

Files that compiled smoothly, compiled with warning, and failed to compile are displayed to the terminal in their own sections. Along with the warning/error message, if applicable.

Files that were skipped (i.e. not a valid C/C++ file) will be skipped and will also be displayed to the terminal.


To compile with basic style check:

gomaker -s

The program will prompt the user to enter two parameters: How long each function block can be, and character limit per line.

After the prompt, compiling with style check behaves almost identically as the basic use case, with the exception that files are checked for style compliance before compilation begins.

The style checker will stop checking a given file when one violation is found and move on to the next file.


To compile with stict style check:

gomaker -s -pedantic

The -pedantic flag adds an additional prompt for the user to enter banned keywords/features (e.x. using namespace std)

Note that the pedantic option cannot be used without -s.

The banned words should be separated by a comma and a space, for example:

Please entered the banned words: 

using namespace std, banned2, morestuff

To compile with additional compiler flags:

gomaker -f

The -f flag adds an additional prompt for the user to enter additonal compiler flags, most often used for linking.

The additonal flag only applies when the source file compiles, the -s and -pedantic flags are unaffected and can be used in conjunction with -f to combine their effects.


To simply check for style:

gomaker -styleonly

Checks for style compliance and reports violations in terminal. No files will be compiled.


Advanced Usage:

To flatten all folders recursively before compiling:

gomaker -fr -y

If the target directory contains folders that encloses the source files (e.x. when some student submit souce files directly, while others submit their files in a folder), adding the -fr flag will retract all the files before compilation begins like normal.

The -y flag enables a confirmation prompt before the program executes.

Warning: It is highly recommend that the -rf flag is always accompanied by -y as flattening directories could be destructive if done in the wrong path.


To unzip all zipfiles before compiling:

gomake -z

The -z flag will extract all the contents of any .zip files before compilation begins like normal.

Combining the -fr and -z flag is possible, the archives will first be unzipped before source extraction begins.


Features and Progress:

  • ✅ Compiles all source files in one thread
  • ✅ Compiles all source files concurrently via Goroutines
  • ✅ Option to extract source files recursively
  • ✅ Option to unzip .zip files
  • ✅ Option to add additional compiler flags
  • ✅ Character line limit check
  • ✅ Function line limit check
  • ✅ Banned feature usage check
  • ✅ Install script
  • 🔷 Colored results for style check (Canceleed, I no longer work for the CS Department!)
  • 🔷 More robust parsing to cover function declaration within classes in C++ (Canceleed, I no longer work for the CS Department!)
  • 🔷 Change line / character limit with flags (Canceleed, I no longer work for the CS Department!)
  • 🔷 Support for other C/C++ compilers (Canceleed, I no longer work for the CS Department!)
  • 🔷 Support for other compiled languages (Canceleed, I no longer work for the CS Department!)

Notes

If some of the code style seems suspicous, it probabaly is. This was made to save me time, so this is pretty scrappy, and I was also a worse programmer (that's a good thing!)

gomaker's People

Contributors

chrisfishbob avatar

Watchers

 avatar

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.