diff options
author | 2020-11-10 22:08:26 +0100 | |
---|---|---|
committer | 2020-11-10 22:08:26 +0100 | |
commit | 13cb238ba89097a726b2b6f580e55be0b2215ad3 (patch) | |
tree | c1499e4158db1e12805771c63adae814945f1e6f | |
parent | Voice Gate: explain the purpose of `NO_MSG` (diff) | |
parent | Merge pull request #1273 from python-discord/sebastiaan/bugs/codeblock-langua... (diff) |
Merge CI changes from 'master' branch
-rw-r--r-- | azure-pipelines.yml | 3 | ||||
-rw-r--r-- | bot/exts/info/codeblock/_instructions.py | 4 | ||||
-rw-r--r-- | bot/exts/info/codeblock/_parsing.py | 4 | ||||
-rw-r--r-- | bot/resources/tags/guilds.md | 3 |
4 files changed, 9 insertions, 5 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4500cb6e8..9f58e38c8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,7 +21,6 @@ jobs: BOT_TOKEN: bar REDDIT_CLIENT_ID: spam REDDIT_SECRET: ham - WOLFRAM_API_KEY: baz REDIS_PASSWORD: '' steps: @@ -38,6 +37,7 @@ jobs: key: python | $(Agent.OS) | "$(python.pythonLocation)" | 0 | ./Pipfile | ./Pipfile.lock cacheHitVar: PY_ENV_RESTORED path: $(PYTHONUSERBASE) + continueOnError: true - script: echo '##vso[task.prependpath]$(PYTHONUSERBASE)/bin' displayName: 'Prepend PATH' @@ -65,6 +65,7 @@ jobs: inputs: key: pre-commit | "$(python.pythonLocation)" | 0 | .pre-commit-config.yaml path: $(PRE_COMMIT_HOME) + continueOnError: true # pre-commit's venv doesn't allow user installs - not that they're really needed anyway. - script: export PIP_USER=0; pre-commit run --all-files diff --git a/bot/exts/info/codeblock/_instructions.py b/bot/exts/info/codeblock/_instructions.py index 508f157fb..dadb5e1ef 100644 --- a/bot/exts/info/codeblock/_instructions.py +++ b/bot/exts/info/codeblock/_instructions.py @@ -71,7 +71,7 @@ def _get_no_ticks_message(content: str) -> Optional[str]: log.trace("Creating instructions for a missing code block.") if _parsing.is_python_code(content): - example_blocks = _get_example("python") + example_blocks = _get_example("py") return ( "It looks like you're trying to paste code into this channel.\n\n" "Discord has support for Markdown, which allows you to post code with full " @@ -133,7 +133,7 @@ def _get_no_lang_message(content: str) -> Optional[str]: log.trace("Creating instructions for a missing language.") if _parsing.is_python_code(content): - example_blocks = _get_example("python") + example_blocks = _get_example("py") # Note that _get_bad_ticks_message expects the first line to have two newlines. return ( diff --git a/bot/exts/info/codeblock/_parsing.py b/bot/exts/info/codeblock/_parsing.py index a98218dfb..e35fbca22 100644 --- a/bot/exts/info/codeblock/_parsing.py +++ b/bot/exts/info/codeblock/_parsing.py @@ -12,7 +12,7 @@ from bot.utils import has_lines log = logging.getLogger(__name__) BACKTICK = "`" -PY_LANG_CODES = ("python", "pycon", "py") # Order is important; "py" is last cause it's a subset. +PY_LANG_CODES = ("python-repl", "python", "pycon", "py") # Order is important; "py" is last cause it's a subset. _TICKS = { BACKTICK, "'", @@ -36,7 +36,7 @@ _RE_CODE_BLOCK = re.compile( (?P<tick>[{''.join(_TICKS)}]) # Put all ticks into a character class within a group. \2{{2}} # Match previous group 2 more times to ensure the same char. ) - (?P<lang>[^\W_]+\n)? # Optionally match a language specifier followed by a newline. + (?P<lang>[A-Za-z0-9\+\-\.]+\n)? # Optionally match a language specifier followed by a newline. (?P<code>.+?) # Match the actual code within the block. \1 # Match the same 3 ticks used at the start of the block. """, diff --git a/bot/resources/tags/guilds.md b/bot/resources/tags/guilds.md new file mode 100644 index 000000000..571abb99b --- /dev/null +++ b/bot/resources/tags/guilds.md @@ -0,0 +1,3 @@ +**Communities** + +The [communities page](https://pythondiscord.com/pages/resources/communities/) on our website contains a number of communities we have partnered with as well as a [curated list](https://github.com/mhxion/awesome-discord-communities) of other communities relating to programming and technology. |