Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DenverCoder1 authored Jul 3, 2022
1 parent f3f819a commit ae0ff31
Show file tree
Hide file tree
Showing 29 changed files with 1,408 additions and 1 deletion.
53 changes: 53 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Contributing to nextcord-ext-help-commands

First off, thanks for taking the time to contribute. It makes the library substantially better. :+1:

The following is a set of guidelines for contributing to the repository. These are guidelines, not hard rules.

## This is too much to read! I want to ask a question

Generally speaking questions are better suited in our resources below.

- The official support server: <https://discord.gg/ZebatWssCB>
- The Discord API server under #python_discord-py: <https://discord.gg/discord-api>
- [The FAQ in the documentation](https://nextcord.readthedocs.io/en/latest/faq.html)
- [StackOverflow's `nextcord` tag](https://stackoverflow.com/questions/tagged/nextcord)
- [StackOverflow's `discord.py` tag](https://stackoverflow.com/questions/tagged/discord.py)
- [The discussions page](https://github.com/nextcord/nextcord/discussions)

Please try your best not to ask questions in our issue tracker. Most of them don't belong there unless they provide value to a larger audience.

## Good Bug Reports

Please be aware of the following things when filing bug reports.

1. Don't open duplicate issues. Please search your issue to see if it has been asked already. Duplicate issues will be closed.
2. When filing a bug about exceptions or tracebacks, please include the *complete* traceback. Without the complete traceback the issue might be **unsolvable** and you will be asked to provide more information.
3. Make sure to provide enough information to make the issue workable. The issue template will generally walk you through the process but they are enumerated here as well:
- A **summary** of your bug report. This is generally a quick sentence or two to describe the issue in human terms.
- Guidance on **how to reproduce the issue**. Ideally, this should have a small code sample that allows us to run and see the issue for ourselves to debug. **Please make sure that the token is not displayed**. If you cannot provide a code snippet, then let us know what the steps were, how often it happens, etc.
- Tell us **what you expected to happen**. That way we can meet that expectation.
- Tell us **what actually happens**. What ends up happening in reality? It's not helpful to say "it fails" or "it doesn't work". Say *how* it failed, do you get an exception? Does it hang? How are the expectations different from reality?
- Tell us **information about your environment**. What version of nextcord and nextcord-ext-help-commands are you using? How was it installed? What operating system are you running on? These are valuable questions and information that we use.

If the bug report is missing this information then it'll take us longer to fix the issue. We will probably ask for clarification, and barring that if no response was given then the issue will be closed.

## Submitting a Pull Request

Submitting a pull request is fairly simple, just make sure it focuses on a single aspect and doesn't manage to have scope creep and it's probably good to go. It would be incredibly lovely if the style is consistent to that found in the project. This project follows PEP-8 guidelines (mostly) with a column limit of 100. `black` will use the `pyproject.toml` located in the root of the project to determine the style settings.

It would be nice if the code is formatted with no type-checking issues before submitting a PR. To make sure, install the tools using `pip install -r requirements-dev.txt` (or poetry etc), and follow these steps:

- To format the code, run `pre-commit run` once your files are staged, or `task lint` to fix all files.
Alternatively, run `task precommit` to install hooks to run all checks when you commit (see the [pre-commit docs](https://pre-commit.com/#quick-start)).
**Note:** If the code is formatted incorrectly, `pre-commit` will fix and exit without committing - just stage and commit again.
- For type-checks, run `task pyright` (or `task pyright -w` to check every file edit)
**Note:** If you're using VSCode and pylance, it will use the same settings, which generally means that you don't have to run pyright. However, there can be version conflicts which may give different results when ran in CI on GitHub.

### Git Commit Guidelines

- Use present tense (e.g. "Add feature" not "Added feature")
- Limit all lines to 72 characters or less.
- When linking issues/prs please use the shorthand `#123` and not the full URL.

If you do not meet any of these guidelines, don't fret. Chances are they will be fixed upon rebasing but please do try to meet them to remove some of the workload.
79 changes: 79 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Bug Report
description: Report broken or incorrect behaviour
labels: ["t: unconfirmed bug"]
body:
- type: markdown
attributes:
value: >
Thanks for taking the time to fill out a bug.
If you want real-time support, consider joining our Discord at https://discord.gg/ZebatWssCB instead.
Please note that this form is for bugs only!
- type: input
attributes:
label: Summary
description: A simple summary of your bug report
validations:
required: true
- type: textarea
attributes:
label: Reproduction Steps
description: >
What you did to make it happen.
validations:
required: true
- type: textarea
attributes:
label: Minimal Reproducible Code
description: >
A short snippet of code that showcases the bug.
render: Python
- type: textarea
attributes:
label: Expected Results
description: >
What did you expect to happen?
validations:
required: true
- type: textarea
attributes:
label: Actual Results
description: >
What actually happened?
validations:
required: true
- type: input
attributes:
label: Intents
description: >
What intents are you using for your bot?
This is the `nextcord.Intents` class you pass to the client.
validations:
required: true
- type: textarea
attributes:
label: System Information
description: >
Include your version of nextcord-ext-help-commands (run `pip show nextcord-ext-help-commands`).
If using pagination also include your nextcord-ext-menus version.
Additionally, run `python -m nextcord -v` and paste this information below.
This command required v1.1.0 or higher of the library. If this errors out then show some basic
information involving your system such as operating system and Python version.
validations:
required: true
- type: checkboxes
attributes:
label: Checklist
description: >
Let's make sure you've properly done due dilligence when reporting this issue!
options:
- label: I have searched the open issues for duplicates.
required: true
- label: I have shown the entire traceback, if possible.
required: true
- label: I have removed my token from display, if visible.
required: true
- type: textarea
attributes:
label: Additional Context
description: If there is anything else to say, please do so here.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Ask a question
about: Ask questions and discuss with other users of the library.
url: https://github.com/nextcord/nextcord/discussions
- name: Discord Server
about: Use our official Discord server to ask for help and questions as well.
url: https://discord.gg/ZebatWssCB
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Feature Request
description: Suggest a feature for this library
labels: ["feature request"]
body:
- type: input
attributes:
label: Summary
description: >
A short summary of what your feature request is.
validations:
required: true
- type: dropdown
attributes:
multiple: false
label: What is the feature request for?
options:
- nextcord.ext.help_commands
- The documentation
validations:
required: true
- type: textarea
attributes:
label: Additional Context
description: >
What is the problem and your ideal solution to the problem?
What would you like this feature to do?
validations:
required: true
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Summary

<!-- What is this pull request for? Does it fix any issues? -->

## Checklist

<!-- Put an x inside [ ] to check it, like so: [x] -->

- [ ] If code changes were made then they have been tested.
- [ ] I have updated the documentation to reflect the changes.
- [ ] I have run `task pyright` and fixed the relevant issues.
- [ ] This PR fixes an issue.
- [ ] This PR adds something new (e.g. new method or parameters).
- [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)
- [ ] This PR is **not** a code change (e.g. documentation, README, ...)
103 changes: 103 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: lint

on:
push:
branches:
- master
pull_request:

jobs:
pre-commit:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: pip
cache-dependency-path: |
requirements.txt
requirements-dev.txt
setup.py
- name: Install dependencies
run: python -m pip install -r requirements-dev.txt

- name: Run pre-commit
uses: pre-commit/[email protected]

pyright:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
requirements.txt
requirements-dev.txt
setup.py
# all extras are installed to test
- name: Install dependencies
run: python -m pip install -r requirements-dev.txt .[voice,docs,speed]

- name: Set up pyright
run: echo "PYRIGHT_VERSION=$(python -c 'import pyright; print(pyright.__pyright_version__)')" >> $GITHUB_ENV

- name: Run pyright (Linux)
uses: jakebailey/[email protected]
with:
version: ${{ env.PYRIGHT_VERSION }}
python-version: ${{ matrix.python-version }}
python-platform: Linux
# only add comments for 3.8
no-comments: ${{ matrix.python-version != '3.8' }}
warnings: true

- name: Run pyright (Windows)
uses: jakebailey/[email protected]
# run anyway
if: success() || failure()
with:
version: ${{ env.PYRIGHT_VERSION }}
python-version: ${{ matrix.python-version }}
python-platform: Windows
# only add comments for one platform
no-comments: true
warnings: true

slotscheck:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: pip
cache-dependency-path: |
requirements-dev.txt
requirements.txt
setup.py
- name: Install dependencies
run: python -m pip install -r requirements.txt -r requirements-dev.txt

- name: Run slotscheck
run: task slotscheck
37 changes: 37 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]
workflow_dispatch:

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/test-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test docs

on:
push:
branches:
- master
pull_request:

jobs:
docs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade --upgrade-strategy eager --no-cache-dir .[docs] --upgrade .[menus]
- name: Build docs
run: make -C docs html
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
__pycache__/

*.egg-info/
build/
dist/
_build

.vscode/

.venv
Loading

0 comments on commit ae0ff31

Please sign in to comment.