From e553b25bd8b3caba88f0b132d6748adeca6ca3db Mon Sep 17 00:00:00 2001 From: Renato Alves Date: Fri, 11 Jun 2021 17:49:20 +0200 Subject: [PATCH] Fix pre-commit framework inconsistencies with GA Also lint a few cases that were missed before --- .pre-commit-config.yaml | 7 +++++-- docs/plugins.rst | 16 ++++++++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index edc48283..13cb0f43 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,6 +25,7 @@ repos: rev: 21.5b1 hooks: - id: black + exclude: (.*/)*snapshots/ - repo: https://gitlab.com/pycqa/flake8 # Checks the code for PEP8 violations and common pitfals rev: 3.9.0 @@ -34,16 +35,18 @@ repos: rev: '2020.10.8' hooks: - id: pytype + # Don't run pytype in an isolated venv or it will fail on imports + language: system args: - "-j" - "auto" - - "." - repo: https://github.com/myint/docformatter # Formats docstrings following PEP 257 - rev: v1.3.1 + rev: v1.4 hooks: - id: docformatter args: + - "--in-place" - "--wrap-summaries" - "88" - "--wrap-descriptions" diff --git a/docs/plugins.rst b/docs/plugins.rst index 3dd48c06..b8353b54 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -129,7 +129,7 @@ Restrict messages to specific users Restrict messages to specific channels ----------------------------------- +-------------------------------------- .. code-block:: python @@ -141,11 +141,15 @@ Restrict messages to specific channels Click support ------------- -`mmpy_bot` now supports `click `_ commands, so you can build a robust CLI-like experience if you need it. -The example below registers a `hello_click` command that takes a positional argument, a keyword argument and a toggleable flag, which are automatically converted to the correct type. -For example, it can be called with `hello_click my_argument --keyword-arg=3 -f` and will parse the arguments accordingly. -A nice benefit of `click` commands is that they also automatically generate nicely formatted help strings. -Try sending "help" to the `ExamplePlugin` to see what it looks like! +`mmpy_bot` now supports `click `_ +commands, so you can build a robust CLI-like experience if you need it. The +example below registers a `hello_click` command that takes a positional +argument, a keyword argument and a toggleable flag, which are automatically +converted to the correct type. For example, it can be called with +`hello_click my_argument --keyword-arg=3 -f` and will parse the arguments +accordingly. A nice benefit of `click` commands is that they also +automatically generate nicely formatted help strings. Try sending "help" to +the `ExamplePlugin` to see what it looks like! .. code-block:: python