From 080fb1a88b5582eb4c04d138300d216ba751d745 Mon Sep 17 00:00:00 2001 From: Sarah M Brown Date: Fri, 20 Oct 2023 12:59:17 -0400 Subject: [PATCH] new version --- README.md | 18 +++++++++++++++++- badges.py | 20 +++++++++++++++----- config.py | 2 +- setup.py | 1 + 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c343155..cd54edd 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,12 @@ On Windows, use GitBash for the clone and then Anaconda Prompt for install This is a command line tool. It works in Bash on MacOS and Linux and Anaconda Prompt on Windows. +It will also work in a code space with + +``` + +``` + ### Get tasks to do Get prepare for the most recent date (what's current) @@ -43,6 +49,16 @@ sysgetassignment --date 2022-10-19 --type review (this could be used with the gh CLI to make issues) +## Check badges + +``` +gh pr list -s all --json title,latestReviews > badges.json +sysapprovedbadges badges.json +``` + +**ignore the badges.json file** + + diff --git a/badges.py b/badges.py index 90f5fa9..098a6db 100644 --- a/badges.py +++ b/badges.py @@ -1,9 +1,9 @@ import click from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey from cryptography.exceptions import InvalidSignature -from .config import gh_approvers import json +gh_approvers = ['brownsarahm','ascott20','marcinpawlukiewicz'] badge_types = ['review', 'practice', 'explore', 'experience', 'build', 'lab','community'] @@ -102,12 +102,22 @@ def process_badges(json_output,file_out = None): @click.command() -@click.option('-j','--json-output',default='badges.json',type=click.File('r'), - help='json file to parse') +@click.argument('json-output') @click.option('-f','--file-out',default=None,type=click.File('w'), - help='to write to a file, otherwise will echo') + help='to write to a file, otherwise will use stdout') +def cli_get_approved_titles(json_output,file_out = None): + ''' + list PR titles from json or - to use std in that have been approved by an official approver + + gh pr list -s all --json title,latestReviews + + + ''' + + get_approved_titles(json_output,file_out) + -def get_approved_titles(json_output,file_out = None): +def get_approved_titles(json_output, file_out = None): ''' process gh cli json diff --git a/config.py b/config.py index 9cbdfdb..6bc5270 100644 --- a/config.py +++ b/config.py @@ -2,4 +2,4 @@ repo = 'http://introcompsys.github.io/fall2023/' base_url = 'https://raw.githubusercontent.com/introcompsys/fall2023/main/_' -gh_approvers = ['brownsarahm','ascott20','marcinpawlukiewicz'] + diff --git a/setup.py b/setup.py index 7b59b59..772263e 100644 --- a/setup.py +++ b/setup.py @@ -18,6 +18,7 @@ 'kwlcsv = sitetools:kwl_csv', 'verifybadge = badges:verify_badge', 'verifyjson = badges:process_badges', + 'sysapprovedbadges = badges:cli_get_approved_titles', 'cleandate = tasktracking:parse_date' ], },