-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from cmpsc-481-s22-m1/release/0.1.0
Release/0.1.0
- Loading branch information
Showing
18 changed files
with
323 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ jobs: | |
paths: "*.md" | ||
config: .github/cspell.json | ||
|
||
|
||
test: | ||
name: Test | ||
runs-on: ${{ matrix.os }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ __pycache__/ | |
# Temporary files | ||
*~ | ||
*.swp | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Oops, something went wrong.