Skip to content

Commit 948b52e

Browse files
committed
Repo wide file-reformat
1 parent a90e5c1 commit 948b52e

27 files changed

+109
-102
lines changed

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ "main" ]
16+
branches: ["main"]
1717
pull_request:
18-
branches: [ "main" ]
18+
branches: ["main"]
1919
schedule:
20-
- cron: '35 22 * * 5'
20+
- cron: '35 22 * * 5'
2121

2222
jobs:
2323
analyze:
@@ -40,7 +40,7 @@ jobs:
4040
strategy:
4141
fail-fast: false
4242
matrix:
43-
language: [ 'python' ]
43+
language: ['python']
4444
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
4545
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
4646
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ ci:
22
skip:
33
- pylint
44
- mypy
5+
exclude: ^\.vscode/.*$
56
repos:
67
- repo: https://github.com/pre-commit/pre-commit-hooks
78
rev: c4a0b883114b00d8d76b479c820ce7950211c99b # frozen: v4.5.0

cloudbot/plugin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ def __init__(self, bot):
8585
self.bot = bot
8686

8787
self.plugins: Dict[str, Plugin] = {}
88-
self._plugin_name_map: MutableMapping[
89-
str, Plugin
90-
] = WeakValueDictionary()
88+
self._plugin_name_map: MutableMapping[str, Plugin] = (
89+
WeakValueDictionary()
90+
)
9191
self.commands: Dict[str, CommandHook] = {}
9292
self.raw_triggers: Dict[str, List[RawHook]] = defaultdict(list)
9393
self.catch_all_triggers: List[RawHook] = []

cloudbot/util/database.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
database - contains variables set by cloudbot to be easily access
33
"""
4+
45
from sqlalchemy import MetaData
56
from sqlalchemy.engine import Engine
67
from sqlalchemy.ext.declarative import declarative_base

cloudbot/util/filesize.py

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -53,48 +53,48 @@
5353
"""
5454

5555
traditional = (
56-
(1024 ** 5, "P"),
57-
(1024 ** 4, "T"),
58-
(1024 ** 3, "G"),
59-
(1024 ** 2, "M"),
60-
(1024 ** 1, "K"),
61-
(1024 ** 0, "B"),
56+
(1024**5, "P"),
57+
(1024**4, "T"),
58+
(1024**3, "G"),
59+
(1024**2, "M"),
60+
(1024**1, "K"),
61+
(1024**0, "B"),
6262
)
6363

6464
alternative = (
65-
(1024 ** 5, " PB"),
66-
(1024 ** 4, " TB"),
67-
(1024 ** 3, " GB"),
68-
(1024 ** 2, " MB"),
69-
(1024 ** 1, " KB"),
70-
(1024 ** 0, (" byte", " bytes")),
65+
(1024**5, " PB"),
66+
(1024**4, " TB"),
67+
(1024**3, " GB"),
68+
(1024**2, " MB"),
69+
(1024**1, " KB"),
70+
(1024**0, (" byte", " bytes")),
7171
)
7272

7373
verbose = (
74-
(1024 ** 5, (" petabyte", " petabytes")),
75-
(1024 ** 4, (" terabyte", " terabytes")),
76-
(1024 ** 3, (" gigabyte", " gigabytes")),
77-
(1024 ** 2, (" megabyte", " megabytes")),
78-
(1024 ** 1, (" kilobyte", " kilobytes")),
79-
(1024 ** 0, (" byte", " bytes")),
74+
(1024**5, (" petabyte", " petabytes")),
75+
(1024**4, (" terabyte", " terabytes")),
76+
(1024**3, (" gigabyte", " gigabytes")),
77+
(1024**2, (" megabyte", " megabytes")),
78+
(1024**1, (" kilobyte", " kilobytes")),
79+
(1024**0, (" byte", " bytes")),
8080
)
8181

8282
iec = (
83-
(1024 ** 5, "Pi"),
84-
(1024 ** 4, "Ti"),
85-
(1024 ** 3, "Gi"),
86-
(1024 ** 2, "Mi"),
87-
(1024 ** 1, "Ki"),
88-
(1024 ** 0, ""),
83+
(1024**5, "Pi"),
84+
(1024**4, "Ti"),
85+
(1024**3, "Gi"),
86+
(1024**2, "Mi"),
87+
(1024**1, "Ki"),
88+
(1024**0, ""),
8989
)
9090

9191
si = (
92-
(1000 ** 5, "P"),
93-
(1000 ** 4, "T"),
94-
(1000 ** 3, "G"),
95-
(1000 ** 2, "M"),
96-
(1000 ** 1, "K"),
97-
(1000 ** 0, "B"),
92+
(1000**5, "P"),
93+
(1000**4, "T"),
94+
(1000**3, "G"),
95+
(1000**2, "M"),
96+
(1000**1, "K"),
97+
(1000**0, "B"),
9898
)
9999

100100
# re.I style aliases

cloudbot/util/formatting.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
4545
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4646
"""
47+
4748
import copy
4849
import re
4950
import warnings

cloudbot/util/mapping.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,26 @@
1919
from typing import Protocol
2020

2121
class MapBase(Protocol[K_contra, V]):
22-
def __getitem__(self, item: K_contra) -> V:
23-
...
22+
def __getitem__(self, item: K_contra) -> V: ...
2423

25-
def __delitem__(self, item: K_contra) -> None:
26-
...
24+
def __delitem__(self, item: K_contra) -> None: ...
2725

28-
def __setitem__(self, item: K_contra, value: V) -> None:
29-
...
26+
def __setitem__(self, item: K_contra, value: V) -> None: ...
3027

31-
def get(self, item: K_contra, default: V = None) -> Optional[V]:
32-
...
28+
def get(self, item: K_contra, default: V = None) -> Optional[V]: ...
3329

3430
def setdefault(
3531
self, key: K_contra, default: Union[V, T] = None
36-
) -> Union[V, T]:
37-
...
32+
) -> Union[V, T]: ...
3833

3934
def pop(
4035
self, key: K_contra, default: Union[V, T] = None
41-
) -> Union[V, T]:
42-
...
36+
) -> Union[V, T]: ...
4337

4438
else:
4539

4640
class MapBase(Generic[K_contra, V]):
47-
...
41+
pass
4842

4943

5044
class KeyFoldMixin(MapBase[K_contra, V]):

cloudbot/util/web.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ class Isgd(Shortener):
224224
def shorten(self, url, custom=None, key=None):
225225
p = {"url": url, "format": "json"}
226226
if custom:
227-
p['shorturl'] = custom
227+
p["shorturl"] = custom
228228

229229
try:
230230
r = requests.get("https://is.gd/create.php", params=p)

docs/user/openweathermap.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
The weather.py plugin uses the OpenWeatherMap OneCall 3.0 API.
33

44
Once you have an OpenWeatherMap API account, simply insert the API key in the config.json under api_keys -> openweathermap.
5-

plugins/animal_gifs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
All GIFs courtesy of http://bestanimations.com/
33
"""
4+
45
import random
56
from urllib.parse import urljoin
67

0 commit comments

Comments
 (0)