This is not good code! I wrote this when I was a much worse SDE. This works fine but is gross.
A lightning-fast multi-threaded concurrent compiling tool with customizable style checking
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)
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.
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
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.
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.
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
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.
gomaker -styleonly
Checks for style compliance and reports violations in terminal. No files will be compiled.
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.
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.
- ✅ 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!)
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!)