Skip to content

Commit

Permalink
new version
Browse files Browse the repository at this point in the history
  • Loading branch information
brownsarahm committed Oct 20, 2023
1 parent 2323b28 commit 080fb1a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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**

<!--
### Get the list for use in a bash script
use `kwlfilecheck` to get the list of files from that should be in the kwl repo.
Expand All @@ -66,4 +82,4 @@ Usage: kwlfilecount [OPTIONS]
Options:
- `--practice` flag formore practice related files or not
- `--zone TEXT`
- `--help` Show this message and exit.
- `--help` Show this message and exit. -->
20 changes: 15 additions & 5 deletions badges.py
Original file line number Diff line number Diff line change
@@ -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']
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
repo = 'http://introcompsys.github.io/fall2023/'
base_url = 'https://raw.githubusercontent.com/introcompsys/fall2023/main/_'

gh_approvers = ['brownsarahm','ascott20','marcinpawlukiewicz']

1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
],
},
Expand Down

0 comments on commit 080fb1a

Please sign in to comment.