From 99285baf1a5bd6da4ba1ec115e01635fe1ab3574 Mon Sep 17 00:00:00 2001 From: IAmTomahawkx Date: Tue, 21 Sep 2021 12:18:02 -0700 Subject: [PATCH 1/5] modify workflows to fit into one file, fix pyright workflow --- .github/workflows/black.yml | 25 ------------------------- .github/workflows/ci.yml | 23 ++++++++++++++++++++++- 2 files changed, 22 insertions(+), 26 deletions(-) delete mode 100644 .github/workflows/black.yml diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml deleted file mode 100644 index b95fb1dd..00000000 --- a/.github/workflows/black.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Lint - -on: [push] - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v2 - - - name: Setup Python - uses: actions/setup-python@v1 - with: - python-version: 3.8 - - - name: install black - run: pip install black - - - name: run linter - uses: wearerequired/lint-action@v1 - with: - black: true - black_args: ". --line-length 120" - auto_fix: true \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4dd5c56..1991b5c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI on: [push, pull_request] jobs: - lint: + pyright: runs-on: ubuntu-latest steps: - name: checkout @@ -23,4 +23,25 @@ jobs: run: | npm install -g pyright pip install -r requirements.txt + pip install . pyright --lib --verifytypes discord --ignoreexternal + + black: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v2 + + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: 3.8 + + - name: install black + run: pip install black + + - name: run linter + uses: wearerequired/lint-action@v1 + with: + black: true + black_args: ". --line-length 120" \ No newline at end of file -- 2.47.2 From 02c6b078340541023bc23c15a76f29bfd2363666 Mon Sep 17 00:00:00 2001 From: Gnome! <45660393+Gnome-py@users.noreply.github.com> Date: Tue, 21 Sep 2021 22:34:54 +0100 Subject: [PATCH 2/5] Merge pull request #72 * Fix command checks actually working --- discord/ext/commands/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 5947dc19..5d48eb8f 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -399,9 +399,9 @@ class Command(_BaseCommand, Generic[CogT, P, T]): command_attrs = {} try: - checks = command_attrs.pop("checks") + checks = func.__commands_checks__ checks.reverse() - except KeyError: + except AttributeError: checks = kwargs.get("checks", []) try: -- 2.47.2 From fc39fb352ecf2316e2a207944d8ed59643c3bb3e Mon Sep 17 00:00:00 2001 From: IAmTomahawkx Date: Tue, 21 Sep 2021 14:35:13 -0700 Subject: [PATCH 3/5] remove redundant pip install --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1991b5c3..39e215dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,6 @@ jobs: - name: Run type checking run: | npm install -g pyright - pip install -r requirements.txt pip install . pyright --lib --verifytypes discord --ignoreexternal -- 2.47.2 From 7a879600b412239f5086ea7f342bd86b44e9d2ab Mon Sep 17 00:00:00 2001 From: IAmTomahawkx Date: Tue, 21 Sep 2021 14:40:15 -0700 Subject: [PATCH 4/5] add check flag to black --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39e215dd..30d23160 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,4 +43,4 @@ jobs: uses: wearerequired/lint-action@v1 with: black: true - black_args: ". --line-length 120" \ No newline at end of file + black_args: ". --line-length 120 --check" \ No newline at end of file -- 2.47.2 From fe0ed5a568ca2457115e8c074bff54ca437f5d2d Mon Sep 17 00:00:00 2001 From: IAmTomahawkx Date: Tue, 21 Sep 2021 14:48:32 -0700 Subject: [PATCH 5/5] use psf/black for black checker --- .github/workflows/ci.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30d23160..27a7e1d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,19 +28,11 @@ jobs: black: runs-on: ubuntu-latest steps: - - name: checkout + - name: Checkout uses: actions/checkout@v2 - - name: Setup Python - uses: actions/setup-python@v1 + - name: Run linter + uses: psf/black@stable with: - python-version: 3.8 - - - name: install black - run: pip install black - - - name: run linter - uses: wearerequired/lint-action@v1 - with: - black: true - black_args: ". --line-length 120 --check" \ No newline at end of file + options: "--line-length 120 --check" + src: "./discord" \ No newline at end of file -- 2.47.2