Skip to content

Commit

Permalink
Initial version release
Browse files Browse the repository at this point in the history
  • Loading branch information
yankeexe committed Sep 29, 2020
0 parents commit f5953bd
Show file tree
Hide file tree
Showing 20 changed files with 1,412 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Good First Issues

on:
push:
branches: [master]
pull_request:
branches: "*"

jobs:
Linter:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Black Lint
run: |
pip install black
black .
140 changes: 140 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Editor specific configs
.vim
.vscode
.idea

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
pytestdebug.log

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/
doc/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repos:
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-byte-order-marker
- id: trailing-whitespace
- id: end-of-file-fixer
44 changes: 44 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## How to contribute to Good First Issues

Thank you for considering contributing to Good First Issues!

### Submitting Updates

Include the following in your patch:

- Use [Black](https://github.com/psf/black) to format your code. This and other tools will run automatically if you install [pre-commit](https://github.com/pre-commit/pre-commit-hooks) using the instructions below.

- Update README.md about new changes if it affects the sub-commands.

- Use [mypy](https://github.com/python/mypy) to check static typing on the codebase.

### First time setup

- Clone the repo locally.

```bash
git clone https://github.com/yankeexe/good-first-issues
```

- Create a virtualenv

```bash
python3 -m venv venv

# activate virtualenv
source venv/bin/activate
```

### Install Good First Issues in editable mode with development dependencies.

```bash
pip install -e .[dev]
```

### Install the pre-commit hooks.

```bash
pre-commit install
```

Start coding 🚀
21 changes: 21 additions & 0 deletions LICENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Yankee Maharjan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
142 changes: 142 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
<p align="center">
<img src="https://i.imgur.com/vTgsBoQ.png" width="100" alt="Known Vulnerabilities"/></a>
</p>

<h1 align="center"><strong> Good First Issues</strong> </h1>
<p align="center"><strong>Find good first issues right from your CLI!</strong></p>

## Install Good First Issues

Requires Python 3.6.1 or higher.

```bash
pip3 install good-first-issues
```

The CLI uses the alias `gfi` to run commands.

![good first issues](https://i.imgur.com/qudPZ0W.png)

## Contents

- [Good First Issues](#good-first-issues)
- [Install Good First Issues](#install-good-first-issues)
- [Create GitHub Personal Access Token:](#create-github-personal-access-token)
- [Usage](#usage)
- [GraphQL (recommended)](#graphql)
- [REST API](#rest-api)
- [Contributing](#contributing)

### Create GitHub Personal Access Token:

The CLI requires GitHub Personal Access Token to make requests to the GitHub API.

> Get [GitHub Personal Access Token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)
You don't have to select any scopes, add a Note for your token and select _Generate token_.

**Provide token to CLI:**

```bash
gfi config
```

Token is stored locally on `/home/<username>/.gfi/good-first-issues` file.

## Usage

GitHub provides API using both REST and GraphQL, each with 5000 requests per hour with the Personal Access Token.

You can switch between these APIs but **using the GraphQL option is faster and efficient!**

There are two ways you can get good first issues:

1. query all the repos in a user or an organization profile.
2. query a particular repo in a user or an organization profile.

### **GraphQL**

To use the GraphQL option use the `gfi gql` command.

**Query all the repos in a user or an organization profile.**

```bash
# Query all repos in an organization
gfi gql "rust-lang"

# Query all repos in a user profile
gfi gql "sindresorhus" --user
```

**Query a particular repo in a user or an organization profile.**

```bash
# Query a single repo in an organization
gfi gql "rust-lang" --repo "rust"

# Query a single repo in a user profile
# No --user flag needed.
gfi gql "sindresorhus" --repo "awesome"
```

**Changing output limits**

The output is limited to display 10 issues by default. Use `--limit` flag to set the number of issues for output or `--all` for no limits.

```bash
# Limit the issues to 20
gfi gql "rust-lang" --limit 20

# View all issues found.
gfi gql "rust-lang" --all

```

**Viewing issues on browser**

It's hard to navigate through all the issues when you have the `--all` flag enabled, you can view the issues on your browser with ease using the `--web` flag.

```bash
gfi gql "rust-lang" --all --web
```

---

### **REST API**

To use the GraphQL option use the `gfi get` command.

**Query all the repos in a user or an organization profile.**

```bash
# Query all repos in an organization
gfi get "rust-lang"

# Query all repos in a user profile
gfi get "sindresorhus"
```

**Changing output limits**

The output is limited to display 10 issues by default. Use `--limit` flag to set the number of issues for output or `--all` for no limits.

```bash
# Limit the issues to 20
gfi get "rust-lang" --limit 20

# View all issues found.
gfi get "rust-lang" --all

```

**Viewing issues on browser**

It's hard to navigate through all the issues when you have the `--all` flag enabled, you can view the issues on your browser with ease using the `--web` flag.

```bash
gfi gql "rust-lang" --all --web
```

## Contributing

For guidance on setting up a development environment and how to make a contribution to Flask, see the [contributing guidelines](https://github.com/yankeexe/good-first-issues/blob/master/CONTRIBUTING.md).
Empty file added gfi/__init__.py
Empty file.
Empty file added gfi/graphql/__init__.py
Empty file.
Loading

0 comments on commit f5953bd

Please sign in to comment.