Merge branch 'V3/develop' into cog_guide_core

This commit is contained in:
bobloy
2021-03-24 16:06:19 -04:00
15 changed files with 173 additions and 76 deletions

View File

@@ -476,11 +476,20 @@ class Repo(RepoJSONMixin):
if p.returncode != 0:
stderr = p.stderr.decode(**DECODE_PARAMS).strip()
ambiguous_error = f"error: short SHA1 {rev} is ambiguous\nhint: The candidates are:\n"
if not stderr.startswith(ambiguous_error):
ambiguous_errors = (
# Git 2.31.0-rc0 and newer
f"error: short object ID {rev} is ambiguous\nhint: The candidates are:\n",
# Git 2.11.0-rc0 and newer
f"error: short SHA1 {rev} is ambiguous\nhint: The candidates are:\n",
)
for substring in ambiguous_errors:
if stderr.startswith(substring):
pos = len(substring)
break
else:
raise errors.UnknownRevision(f"Revision {rev} cannot be found.", git_command)
candidates = []
for match in self.AMBIGUOUS_ERROR_REGEX.finditer(stderr, len(ambiguous_error)):
for match in self.AMBIGUOUS_ERROR_REGEX.finditer(stderr, pos):
candidates.append(Candidate(match["rev"], match["type"], match["desc"]))
if candidates:
raise errors.AmbiguousRevision(

View File

@@ -1,2 +0,0 @@
*
!.gitignore

View File

@@ -451,7 +451,7 @@ class Economy(commands.Cog):
await bank.set_balance(author, exc.max_balance)
await ctx.send(
_(
"You've reached the maximum amount of {currency}!"
"You've reached the maximum amount of {currency}! "
"Please spend some more \N{GRIMACING FACE}\n\n"
"You currently have {new_balance} {currency}."
).format(

View File

@@ -236,12 +236,12 @@ class Reports(commands.Cog):
)
return ticket_number
@commands.group(name="report", invoke_without_command=True)
@commands.group(name="report", usage="[text]", invoke_without_command=True)
async def report(self, ctx: commands.Context, *, _report: str = ""):
"""Send a report.
Use without arguments for interactive reporting, or do
`[p]report <text>` to use it non-interactively.
`[p]report [text]` to use it non-interactively.
"""
author = ctx.author
guild = ctx.guild

View File

@@ -1803,9 +1803,6 @@ Which fan-favorite Pittsburgh Penguin was selected by the Las Vegas Golden Knigh
After this Pittsburgh Penguins coach was fired mid-season, Mike Sullivan took the spot and went on to win a Stanley Cup the very same year. Who is the coach that was fired?:
- Mike Johnston
- Johnston
After this Pittsburgh Penguins coach was fired mid-season, Mike Sullivan took the spot and went on to win a Stanley Cup the very same year. Who is the coach that was fired?:
- Mike Johnston
- Johnston
Which Pittsburgh Penguin was the subject of media ridicule after filling the Stanley Cup with hot dogs?:
- Phil Kessel
- Kessel
@@ -1935,12 +1932,6 @@ Which team did Bobby Orr end his career with?:
- Blackhawks
- Black Hawks
- Chicago
Which team did Bobby Orr end his career with?:
- Chicago
- Chicago Black Hawks
- Chicago Blackhawks
- Blackhawks
- Black Hawks
# Blackhawks Trivia by Windy City Hawkey#7814
Who was the Captain of the 1934 Stanley Cup Champion Blackhawks?:
- Charlie Gardiner
@@ -2112,23 +2103,6 @@ What team hosted the 2019 NHL Entry Draft?:
- Vancouver Canucks
- Vancouver
- Canucks
Who was the first player in NHL history to score 100 points in a single season, when he scored 126 total points?:
- Phil Esposito
- Esposito
Who had their Detroit Red Wing number 12 retired in 1995?:
- Sidney Abel
- Sid Abel
- Abel
Which player was the first in NHL to score a full-strength, power play, short-handed, penalty shot, and open net goal in the same game?:
- Mario Lemieux
- Lemieux
Which NHL player has played in the most regular season wins during his career?:
- Scott Stevens
- Stevens
Which player was the first to win more than two individual trophies in one season?:
- Stan Mikita won the Art Ross trophy, Lady Byng trophy, and Hart trophy two years in a row with the Chicago Blackhawks in 1966-67 and 1967-68.
- Stan Mikita
- Mikita
What undrafted goalie has the most games played?:
- Ed Belfour (963)
- Ed Belfour
@@ -2325,22 +2299,6 @@ Who is the Boston Bruins all time hat trick leader?:
Who did the Bruins trade to the Toronto Maple Leafs for the rights of goalie prospect Tuukka Rask?:
- Andrew Raycroft
- Raycroft
# Blackhawks Trivia by The_Notorious_BEN#0475
When did the Blackhawks first reach the Stanley Cup Final?:
- 1931
Who did the Blackhawks play in their first Stanley Cup Final?:
- Montréal Canadiens
- Montreal Canadiens
- Canadiens
- Montreal
- Montréal
- habs
Who did the Blackhawks defeat by a score of 4-1 in their first-ever game on November 17, 1926 at Chicago Coliseum?:
- Toronto St. Patricks
- Toronto St. Pats
- Toronto
- St. Patricks
- St. Pats
# Toronto Maple Leafs Trivia by Pikaboo#2147
What goaltender holds the record for wins by a Maple Leafs draftee?:
- Tukka Rask

View File

@@ -10,6 +10,7 @@ from redbot.cogs.downloader.repo_manager import RepoManager, Repo, ProcessFormat
from redbot.cogs.downloader.installable import Installable, InstalledModule
__all__ = [
"GIT_VERSION",
"repo_manager",
"repo",
"bot_repo",
@@ -27,6 +28,17 @@ __all__ = [
]
def _get_git_version():
"""Returns version tuple in format: (major, minor)"""
raw_version = sp.check_output(("git", "version"), text=True)[12:]
# we're only interested in major and minor version if we will ever need micro
# there's more handling needed for versions like `2.25.0-rc1` and `2.25.0.windows.1`
return tuple(int(n) for n in raw_version.split(".", maxsplit=3)[:2])
GIT_VERSION = _get_git_version()
async def fake_run_noprint(*args, **kwargs):
fake_result_tuple = namedtuple("fake_result", "returncode result")
res = fake_result_tuple(0, (args, kwargs))
@@ -139,6 +151,7 @@ def _init_test_repo(destination: Path):
git_dirparams = ("git", "-C", str(destination))
init_commands = (
(*git_dirparams, "init"),
(*git_dirparams, "checkout", "-b", "master"),
(*git_dirparams, "config", "--local", "user.name", "Cog-Creators"),
(*git_dirparams, "config", "--local", "user.email", "cog-creators@example.org"),
(*git_dirparams, "config", "--local", "commit.gpgSign", "false"),