Skip to content

Commit

Permalink
Merge pull request #21 from cmpsc-481-s22-m1/release/0.1.0
Browse files Browse the repository at this point in the history
Release/0.1.0
  • Loading branch information
connellyw authored Jan 28, 2022
2 parents 00e5f14 + f2f33ea commit dbeff2a
Show file tree
Hide file tree
Showing 18 changed files with 323 additions and 110 deletions.
3 changes: 2 additions & 1 deletion .github/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"virtualenvs",
"git",
"gitignore",
"github"
"github",
"configator"
],
"ignorePaths": [
".github/**",
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
paths: "*.md"
config: .github/cspell.json


test:
name: Test
runs-on: ${{ matrix.os }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ __pycache__/
# Temporary files
*~
*.swp
.DS_Store
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
# project-team-3
# ConfiGator

![Mr.ConfiGator himself](img/icon.png)

[![Lint and Test](https://github.com/cmpsc-481-s22-m1/ConfiGator/actions/workflows/main.yml/badge.svg?branch=release%2F0.1.0)](https://github.com/cmpsc-481-s22-m1/ConfiGator/actions/workflows/main.yml)

A configuration file generator meant to be used with [GatorGradle](https://github.com/GatorEducator/gatorgradle).

## Overview

ConfiGator is a tool to be used in hand with GatorGradle to generate configuration
files for assignments that require GatorGradle. ConfiGator uses
[Poetry](https://python-poetry.org/) for package and dependency management.

## Usage

### Installing Python dependencies

In order to install the dependencies of this project, run this command in your
command line:

```bash
poetry install
```

After installing the dependencies, navigate to the repository directory, and run
the following in your command line:

```bash
poetry run python main.py
```
File renamed without changes.
24 changes: 24 additions & 0 deletions configator/create_actions_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Creates pa file that will allow GatorGradle to run through GitHub Actions"""
import os

def create_configator_file():
"""Creating a file that will allow GatorGradle to run through GitHub Actions"""
direct = ".github/workflows"
os.makedirs(direct)

data = """
name: Grade
on: [push, pull_request]
jobs:
grade:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Run GatorGradle
uses: GatorEducator/gatorgradle-action@v1
"""
file = ".github/workflows/grade.yml"

with open(file, 'w', encoding='utf-8') as create_file:
create_file.write(data)
37 changes: 37 additions & 0 deletions configator/create_gatorgradle_yml.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
""""Program to automatically generate gatorgrader.yml files in a config directory"""

# import necessary libraries
import os

def create_gatorgrader():
"""creating directory that can have files
that can be read and written to.
"""
# creating directory called config
directory = "config"

os.mkdir(directory)
gatorgrader_config = """
---
# The name of your assignment
name: simple-assignment
# Should a check failure "break" the Gradle run?
break: true
# Should a check failure immediately "break" the Gradle run?
fastfail: false
# What level of indentation does the body of this file use?
indent: 2
# What version of GatorGrader should this assignment use?
version: v1.1.0
---
"""
with open("config/gatorgrader.yml", "w", encoding="utf8") as generate:
generate.write(gatorgrader_config)
generate.close()

print("Let's work on getting your configuration files generated!")
# print("All the necessary configuration files have been created
# and placed into the '% s'" % directory)

#if __name__ == '__main__':
# pass
21 changes: 21 additions & 0 deletions configator/generate_build_gradle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

""""Function to generate a gradlebuild file"""

def create_gradlebuild():
"""
creating a file with gatorgradle version
that can be read and written to
"""

#creating a variable and assigning it to strings for desired output
gradlebuild = """
plugins {
id "org.gatored.gatorgradle" version "0.5.1"
}
"""
#creating a build.gradle file
with open("build.gradle", "w", encoding="utf8") as generate:
#using write function with the variable gradlebuild
generate.write(gradlebuild)

print("Let's work on getting your build.gradle file generated!")
11 changes: 11 additions & 0 deletions configator/generate_readme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Element of the Configator tool to enable default README.md generation"""

print("Generating default README...!")

def create_readme():
""" method to generate README
"""
with open("../README.md", "w", encoding="utf8") as read_me:
read_me.write("This is text.")

create_readme()
10 changes: 0 additions & 10 deletions hello/say_hello.py

This file was deleted.

Binary file added img/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""This file will use all of our functions and run the progam"""

from configator import create_actions_config
from configator import create_gatorgradle_yml
from configator import generate_build_gradle

if __name__ == '__main__':
create_actions_config.create_configator_file()
create_gatorgradle_yml.create_gatorgrader()
generate_build_gradle.create_gradlebuild()
Loading

0 comments on commit dbeff2a

Please sign in to comment.