instance_id
stringlengths
10
65
repo
stringlengths
5
59
pr_number
int64
1
313k
task_type
stringclasses
1 value
base_commit
stringlengths
40
40
review_commit
stringlengths
40
40
title
stringlengths
2
282
body
stringlengths
7
3k
patch
stringlengths
202
204k
n_defects
int64
1
72
n_supported
int64
1
65
n_major
int64
0
32
defects
stringlengths
140
18.8k
certifier_count
int64
soot-oss__soot__1081
soot-oss/soot
1,081
defect
117f6dbfecc1cbd570d9df8c217971697b17cf66
e0bf896b98b8138341841ba3aea2ecf1e1926370
jbco improvements
MethodRenamer --- This transformer was handling _indirect_ inheritance partially: transformer was not able to find interfaces that were extending interfaces from library classes (it is interface A in javadoc example). FieldRenamer --- I hid new name generation algorithm and removed storage of renamed fields. Sin...
diff --git a/src/main/generated/singletons/soot/Singletons.java b/src/main/generated/singletons/soot/Singletons.java index 3d349622eef..171f2fc7cf7 100644 --- a/src/main/generated/singletons/soot/Singletons.java +++ b/src/main/generated/singletons/soot/Singletons.java @@ -25,7 +25,7 @@ /* THIS FILE IS AUTOMATICALLY GE...
1
1
0
[{"id": "G0", "claim": "Remove the commented-out `// runBodyPacks(c);` line left next to the new executor.execute call in runBodyPacks.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
soot-oss__soot__1109
soot-oss/soot
1,109
defect
be5ef559904723b16745fe7ca8ecbaf239e00aa7
679a02c32ef8e440abcb01ff2880ddb0d2d887bb
Fix/methodhandle polymoprhic dispatch as stated in issue #1108
@mbenz89 The current PR just contains test cases to check if the polymorphic methods in `java.lang.invoke.MethodHandle`are treated correctly. What about the check `jimpleBody.validate()` in the `BafBody` class that was removed in PR https://github.com/Sable/soot/pull/1092? Due to this missing check this error was s...
diff --git a/src/systemTest/java/soot/jimple/PolymorphicDispatchTest.java b/src/systemTest/java/soot/jimple/PolymorphicDispatchTest.java new file mode 100644 index 00000000000..94e275757ea --- /dev/null +++ b/src/systemTest/java/soot/jimple/PolymorphicDispatchTest.java @@ -0,0 +1,70 @@ +package soot.jimple; + +/*- + * ...
5
5
2
[{"id": "G0", "claim": "The 'could not find target method' assertion should be placed inside prepareTarget so the user learns about a possibly missing 'mvn test-compile' run or a misspelled target method.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "T...
null
soot-oss__soot__1520
soot-oss/soot
1,520
defect
63c8504fe310447d61903a4dac24e04ebc29a31e
151d6c2fb52e70033f3e777b20409450b8f6cfb9
Update SootMethodRef classes
- formatting and cleanup - caching of the resolved SootMethod in SootMethodRefImpl because it can be an expensive operation
diff --git a/src/main/java/soot/PolymorphicMethodRef.java b/src/main/java/soot/PolymorphicMethodRef.java index a9a36a64b9e..c301ea0b9a8 100644 --- a/src/main/java/soot/PolymorphicMethodRef.java +++ b/src/main/java/soot/PolymorphicMethodRef.java @@ -39,11 +39,11 @@ */ public class PolymorphicMethodRef extends SootMet...
2
1
0
[{"id": "G0", "claim": "The removal of isStatic() from the SootMethodRef interface may have been unintentional and should be confirmed as deliberate.", "category": "correctness", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Including the SubSignature in hashCode is redundant be...
null
soot-oss__soot__2077
soot-oss/soot
2,077
defect
7e7ac53f62541f8359e388bfc51e40359042854f
d07977d5648abdba2edaf927eb94fc3112effca2
IOException happens during writing to jar
Rolled back try-with resourses block, replaced with simple write https://github.com/soot-oss/soot/issues/1881
diff --git a/src/main/java/soot/toDex/DexPrinter.java b/src/main/java/soot/toDex/DexPrinter.java index e33455fd439..06d412ee76b 100644 --- a/src/main/java/soot/toDex/DexPrinter.java +++ b/src/main/java/soot/toDex/DexPrinter.java @@ -10,12 +10,12 @@ * it under the terms of the GNU Lesser General Public License as * ...
1
1
1
[{"id": "G0", "claim": "In addManifest, writing the manifest through a throwaway BufferedOutputStream without try-with-resources, flush or close means there is a chance the manifest data stays in the buffer and is never (completely) flushed to destination, since closeEntry neither flushes nor closes the wrapper stream;...
null
soot-oss__soot__2255
soot-oss/soot
2,255
defect
81bce3b7efdf0b274596abac335a898ff5b78d61
c6f9ebd5910fa83ea44c9e4c7bb0284073736492
Fix shimple issues with traps
Contains and fixes all test cases in https://github.com/soot-oss/soot/pull/1680 Also incorporates the test cases in https://github.com/soot-oss/soot/pull/1662 Fixes https://github.com/soot-oss/soot/issues/1678
diff --git a/pom.xml b/pom.xml index 10143b6185d4..c66d64fe2486 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ <checkstyle.failOnViolation>true</checkstyle.failOnViolation> <licence-check.failOnMissingHeader>true</licence-check.failOnMissingHeader> <testcase.groups.excluded>categories.J...
4
3
0
[{"id": "G0", "claim": "Fix the typo \"thje\" in the new comment about references from the previous iteration.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Fix the typo \"destory\" in the new comment about not moving the definition back.", "cate...
null
soot-oss__soot__2259
soot-oss/soot
2,259
defect
494270b3a011749a242ff23361030e65175c366c
3a84d919bdedb3bdcd6f9a949ce3367b6e8bc70d
SharedInitializationLocalSplitter: Do not always split
Fixes https://github.com/soot-oss/soot/issues/2045
diff --git a/src/main/java/soot/asm/AsmMethodSource.java b/src/main/java/soot/asm/AsmMethodSource.java index fe4f7d4759e..be0461c0e30 100644 --- a/src/main/java/soot/asm/AsmMethodSource.java +++ b/src/main/java/soot/asm/AsmMethodSource.java @@ -420,8 +420,15 @@ private Local getLocal(int idx) { type = AsmUti...
2
1
0
[{"id": "G0", "claim": "StringConstant should expose a static getClassType() method, mirroring the one the PR already added to ClassConstant.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new nonConstantDefs == null branch only skips splitting for s...
null
soot-oss__soot__2262
soot-oss/soot
2,262
defect
d9287b3c3e762e070971e627a0aa1fe940a0c611
2223fddf918806d21d4869f442b08fbea05a82c2
Cache field ref results
Using tim-hoffman's idea, partial code and test cases from https://github.com/soot-oss/soot/pull/1519
diff --git a/src/main/java/soot/AbstractSootFieldRef.java b/src/main/java/soot/AbstractSootFieldRef.java index 1812c69e330..0e3311c112e 100644 --- a/src/main/java/soot/AbstractSootFieldRef.java +++ b/src/main/java/soot/AbstractSootFieldRef.java @@ -38,11 +38,13 @@ public class AbstractSootFieldRef implements SootField...
1
1
0
[{"id": "G0", "claim": "resolve() should not re-attempt resolution when the previous resolve failed; the reviewer asks why the new cache retries in that case.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
sopel-irc__sopel__1429
sopel-irc/sopel
1,429
defect
1a2920fac008579bd6f9688491ba23d66c36f070
686993c2f608489e64dd5b57369a86639e035a4a
run_script: clean up & reorganize code
My end goal is to address issues like #1243 or #1175 and for that the code must allow it, either by being more modular, or more reusable, or more testable - not mentioning documentation, which is not an easy task at all. In this PR: * I extracted bit of code from `sopel.run_script` into separated and testable fun...
diff --git a/sopel.py b/sopel.py index 18e186f59d..78952a4f8c 100755 --- a/sopel.py +++ b/sopel.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 # coding=utf-8 from __future__ import unicode_literals, absolute_import, print_function, division +import sys # Different from setuptools script, because we want the one in this ...
28
27
0
[{"id": "G0", "claim": "The find_config docstring should read 'This function tries different locations' (plural).", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The bullet items in find_config's docstring location list should not end with commas."...
null
sopel-irc__sopel__1470
sopel-irc/sopel
1,470
defect
8febccdc8274617372b61e85fb8a1c0f5b147de9
383afc8c9ed8bc92af7963e59a26365798ad0e08
irc/bot: implement echo-message
Rebased & tweaked version of #1072, which stalled. Resolves #526. Original PR description by @maxpowa follows; see #1072 for the earlier evolution of this patch. ---- Allows modules to listen in on what's being sent by Sopel. Compatible with all the other decorators, as it goes through all the same logic. If `ech...
diff --git a/sopel/bot.py b/sopel/bot.py index 28be3539b3..dbefc7f4e4 100644 --- a/sopel/bot.py +++ b/sopel/bot.py @@ -530,6 +530,9 @@ def dispatch(self, pretrigger): match = True if not match: continue + if (not (...
7
5
2
[{"id": "G0", "claim": "The echo-message simulation block in write() should only fire for PRIVMSG and NOTICE messages, not for every message type the bot sends.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The @echo decorator should not take a val...
null
sopel-irc__sopel__1472
sopel-irc/sopel
1,472
defect
4add965c2b71ded34400eba2168a4fcf1fde5ee5
aee4f19760069919a4309c557a6f16c3215e4178
sopel.cli.utils
Related to #1471: * create a `sopel.cli.utils` modules, * functions from `sopel.cli.utils` are available from `sopel.cli` as shortcuts, * find, enumerate, and load configurations functions are now in `sopel.cli.utils`, * `sopel.run_script` now uses `sopel.cli.utils` for these functions, * existing tests are move...
diff --git a/setup.py b/setup.py index 0c6b33aa17..5c24f571cb 100755 --- a/setup.py +++ b/setup.py @@ -66,7 +66,7 @@ def read_reqs(path): # Distutils is shit, and doesn't check if it's a list of basestring # but instead requires str. packages=[str('sopel'), str('sopel.modules'), - str('sopel...
9
6
0
[{"id": "G0", "claim": "The new NotFound exception class name is way too generic and should be renamed to something like ConfigurationNotFoundError or ConfigNotFoundError.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The enumerate_configs docs...
null
sopel-irc__sopel__1485
sopel-irc/sopel
1,485
defect
8564c372139c810539a755db41c77a2c2abddc6a
49f753f25b61a5af0d2f1ccaa4429627c260d770
Replace deprecated bot.privileges accesses
`bot.privileges[channel][user]` -> `bot.channels[channel].privileges[user]`. Smoke tested.
diff --git a/sopel/module.py b/sopel/module.py index 91615b9788..172302b580 100644 --- a/sopel/module.py +++ b/sopel/module.py @@ -330,7 +330,7 @@ def guarded(bot, trigger, *args, **kwargs): # If this is a privmsg, ignore privilege requirements if trigger.is_privmsg: return fu...
3
3
0
[{"id": "G0", "claim": "The pull request's commits should be squashed into one commit before merge.", "category": "process", "verdict": "supported", "priority": "P3", "scope": "unclear"}, {"id": "G1", "claim": "The commit message should be reworded to say that only uses of the deprecated bot.privileges in core code are...
null
sopel-irc__sopel__1508
sopel-irc/sopel
1,508
defect
dafa08ac8b5615474575a751e486b92bc24dc4af
0685b81c345dd9bbc7bc538d206309c3afc61493
core: URL Callbacks new interface
This new interface adds: * `bot.register_url_callback(regex, callback)`, to register a `callback` to call when a URL matches `regex` * `bot.unregister_url_callback(regex)` to remove this regex from triggering callbacks * `bot.search_url_callbacks(url)` to get a list of (callback, match) for each pattern matched by...
diff --git a/sopel/bot.py b/sopel/bot.py index 7b2b09801d..98c2319064 100644 --- a/sopel/bot.py +++ b/sopel/bot.py @@ -247,10 +247,8 @@ def register(self, callables, jobs, shutdowns, urls): job = sopel.tools.jobs.Job(interval, func) self.scheduler.add_job(job) - if not self.me...
6
6
2
[{"id": "G0", "claim": "The register/unregister URL callback methods should check whether `pattern` is actually a compiled regex, since a coder passing an uncompiled string could cause Bad Things (even if just callbacks that never trigger).", "category": "correctness", "verdict": "supported", "priority": "P1", "scope":...
null
sopel-irc__sopel__1510
sopel-irc/sopel
1,510
defect
4aba0f2480bfaed17eafd0f497f6fa43c07b848b
69d3726116d12554b0971ac6c7c626830138997a
core: handle URL callbacks in coretasks
This fix #1489 - at last! PR #1508 added a new interface for plugin maintainers, that would help us work with URL callbacks. In this PR, I: * never trigger URL Callbacks from the `url` built-in plugin * share the "find URL" feature into `sopel.web` (with unit tests for good measure) * trigger URL callbacks from...
diff --git a/sopel/coretasks.py b/sopel/coretasks.py index b56db414f3..92a4f3a1ab 100644 --- a/sopel/coretasks.py +++ b/sopel/coretasks.py @@ -18,6 +18,7 @@ import time import sopel import sopel.module +import sopel.web from sopel.bot import _CapReq from sopel.tools import Identifier, iteritems, events from sopel...
12
8
1
[{"id": "G0", "claim": "Importing `sopel.web` separately is unnecessary in coretasks.py when `sopel` is already imported.", "category": "maintainability", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The check_callbacks docstring should be updated to remove the now-deleted `run...
null
sopel-irc__sopel__1528
sopel-irc/sopel
1,528
defect
59b72d02836bce2dc619f4208f549c5589ea4e12
7411faf96bd90503fede73b71e56f52bfc4695c6
core: perform commands on connect
This PR is meant to address #1455. It adds a `core` setting that is a `ListAttribute` of commands to perform upon successful connection with the IRC server. These commands are executed at the end of the `startup` sequence (set `MODE`s, `JOIN` channels, and now, _perform_ commands). It depends on #1460. **Example ...
diff --git a/sopel/config/core_section.py b/sopel/config/core_section.py index b08fdbcf13..a8d85f572f 100644 --- a/sopel/config/core_section.py +++ b/sopel/config/core_section.py @@ -50,6 +50,10 @@ def configure(config): 'channels', 'Enter the channels to connect to at startup, separated by commas.' ...
6
5
3
[{"id": "G0", "claim": "The docstring's `\\,` is an unrecognized escape sequence that Python 3.6 deprecates (and a future version will make a SyntaxError), so it should be fixed instead of being silenced with a noqa comment.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, ...
null
sopel-irc__sopel__1555
sopel-irc/sopel
1,555
defect
824ae7484b9e04310079a27d4d6ec40edeafdfd1
d0e7ca6b61bc5057f1932d25c336dabc55007f6c
test: add an --offline option to pytest
Usage: $ py.test --offline This option skip all tests that can not be run offline, as they are marked as "online". Either from manual tag: @pytest.mark.online def test_call_google(): request.get('https://google.com') Or from a command example: @example('.title http://google.com'...
diff --git a/conftest.py b/conftest.py index cd3f3afe94..a9eb3246e3 100644 --- a/conftest.py +++ b/conftest.py @@ -1,2 +1,19 @@ +import pytest + # This file lists files which should be ignored by pytest collect_ignore = ["setup.py", "sopel.py", "sopel/modules/ipython.py"] + + +def pytest_addoption(parser): + parse...
5
2
0
[{"id": "G0", "claim": "Rebase the branch to avoid merge conflicts introduced on master since the PR was opened.", "category": "process", "verdict": "supported", "priority": "P2", "scope": "unclear"}, {"id": "G1", "claim": "Add the online argument to the docstring of the module.example class.", "category": "documentati...
null
sopel-irc__sopel__1575
sopel-irc/sopel
1,575
defect
25e6469567c051703702015ca8b2a9529d9e0651
edeca2c852709b435730e5b94d6f8eebebefadf5
coretasks: Major rewrite of MODE handling
Opening this PR early as a draft, to gather feedback from @half-duplex (who reported a possible mode-tracking bug in the 6.6.x series to me) and others who might have more spare time and/or brainpower this weekend than I seem to (so far). 😅 If this turns out to be a productive rewrite, it's a solid reason to releas...
diff --git a/sopel/coretasks.py b/sopel/coretasks.py index 06755ef311..bbf24664c1 100644 --- a/sopel/coretasks.py +++ b/sopel/coretasks.py @@ -217,57 +217,84 @@ def handle_names(bot, trigger): def track_modes(bot, trigger): """Track usermode changes and keep our lists of ops up to date.""" # Mode message for...
1
1
0
[{"id": "G0", "claim": "Consider checking modes against the mapping while building the modes list (e.g. `elif char in mapping` inside the parse loop) instead of filtering unknown modes out in a separate pass afterwards.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
sopel-irc__sopel__1582
sopel-irc/sopel
1,582
defect
008a507ff61a089fff8b60f1d224a9d503ccd542
43e029f0ee04cccc781a0167b507d5bf4da46873
core: add `__all__` statements in sopel fix #765
The `__all__` statement in a Python module is used at import time when `from module import *` is used to expose only a defined list of object to be imported in the `locals()` environment of the importer. Even though the [Python documentation](https://docs.python.org/3/tutorial/modules.html#importing-from-a-package) ...
diff --git a/docs/source/bot.rst b/docs/source/bot.rst index 7077ba0d58..6c1b4d7e27 100644 --- a/docs/source/bot.rst +++ b/docs/source/bot.rst @@ -16,3 +16,7 @@ The bot and its state .. py:attribute:: name Sopel's "real name", as used for whois. + + +.. autoclass:: sopel.bot.SopelWrapper + :members: ...
6
6
1
[{"id": "G0", "claim": "The new SopelWrapper class docstring says \"This wrappers will be used\" and should read \"This wrapper will be used\".", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The availability note in sopel/web.py misspells \"deprec...
null
sopel-irc__sopel__1588
sopel-irc/sopel
1,588
defect
7af2602adb723b7a0ae85ab27c587bad33d32954
c352f427e163b04e40c3492430568d972c2d9977
cli: sopel-plugins (basic version)
Should fix #244 and fix #1519 at the same time. This PR adds a new command line to Sopel: `sopel-plugins`. This command line supports 4 actions: * `list`, to list available plugins (all by default, or just enabled/disabled plugins) * `show`, to show detailed information about a plugin * `configure`, to run a...
diff --git a/setup.py b/setup.py index c7c13e504a..ac28fa3e12 100755 --- a/setup.py +++ b/setup.py @@ -78,6 +78,7 @@ def read_reqs(path): 'console_scripts': [ 'sopel = sopel.cli.run:main', 'sopel-config = sopel.cli.config:main', + 'sopel-plugins = sopel.cli.plugins:main', ...
8
6
0
[{"id": "G0", "claim": "The subparsers help text 'Actions to perform' implies several actions can be specified at once, so it should read 'Action to perform'.", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "With --no-color the list output gives no ...
null
sopel-irc__sopel__1590
sopel-irc/sopel
1,590
defect
7af2602adb723b7a0ae85ab27c587bad33d32954
bdf1a34c7465cc19f403ae8fc3afa263e8346fa4
remind: add support for date in .at command
**This PR is based on #1581, and it replaces PR #1162.** Also fix #1148. It can replace PR #1581 if someone is brave enough to do the review of all the changes in one go. I added an extensive test-suite to make sure the remind `.at` command works as intended. I made `.at` opinionated about how date are expresse...
diff --git a/sopel/modules/remind.py b/sopel/modules/remind.py index 19c6fd69e2..1f248c5db9 100644 --- a/sopel/modules/remind.py +++ b/sopel/modules/remind.py @@ -8,80 +8,139 @@ """ from __future__ import unicode_literals, absolute_import, print_function, division +import codecs +import collections +from datetime i...
7
7
0
[{"id": "G0", "claim": "The `:param today:` description of `get_duration` should say that the default is the current time (in UTC) rather than 'aware datetime to compare to, default to UTC now', while keeping 'aware' in the `:type:` line.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope":...
null
sopel-irc__sopel__1597
sopel-irc/sopel
1,597
defect
a36a434fa61bb485a69c14d3bfcc4c3284616960
8e74ebffa40a76474902b00f17c0accab4bd70b3
bot: new setup sequence
At first, I had to rework the Job Scheduler in order to test how Sopel registers and unregisters plugins, which was annoying. But then, the solution wasn't perfect: I didn't like to have to manually stop the scheduler for testing purpose—which is time consuming and a bad thing when your test suite grow a bit (a lot at ...
diff --git a/sopel/bot.py b/sopel/bot.py index 9dc1d78d58..13dd681b50 100644 --- a/sopel/bot.py +++ b/sopel/bot.py @@ -16,17 +16,16 @@ import threading import time -from sopel import irc, plugins, tools +from sopel import irc, logger, plugins, tools from sopel.db import SopelDB from sopel.tools import stderr, Ide...
1
1
0
[{"id": "G0", "claim": "The plugin-loading step of the new setup sequence should not print a 'Welcome to Sopel.' message; it should print only 'Loading plugins...' (not 'modules') plus any errors encountered while loading.", "category": "design", "verdict": "supported", "priority": "P3", "scope": "pre_existing"}]
null
sopel-irc__sopel__1598
sopel-irc/sopel
1,598
defect
6e28f9827486cfb96871e32c048bad5346ccf6da
3ec64c358799201243d8b81d12a635f78e8a8d3a
cli: add --config-dir common option
I used to left a comment like this: ``` # TODO: allow to use a different homedir ``` But no more. Now, you can use `--config-dir <configdir>` for that. This option provides the location to look for configuration file. Note that this does **not** replace and must **not** be confused with the settings's homedir, ...
diff --git a/sopel/cli/config.py b/sopel/cli/config.py index 692124b7f7..b1e014e286 100644 --- a/sopel/cli/config.py +++ b/sopel/cli/config.py @@ -5,7 +5,7 @@ import argparse import os -from sopel import tools, config +from sopel import tools from . import utils @@ -22,11 +22,13 @@ def build_parser(): # s...
11
10
1
[{"id": "G0", "claim": "The new common option should not be called a \"homedir\" since it only locates config files, and should be named --config-dir instead.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The reviewer proposes possibly dropping the conf...
null
sopel-irc__sopel__1609
sopel-irc/sopel
1,609
defect
165d297b56449931c25670d90bec4210b5ef7a4a
b228d56897ca64d91b9b43f20f775c72c679b06a
isup: minor cleanup with tests
Just A Small PR.© I didn't want to change how the "is this an URL?" checks are performed, but at least they are tested now.
diff --git a/sopel/modules/isup.py b/sopel/modules/isup.py index 11171ba975..f82cedff89 100644 --- a/sopel/modules/isup.py +++ b/sopel/modules/isup.py @@ -9,39 +9,75 @@ from __future__ import unicode_literals, absolute_import, print_function, division import requests -from requests.exceptions import SSLError +from ...
1
1
0
[{"id": "G0", "claim": "The misspelled test variable name INVVALID_SITE_URLS should be renamed to INVALID_SITE_URLS.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
sopel-irc__sopel__1621
sopel-irc/sopel
1,621
defect
c6c47d4cea7a65e56958c6cb144927f8e62ab2d3
8425126dd257e5c540d1c08f523bb24b5e13df00
db: add methods for values associated with a plugin
This aims to resolve issue #1501. The one thing I was uncertain of is if we need to bother using `.lower()` like we do with channels. ---- @dgw edit: Closes #1501
diff --git a/sopel/db.py b/sopel/db.py index 6a176a3870..e474ba11c7 100644 --- a/sopel/db.py +++ b/sopel/db.py @@ -74,6 +74,16 @@ class ChannelValues(BASE): value = Column(String(255)) +class PluginValues(BASE): + """ + PluginValues SQLAlchemy Class + """ + __tablename__ = 'plugin_values' + plug...
6
6
2
[{"id": "G0", "claim": "Casting the plugin name to Identifier in set_plugin_value is unnecessary and the plain .lower() used elsewhere should be used instead.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The PR should include a delete_plugin_v...
null
sopel-irc__sopel__1628
sopel-irc/sopel
1,628
defect
a1962374f386a5fa735082b9fe3f9354e88a3462
3bbdd5816a960fbadd0c39c561cf49baf97922c2
config: split ListAttribute values on newlines
See the description of #1626 for more information. Note: I had to upgrade the `test_config.py` file to use py.test instead of unittest. We should be fine with that.
diff --git a/sopel/config/types.py b/sopel/config/types.py index 657ae08ef5..5d9a463f06 100644 --- a/sopel/config/types.py +++ b/sopel/config/types.py @@ -211,12 +211,45 @@ def configure(self, prompt, default, parent, section_name): class ListAttribute(BaseValidated): """A config attribute containing a list of st...
9
9
0
[{"id": "G0", "claim": "The docstring example and the matching tests should name the example list option in the plural ('cheeses') instead of 'cheese'.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new documentation, comments and test comment...
null
sopel-irc__sopel__1632
sopel-irc/sopel
1,632
defect
919d6797c942c8f2aba07ff76fb7ee0c0ad9229b
f0f46bebaa3e66a14fccacaeb4d6e840527cf2e9
module: fix decorator multiple-use inconsistency
Not much to say: fix [main part of] #1619 (editorial by @dgw so GH won't close the other issue)
diff --git a/sopel/bot.py b/sopel/bot.py index c10d59898d..1934f2b837 100644 --- a/sopel/bot.py +++ b/sopel/bot.py @@ -288,9 +288,10 @@ def remove_plugin(self, plugin, callables, jobs, shutdowns, urls): # remove URL callback handlers if self.memory.contains('url_callbacks'): f...
5
5
0
[{"id": "G0", "claim": "The new rule docstring should say the decorator can be called with \"multiple positional\" arguments instead of \"many positional\".", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The new rule docstring should say \"equival...
null
sopel-irc__sopel__1634
sopel-irc/sopel
1,634
defect
c1a3a64fab9ac163c787494e75a72f138bd97959
4a8ac25637588c77357af3189738c4d42a7b2bba
test: register pytest "online" marker
Per [pytest latest version documentation](https://docs.pytest.org/en/latest/writing_plugins.html#registering-markers) we should register the custom marker we use - for now, "online". And for good measure, let's always update dependencies when running Travis.
diff --git a/.travis.yml b/.travis.yml index da4c46b3af..1a3778c286 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ addons: - aspell-en - libaspell-dev install: - - pip install -r requirements.txt -r dev-requirements.txt + - pip install -r requirements.txt -r dev-requirements.txt -U scrip...
3
2
1
[{"id": "G0", "claim": "The Python 3.3 CI build is broken after this change and the author should track down why.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}, {"id": "G1", "claim": "The travis install command should use the long form: pip install --upgrade -r requiremen...
null
sopel-irc__sopel__1681
sopel-irc/sopel
1,681
defect
cdef510d8453c5c0bfe87f59c1df0beb83b25981
98bfd61e5d51188de7225d9c0d06e29996b5dc3f
tools.web: add `unquote()` function
Also added tests for the old `quote()` function/shim and the new `unquote()` thing. They're even using `@pytest.mark.parametrize`! (And also using a cheeky `zip()` trick that @Exirel might think is "not dumb enough" for using in a test file. 🤐) Aside from the obvious hope that anyone else still thinks this is a goo...
diff --git a/sopel/modules/calc.py b/sopel/modules/calc.py index a04c9689fd..f58143704f 100644 --- a/sopel/modules/calc.py +++ b/sopel/modules/calc.py @@ -14,14 +14,7 @@ from sopel.module import commands, example from sopel.tools.calculation import eval_equation - -if sys.version_info.major < 3: - from urllib im...
2
2
1
[{"id": "G0", "claim": "The new quote/unquote tests should also cover `+`, `/`, `?`, `%` and a space, which can be a very bad surprise when nobody checks for them.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "A `.. note::` should be added to the `quot...
null
sopel-irc__sopel__1690
sopel-irc/sopel
1,690
defect
c752b10707e5ffcecc8814e315f31a8271937e76
c51c397f59bdb996bcb6b8315e60f6cfc7431cd6
config: quote ListAttribute items when required
In a ListAttribute, a value can start with a #, which is then considered as a comment by the Config reader. This is bad news, as channel names usually start with a # (they can start with a & too, which is less common on freenode). To prevent this, what I do is: * quote the item only if necessary * unquote it if ...
diff --git a/sopel/config/types.py b/sopel/config/types.py index 9445927e01..ab1692dc50 100644 --- a/sopel/config/types.py +++ b/sopel/config/types.py @@ -27,6 +27,7 @@ from __future__ import unicode_literals, absolute_import, print_function, division import os.path +import re import sys from sopel.tools import g...
14
12
0
[{"id": "G0", "claim": "Flake8 reports F812 — a list comprehension redefines 'value' — on Python 2.7 only, because comprehension scoping differs between Python 2 and 3.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "unclear"}, {"id": "G1", "claim": "After the F812 fix, the test sui...
null
sopel-irc__sopel__1701
sopel-irc/sopel
1,701
defect
36b36efe5cd283d12600e9fef109bc6d1836a5d5
2da206f864da991c20190bbd02c7c8e06a4580a2
module, bot: add `output_prefix` decorator & feature
Decorated functions will have anything they output (via the `say` or `notice` wrapper methods; it doesn't make sense for `action` or `reply`) prefixed with the given string. Closes #1352.
diff --git a/sopel/bot.py b/sopel/bot.py index cb2bc604d3..88ce46f18f 100644 --- a/sopel/bot.py +++ b/sopel/bot.py @@ -716,8 +716,11 @@ def dispatch(self, pretrigger): if is_echo_message and not func.echo: continue + # Handle output prefix feature + ...
4
4
0
[{"id": "G0", "claim": "The bullet lines in the `output_prefix` docstring are over-indented, which changes the rendered reStructuredText output, and the leading spaces should be removed.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The `:meth:` ...
null
sopel-irc__sopel__1731
sopel-irc/sopel
1,731
defect
e5ceb0d9f2bd945d04e4a7c1f0ceb456d33344e5
7aec555bdc88b06f11c8d6016d1cd21564106696
test: botfactory, UserFactory, and IRCFactory
I wanted more from Sopel's test tools, for 2 reasons: * increase the test coverage for the bot, its internals and its plugins * help plugin authors to test their plugins My approach in this PR is the following: * `sopel.tests.mocks` contains mocks: they generate fake IRC lines (User and IRC Server) or preten...
diff --git a/docs/source/index.rst b/docs/source/index.rst index f8ef05f507..7717d2daf4 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -25,3 +25,4 @@ Documentation run package + tests diff --git a/docs/source/tests.rst b/docs/source/tests.rst new file mode 100644 index 0000000000..cfbc...
22
19
0
[{"id": "G0", "claim": "The rewritten get_example_test docstring still needs tweaking: type annotations on the :param lines and style adjustments (lowercase descriptions, no trailing periods), e.g. for use_regexp.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G...
null
sopel-irc__sopel__1782
sopel-irc/sopel
1,782
defect
e3655c244b24166d3204e91daceffc677edcfc85
9de62aae633e6e8b84b2391b934a7017f7a476d9
trigger: doc overhaul
This is pretty self-explanatory. I'm opening it early to get feedback on my approach to documenting `PreTrigger` (which wasn't really documented before). Note I'm still working over the existing docstrings in `Trigger` as of PR opening. Y'all can expect force-pushes to this branch as I find more time to work on thes...
diff --git a/sopel/trigger.py b/sopel/trigger.py index 9a70e246d1..ebd6d275bb 100644 --- a/sopel/trigger.py +++ b/sopel/trigger.py @@ -1,5 +1,5 @@ # coding=utf-8 -"""Sopel IRC Trigger Lines""" +"""Triggers are how Sopel tells callables about their runtime context.""" from __future__ import unicode_literals, absolute_...
1
1
1
[{"id": "G0", "claim": "The new `PreTrigger.text` documentation is wrong: `text` is not set for every line (reportedly raising an AttributeError on lines containing ':'), so it should either always be set or removed, since `Trigger.__new__` uses `pretrigger.args[-1]` instead.", "category": "correctness", "verdict": "su...
null
sopel-irc__sopel__1808
sopel-irc/sopel
1,808
defect
ac1fbe67678cfbfcedc2b4a8982cf9da1cbdefd0
f6c49d16300d5314228d4f243c7779490567b437
bot: require callback to unregister URL handler
### Description Introduces the API change #1805 will require. The test diff isn't particularly minimal because this is a reduction of that patchset for 7.0. ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sopel-irc/sopel/blob/master/CONTRIBUTING.md) - [x] I can and do license this contributio...
diff --git a/sopel/bot.py b/sopel/bot.py index c8e26d4e5b..81ce94f294 100644 --- a/sopel/bot.py +++ b/sopel/bot.py @@ -329,7 +329,7 @@ def remove_plugin(self, plugin, callables, jobs, shutdowns, urls): regexes = func.url_regex for regex in regexes: if func == self....
2
1
1
[{"id": "G0", "claim": "The patch renames the test to test_register_url_callback_multiple with a docstring about adding multiple callbacks for a pattern, but the patch does not enable multiple callbacks for a pattern yet.", "category": "testing", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G...
null
sopel-irc__sopel__1853
sopel-irc/sopel
1,853
defect
78aeb2f65acd6c95481f0e7ec44c6c782e85e678
648deadfc13fc859ba3ee4aa4bb1ad5cdc67b2f4
module, tests: set up `VCR.py` for plugin example tests
### Description * Add new `vcr` kwarg to `module.example` decorator * Considered making this part of `online`, but decided to keep it separate as it would be a pretty big behavior change * Add PyPI requirements for implementing VCR * Configure default cassette directory for VCR via new conftest fixture ##...
diff --git a/Makefile b/Makefile index 0405cd52fe..deb6779a21 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,9 @@ quality: test: coverage run -m py.test -v . +test_novcr: + coverage run -m py.test -v . --vcr-record=none + coverage_report: coverage report @@ -16,7 +19,7 @@ coverages: coverage_report coverage_...
6
3
3
[{"id": "G0", "claim": "Exirel is not convinced by the VCR approach and suggests a `--offline` marker for Travis instead, arguing it would cover the same flaky-network problem with fewer changes and less risk of breaking Travis.", "category": "design", "verdict": "opposed", "priority": "P1", "scope": "introduced"}, {"i...
null
sopel-irc__sopel__1881
sopel-irc/sopel
1,881
defect
5fddc739b052e279d88a23a3f3c017f4927c063e
65fb76adb6496a3d8c75abd11c352ad02a48e54e
rules: add find and search rules
Fixes #1757 Draft PR for now, until #1873 is at least approved. ### Description Based on #1873 this PR adds two new rules: - **Find rules**: an anonymous rule that executes its handler for every instance found in the line, allowing to execute a function multiple times for a single trigger object - **Searc...
diff --git a/sopel/bot.py b/sopel/bot.py index a0b93b7025..b60726496c 100644 --- a/sopel/bot.py +++ b/sopel/bot.py @@ -447,18 +447,25 @@ def register_callables(self, callables): for callbl in callables: rules = getattr(callbl, 'rule', []) + find_rules = getattr(callbl, 'find_rules', [...
16
15
0
[{"id": "G0", "claim": "LGTM reports 3 new alerts for 'Conflicting attributes in base classes' when merging this pull request.", "category": "design", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The find decorator's summary docstring should read 'to be called for each time a...
null
sopel-irc__sopel__1882
sopel-irc/sopel
1,882
defect
d7bc97a94521fc4c7a4656fa8c0158e1833f72f4
c885395b1a386f02966685bf07444e9e52e95d0b
cli: fix SOPEL_CONFIG env var broken usage
### Description The code around config loading for command lines didn't work properly: it ignored the `SOPEL_CONFIG` env var. So I fixed it, and added some tests too. Its usage is now documented in the help message for the `-c/--config` option. ### Checklist - [x] I have read [CONTRIBUTING.md](https://githu...
diff --git a/sopel/cli/run.py b/sopel/cli/run.py index 57541d06c2..b60913ca5e 100755 --- a/sopel/cli/run.py +++ b/sopel/cli/run.py @@ -356,22 +356,24 @@ def get_configuration(options): return settings -def get_pid_filename(options, pid_dir): - """Get the pid file name in ``pid_dir`` from the given ``options...
2
2
0
[{"id": "G0", "claim": "Fix the typos in the documentation this pull request adds: 'environement' should be 'environment' in the three added doc/help lines in sopel/cli/utils.py, and the get_pid_filename docstring sentence in sopel/cli/run.py should be reworded to 'then it will be used to generate the pid file name as'...
null
sopel-irc__sopel__1890
sopel-irc/sopel
1,890
defect
5fddc739b052e279d88a23a3f3c017f4927c063e
04e69b9d41e9aa7fe073e604b8847edb66ba2ce6
irc: tweak backend interface
### Description We used `async_chat.connected` attribute directly in the code, which we shouldn't, so I replaced it with a new method, added to the abstract IRC backend interface. Also, after further inspection, async_chat's `close` method can be used safely, so now we call it first, then we ask the bot to do wha...
diff --git a/sopel/bot.py b/sopel/bot.py index a0b93b7025..2601ae6720 100644 --- a/sopel/bot.py +++ b/sopel/bot.py @@ -868,6 +868,7 @@ def _nick_blocked(self, nick): def _shutdown(self): """Internal bot shutdown method.""" + LOGGER.info('Shutting down') # Stop Job Scheduler LOGG...
1
1
0
[{"id": "G0", "claim": "The log message 'Timeout scheduler stop' could use tweaking; the reviewer suggested replacing it with 'Stopping timeout watchdog'.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}]
null
sopel-irc__sopel__1891
sopel-irc/sopel
1,891
defect
3076f8e12e17c3f3d635d947dad9f2379c3a3dde
cbec34025d309eeae62a937c53435f8321de30ac
jobs: prevent parallel execution and plugin specific scheduler
Closes #1144 ### Description Initially, it was only about preventing parallel execution of jobs, but then I realized I needed way more than that: * changed the job object to be registered only once for any set of intervals, * changed the job object to have similar meta-data than plugin's rules * added a new...
diff --git a/docs/source/plugin.rst b/docs/source/plugin.rst index b04dd0974a..0dee5a1e64 100644 --- a/docs/source/plugin.rst +++ b/docs/source/plugin.rst @@ -146,6 +146,12 @@ sopel.plugins.rules :members: :undoc-members: +sopel.plugins.jobs +------------------ +.. automodule:: sopel.plugins.jobs + :m...
10
9
2
[{"id": "G0", "claim": "The new docstring in bot.unregister misspells 'means' as 'mean' and should read 'by other means, there is no use for it anymore.'", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "bot.register_jobs and bot.unregister_jobs shou...
null
sopel-irc__sopel__1894
sopel-irc/sopel
1,894
defect
1c9fb843ac7219454b9c918e0146f8e5ed9ba677
787f50b67ca5bf09fc42e241423e1c38240ba236
rules, emoticons: action commands & commands working together at last
### Description All I wanted was to do `/me flips table` and have the bot to reply to me with the best emote ever. However, I forgot just one little detail in my last PR about rules & commands, which is to not set the `intents` attribute in `action_commands`. Everything else was done and ready to work as intended...
diff --git a/sopel/module.py b/sopel/module.py index de92347fd2..62a8120ad7 100644 --- a/sopel/module.py +++ b/sopel/module.py @@ -538,7 +538,6 @@ def action_commands(*command_list): """ def add_attribute(function): - function.intents = ['ACTION'] if not hasattr(function, 'action_commands'):...
3
2
2
[{"id": "G0", "claim": "If regex support is being removed from command types, the tableflip action command must list the article variants ('flips a table', 'flips the table') alongside 'flips table' so those phrasings still trigger it.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "int...
null
sopel-irc__sopel__1930
sopel-irc/sopel
1,930
defect
c7f30fa4f9a7f5c691dcf3d6dfd845f363edf652
de1257806c9991a709acbb3507adac6ab9f9d0c0
core: change/recover in-use nick; fix obsolete USER command syntax
### Description Basic implementation to fix #300 (no configuration, no alternative, nothing): 1. on connection, if we receive a "nick already used" event, we change the current nick, adding an extra ` _` to its end 2. on auth with a nickserv account, if `bot.nick` is not `bot.settings.core.nick`, we try to use `...
diff --git a/sopel/coretasks.py b/sopel/coretasks.py index 38379c6c9e..13377d1fd4 100644 --- a/sopel/coretasks.py +++ b/sopel/coretasks.py @@ -98,8 +98,17 @@ def auth_after_register(bot): else: return + # nickserv-based auth method need to check for current nick if auth_method == 'nickserv': - ...
9
9
2
[{"id": "G0", "claim": "The comment added in auth_after_register should read 'needs to check' instead of 'need to check'.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The 'Nickname already in use!' log format string should drop the extra spaces ...
null
sopel-irc__sopel__1933
sopel-irc/sopel
1,933
defect
5525ed249f7e4ad13fdf33f012fa05f03bdaf8d4
163eb72f1a3d9a8717dccad1da07669e5992eaa5
config: small refactoring and unit tests for types
### Description All I wanted was to add a new type of attribute (something like a `FlagAttribute` to simplify how boolean attributes are handled in config). But then, I discovered an interface I really don't like. So instead I wrote some unit-test, refactored some bit. I would like to go further, but I need some ...
diff --git a/sopel/config/types.py b/sopel/config/types.py index 93db3b0393..58a1190722 100644 --- a/sopel/config/types.py +++ b/sopel/config/types.py @@ -95,19 +95,20 @@ def configure_setting(self, name, prompt, default=NO_DEFAULT): passed, the current value of the setting will be ignored, even if it is ...
11
10
0
[{"id": "G0", "claim": "The new test wraps option.parse('785.56') in a pointless assert inside pytest.raises; the call should be a bare statement.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The comment in test_list_parse_new_lines_strip misspells th...
null
sopel-irc__sopel__1936
sopel-irc/sopel
1,936
defect
528e1b8298e455c486b2a0284bb62a659034f98d
59054fd111e5584ff20e92d534325e311fc61696
loader, plugin: load decorated callables only
### Description Fix #859 and that's it. ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sopel-irc/sopel/blob/master/CONTRIBUTING.md) - [x] I can and do license this contribution under the EFLv2 - [x] No issues are reported by `make qa` (runs `make quality` and `make test`) - [x] I have ...
diff --git a/sopel/loader.py b/sopel/loader.py index 3e075b0af9..3eb1e2f30a 100644 --- a/sopel/loader.py +++ b/sopel/loader.py @@ -234,15 +234,16 @@ def clean_module(module, config): urls = [] for obj in itervalues(vars(module)): if callable(obj): + is_sopel_callable = getattr(obj, '_sopel...
2
1
0
[{"id": "G0", "claim": "In clean_module, a well-placed `continue` (after the shutdown special case) would be cleaner than adding `is_sopel_callable and` to every `if` and avoids re-evaluating the same condition over and over.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id...
null
sopel-irc__sopel__1938
sopel-irc/sopel
1,938
defect
528e1b8298e455c486b2a0284bb62a659034f98d
d4515901f1ef10df5d602530cfce122fdbcad507
tools: new `SopelIdentifierMemory` class
### Description In an attempt to fix #1341, I decided to create a new class that specifically deals with `tools.Identifier` as its keys: nothing more, nothing less, just `Identifier`. My idea is that we *want* `SopelMemory` to consider `"nick"` and `Identifier("nick")` as two separated keys, and what we need is a...
diff --git a/sopel/bot.py b/sopel/bot.py index 082a5e9469..974ead850d 100644 --- a/sopel/bot.py +++ b/sopel/bot.py @@ -91,7 +91,7 @@ def __init__(self, config, daemon=False): Use :attr:`channels` instead. Will be removed in Sopel 8. """ - self.channels = tools.SopelMemory() # name to cha...
1
1
0
[{"id": "G0", "claim": "Use the common spelling \"instantiate\" instead of \"instanciate\" in the SopelIdentifierMemory docstring's note about key casting.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
sopel-irc__sopel__1944
sopel-irc/sopel
1,944
defect
daaef673886a688746cebde333bd8d8b6abb218c
8c6202d5a3f6a4c76c9116599a38c94f7d6cdec2
plugins: command-regexp functions are now private
### Description Fix #1887 * moved everything into `sopel.plugins.rules`, directly into each rule class * removed/deprecated a bunch of stuff from `sopel.test_tools` (this entire module should probably be deprecated and removed at some point anyway) * reworked imports in `sopel.test_tools` * changed how the `e...
diff --git a/sopel/plugins/rules.py b/sopel/plugins/rules.py index 463d3d899a..fd4d9211f6 100644 --- a/sopel/plugins/rules.py +++ b/sopel/plugins/rules.py @@ -24,6 +24,7 @@ import itertools import logging import re +import sys import threading @@ -56,6 +57,11 @@ 'URLCallback', ] +if sys.version_info.maj...
9
8
4
[{"id": "G0", "claim": "The three reworded docstrings in Rule, NickCommand and ActionCommand read 'to creates a compiled regex to return.' — the grammar error should be fixed to 'to create a compiled regex to return.'", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id"...
null
sopel-irc__sopel__1958
sopel-irc/sopel
1,958
defect
54e42747959d86ddc1ba40bc02098cb3ab7d9439
fc648df4e06e2966c6d72c59db48bd25a059e84c
bot, irc: in `bot.say()`, fill IRC line if possible & add optional truncation indicator
### Description By way of killing (or at least gravely wounding) two birds with one stone, this is my valiant attempt to resolve #1328, and also close #1322—which was left open pending a change like this to make use of the stored hostmask when sending messages. (I say "attempt" mostly because certain @sopel-irc/rockst...
diff --git a/setup.cfg b/setup.cfg index edc33e364a..95f4cf32a9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,6 +45,9 @@ import-order-style = google ignore = # Line length limit. Acceptable (for now). E501, + # Newline before binary operator. Sometimes this is more readable, e.g. in + # long arithmetic...
5
3
1
[{"id": "G0", "claim": "The prefix_length helper should be a plain function instead of a pytest fixture, because the fixture adds complexity without more benefit than a basic function call.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Another ...
null
sopel-irc__sopel__1965
sopel-irc/sopel
1,965
defect
005a53452fdd96dde1dd266b1587d67170665317
078c4ac8d4b1428b51a8b336cd0ede3dc642fe46
choose: safely handle formatted options
### Description Briefly, this resolves #1877. No longer will unterminated formatting, or leading/trailing formatting characters, cause formatting issues in the `.choose` command's output. The custom "strip"/"cleanup" function that makes it all possible comes replete with <del>16</del> <del><ins>20</ins></del> <ins>...
diff --git a/sopel/formatting.py b/sopel/formatting.py index 23bd465a93..4272a060b5 100644 --- a/sopel/formatting.py +++ b/sopel/formatting.py @@ -62,6 +62,19 @@ CONTROL_REVERSE = '\x16' """The control code to start or end reverse-color formatting.""" +CONTROL_FORMATTING = [ + CONTROL_NORMAL, + CONTROL_COLOR,...
2
1
0
[{"id": "G0", "claim": "The strip loops in `_format_safe` should iterate the string with `enumerate` (and `reversed` for the right strip) instead of `while` loops, avoiding manual `pos` bookkeeping and exit-condition risk.", "category": "maintainability", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, ...
null
sopel-irc__sopel__1973
sopel-irc/sopel
1,973
defect
005a53452fdd96dde1dd266b1587d67170665317
ef356e0721cbd2e247336d89b55679ac5971ceac
config: warn if unexpected settings exist
### Description Fix #1570 To implement this, I added new methods and changed the bot's `setup()` method: * `sopel.config.Config.get_defined_sections()` retrieves all defined sections, so it's easier to know which sections of the config file are defined in order to check them for unexpected settings * `sopel.b...
diff --git a/sopel/bot.py b/sopel/bot.py index 974ead850d..c84ffe9137 100644 --- a/sopel/bot.py +++ b/sopel/bot.py @@ -254,7 +254,7 @@ def setup(self): """ self.setup_logging() self.setup_plugins() - self._scheduler.start() + self.post_setup() def setup_logging(self): ...
3
3
0
[{"id": "G0", "claim": "The get_defined_sections docstring summary line should read \"Retrieve all defined static sections of this configuration.\" instead of \"static section\".", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The :return:/:rtype: ...
null
sopel-irc__sopel__1975
sopel-irc/sopel
1,975
defect
50021835c677e7951b35cd84b302d12742d3b4fe
4f2d0dcd3f976bf793e0ff91bc5a58a4ec2c36d3
plugin: replace intent by ctcp
### Description This is part of #1683: it replaces `sopel.module.intent` by `sopel.plugin.ctcp`. This does not change how "intents" are managed internally by Sopel, which should be done later, possibly in Sopel 8 or maybe Sopel 9. Also, because CTCP is mostly used for ``ACTION``, this is now the default: you can ...
diff --git a/docs/source/plugin.rst b/docs/source/plugin.rst index b7c607333a..f4c7e073df 100644 --- a/docs/source/plugin.rst +++ b/docs/source/plugin.rst @@ -77,7 +77,7 @@ Plugin glossary Action command An action command is a :term:`Named rule` that reacts to a name in a - message sent with the ``ACT...
4
4
1
[{"id": "G0", "claim": "The first line of the ctcp docstring claims CTCP commands are mostly ACTION, which is not true of CTCPs; dgw suggests rewording it to say ACTION is merely the most commonly useful value.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1",...
null
sopel-irc__sopel__1980
sopel-irc/sopel
1,980
defect
0dc8d58565c972062d64de06ab0628182c7bb227
fc484e34077a14c3d0bf1cd363736083d435ed51
coretasks: track all channel modes
### Description Depends on #2015. Implements most of #1789. Groundwork for #1842. Teach Sopel to track all channel modes in `channel.modes`. Uses `isupport.PREFIX` to check valid user priv modes and `isupport.CHANMODES` to see what's valid and what's expecting arguments. Also reduces the number of panic WHOs we nee...
diff --git a/sopel/coretasks.py b/sopel/coretasks.py index 4579d12c29..c2efc60c01 100644 --- a/sopel/coretasks.py +++ b/sopel/coretasks.py @@ -79,7 +79,8 @@ def _join_event_processing(bot): channel = bot.memory['join_events_queue'].popleft() except IndexError: break - LOGGER.de...
8
7
1
[{"id": "G0", "claim": "Add trailing commas to the final argument of the new multi-line LOGGER.warning calls in _parse_modes, for consistency with the project style.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "End the new test docstrings and ...
null
sopel-irc__sopel__1982
sopel-irc/sopel
1,982
defect
0dc8d58565c972062d64de06ab0628182c7bb227
2fdafeddc74be84fb589db79d71b401df4c112ed
plugin: new `require_bot_privilege` decorator
### Description This wasn't requested, and probably not needed that much. However, when reading the code for #1981 I realized that we repeat a lot of code, so I figured out I could add these: * `bot.has_channel_privilege(channel, level)` will tell you if the **bot** itself has the right privilege level, * `plugi...
diff --git a/docs/source/plugin/anatomy.rst b/docs/source/plugin/anatomy.rst index f87c00b7f3..f6a01a1904 100644 --- a/docs/source/plugin/anatomy.rst +++ b/docs/source/plugin/anatomy.rst @@ -80,6 +80,17 @@ better to limit who can trigger them. There are decorators for that: trigger the rule * :func:`sopel.plugin.re...
6
5
1
[{"id": "G0", "claim": "half-duplex asks whether there is any reason for these adminchannel commands to require +o from the user, since the bot only needs (and may only have) +h, which would let a +h user do it themselves.", "category": "design", "verdict": "uncertain", "priority": "P2", "scope": "pre_existing"}, {"id"...
null
sopel-irc__sopel__1983
sopel-irc/sopel
1,983
defect
2744f924672cbb8c947a6216417646ea5bbb742a
01798894c49f6771e0e974780d9f4d58195381dc
irc: test sopel.irc.utils.safe function
### Description `sopel.irc.utils.safe` wasn't tested, now it is. Also with a better docstring. ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sopel-irc/sopel/blob/master/CONTRIBUTING.md) - [x] I can and do license this contribution under the EFLv2 - [x] No issues are reported by `make q...
diff --git a/sopel/irc/utils.py b/sopel/irc/utils.py index 2c81c31072..99ca728583 100644 --- a/sopel/irc/utils.py +++ b/sopel/irc/utils.py @@ -35,7 +35,30 @@ def get_cnames(domain): def safe(string): - """Remove newlines from a string.""" + """Remove newlines from a string. + + :param str string: input te...
1
1
0
[{"id": "G0", "claim": "The new test module's docstring says it tests ``sopel.irc.isupport`` when the file actually tests ``sopel.irc.utils``, leftover from a copy-paste that needs updating.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
sopel-irc__sopel__1997
sopel-irc/sopel
1,997
defect
e996b877738e5375bf0d69a89d8a0b19f3660de6
775af4bc553baf9a3f93d2f4fedbef8374c28662
coretasks: NAMESX when multi-prefix is not available
### Description As per the discussion in #1496 this makes Sopel send a `PROTOCTL NAMESX` command when: 1. we receive a RPL_ISUPPORT message from the server 2. multi-prefix is not an available capability 3. NAMESX is now activated ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sopel-...
diff --git a/sopel/coretasks.py b/sopel/coretasks.py index 3d18664dc7..dbf60968c0 100644 --- a/sopel/coretasks.py +++ b/sopel/coretasks.py @@ -237,6 +237,10 @@ def startup(bot, trigger): @module.rule('are supported by this server') def handle_isupport(bot, trigger): """Handle ``RPL_ISUPPORT`` events.""" + # r...
1
1
0
[{"id": "G0", "claim": "The comments added in handle_isupport() are ungrammatical (\"does NAMESX has been updated?\" / \"yes it does!\") and should be reworded to \"was NAMESX support status updated?\" / \"yes it was!\".", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}]
null
sopel-irc__sopel__2003
sopel-irc/sopel
2,003
defect
e996b877738e5375bf0d69a89d8a0b19f3660de6
4584933c23a9976ab1361411e22d0e0d209d88d4
tests: deprecate test_tools; replace with tests.pytest_plugin
### Description Since the last refactoring, the only purpose left for `sopel.test_tools` was to provide utility functions for `sopel.plugin.example`. Since this feature always requires pytest, I figured that it would be better to nuke `sopel.test_tools` in Sopel 8 and to move everything still relevant to that plugi...
diff --git a/sopel/plugin.py b/sopel/plugin.py index 85a04f3d8e..a717d8ab49 100644 --- a/sopel/plugin.py +++ b/sopel/plugin.py @@ -1103,16 +1103,16 @@ def __call__(self, func): import sys - import sopel.test_tools # TODO: fix circular import with sopel.bot and sopel.test_tools - # only inj...
4
4
0
[{"id": "G0", "claim": "The new deprecation note in sopel/test_tools.py doesn't fully cover the old mock classes, which are still present and will be removed together with the module, and should also mention the mocks and factories modules.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope...
null
sopel-irc__sopel__2015
sopel-irc/sopel
2,015
defect
0b0d4a528dc2dedaf279830fcc2850dc8ed24e7a
d4e7750563d919b7f9ef4cccad9a8c256a5ac1d7
isupport: return empty CHANMODES if unavailable
### Description Reduce boilerplate necessary for plugins that use `isupport.CHANMODES` by returning `{"A": "", ...}` instead of raising AttributeError if the server hasn't given us info. See https://github.com/sopel-irc/sopel/pull/1980#discussion_r554754569 ### Checklist - [x] I have read [CONTRIBUTING.md](https:...
diff --git a/sopel/irc/isupport.py b/sopel/irc/isupport.py index 8617a887d0..6e9ef485a1 100644 --- a/sopel/irc/isupport.py +++ b/sopel/irc/isupport.py @@ -267,7 +267,7 @@ def CHANLIMIT(self): @property def CHANMODES(self): - """Expose ``CHANMODES`` as a dict, if advertised by the server. + """...
1
1
1
[{"id": "G0", "claim": "The added assertion `instance.CHANMODES.keys() == set(\"ABCD\")` fails the Python 2 CI and should be replaced with `set(instance.CHANMODES.keys()) == set(\"ABCD\")` as suggested.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}]
null
sopel-irc__sopel__2027
sopel-irc/sopel
2,027
defect
f4d4724c51692027dcd2d57a56cdc66e6b8679c6
68302b7c87b27c415a0d5523f58d51161a053153
tools, loader, plugins.rules: deprecate compile_rule
### Description See #1887. This is only a draft, because it introduces a major change in `loader.clean_callable`: since `compile_rule` becomes deprecated, it is not used anymore by `loader.clean_callable`. It means that this function doesn't compile patterns anymore. So, even though it doesn't change *anything* f...
diff --git a/sopel/loader.py b/sopel/loader.py index dad4e624a3..66677cea44 100644 --- a/sopel/loader.py +++ b/sopel/loader.py @@ -16,7 +16,7 @@ import sys from sopel.config.core_section import COMMAND_DEFAULT_HELP_PREFIX -from sopel.tools import compile_rule, itervalues +from sopel.tools import itervalues if ...
1
1
0
[{"id": "G0", "claim": "The rule-as-string compatibility branch deserves a comment explaining that it exists only to stay compatible with old Phenny/Jenni modules that set the attribute directly, as suggested.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
sopel-irc__sopel__2056
sopel-irc/sopel
2,056
defect
8dbce960d1ef1f65b2c1560cbd4fa8d6f5aa1361
b1c1234ea459eaba83744ff894b334acc2f9e4aa
find_updates, test: create test to verify error case behavior
### Description Validates the behavior fixed in #2052. ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sopel-irc/sopel/blob/master/CONTRIBUTING.md) - [x] I can and do license this contribution under the EFLv2 - [x] No issues are reported by `make qa` (runs `make quality` and `make test`) ...
diff --git a/dev-requirements.txt b/dev-requirements.txt index 9d7a0e87fc..040498334e 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -12,6 +12,7 @@ pytest-vcr==1.0.2; python_version != '3.3' pytest-vcr==0.3.0; python_version == '3.3' PyYAML<5.1; python_version == '3.3' PyYAML<5.3; python_version == ...
1
1
1
[{"id": "G0", "claim": "The new TMP_CONFIG template has every line indented, which makes Python 2.7 complain, and it should be dedented as in the suggested block.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}]
null
sopel-irc__sopel__2067
sopel-irc/sopel
2,067
defect
6c142b13723289680b332f4f316fff63bfacf915
a47b9437373919b38c490588453dfffe26ecd37d
docs: plugin tests & minor improvement
### Description After discussing #2065 it appears that "how to test a plugin" isn't well documented, so here is a PR for that. I think there are more that can be written, in particular about factories and how to use them. I also added a convenient method to clear `backend.message_sent`, so you don't have to do...
diff --git a/docs/source/plugin.rst b/docs/source/plugin.rst index 17fe507065..09503ce387 100644 --- a/docs/source/plugin.rst +++ b/docs/source/plugin.rst @@ -9,6 +9,7 @@ Plugins: Developer Overview plugin/anatomy plugin/bot plugin/decorators + plugin/test plugin/advanced plugin/internals diff -...
15
15
0
[{"id": "G0", "claim": "The sentence should read \"To help automate testing\" instead of \"To automate testing\".", "category": "documentation", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The stray space before the comma after the :mod: cross-reference should be dropped and...
null
sopel-irc__sopel__2097
sopel-irc/sopel
2,097
defect
e2d8439caae33ed3dfe08f0c164d1e8323fd6f7d
2ed51ec48a6e46f66ac1831a4ac520c41970e4b0
coretasks: Strip Unreal's extra empty MODE arg
### Description Reduce "possibly malformed MODE" logspam, and warn with useful info if we still have extra args. I can't think of a case where we would need a legitimate empty arg, and the continued presence of the previous comments seems to agree, so... Let's just assume a trailing space is a meaningless trailing ...
diff --git a/sopel/coretasks.py b/sopel/coretasks.py index 5fe5d026ff..5bca6af3af 100644 --- a/sopel/coretasks.py +++ b/sopel/coretasks.py @@ -496,6 +496,11 @@ def _parse_modes(bot, args): return channel = bot.channels[channel_name] + + # Unreal sometimes sends an extraneous trailing space. If we're ...
4
4
2
[{"id": "G0", "claim": "The comment about re-implementing empty-arg checks should be reworded, since this change is itself doing that for a non-compliant IRCd.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "The warning message uses %s where it s...
null
sopel-irc__sopel__2098
sopel-irc/sopel
2,098
defect
e2d8439caae33ed3dfe08f0c164d1e8323fd6f7d
92ad9c435c6bd76cb7d6ff4343795f638e87efef
coretasks: Clear prior modes on RPL_CHANNELMODEIS
### Description RPL_CHANNELMODEIS should contain all channel modes, and we sometimes use `MODE {channel}` to sync, so we should discard our old knowledge of the modes when we get the response. ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sopel-irc/sopel/blob/master/CONTRIBUTING.md) - [x] I...
diff --git a/sopel/coretasks.py b/sopel/coretasks.py index 5fe5d026ff..ae32fc6bf3 100644 --- a/sopel/coretasks.py +++ b/sopel/coretasks.py @@ -483,11 +483,10 @@ def track_modes(bot, trigger): @module.unblockable def initial_modes(bot, trigger): """Populate channel modes from response to MODE request sent after J...
4
2
0
[{"id": "G0", "claim": "The new test should use a template string for the RPL_CHANNELMODEIS message instead of mutating the list by index (rpl_channelmodeis[4] = \"+kl\"), and should put the IRC setup before the messages under test, for readability.", "category": "maintainability", "verdict": "supported", "priority": "...
null
sopel-irc__sopel__2099
sopel-irc/sopel
2,099
defect
e2d8439caae33ed3dfe08f0c164d1e8323fd6f7d
894252ff4b14b63d982ff21d8b587653e85d160b
bot: `trigger.time` is now offset-aware; ignore replayed messages on channel join
### Description Helps avoid #1810 for servers with `server-time` cap I have no idea how to go about writing tests for this, but it works for me ™ Should it log when it ignores a message? On one hand, silently ignoring things is weird. On the other, that would get spammy fast. ### Checklist - [x] I have read [C...
diff --git a/sopel/bot.py b/sopel/bot.py index f5d4ebfc9f..2c6879e7fb 100644 --- a/sopel/bot.py +++ b/sopel/bot.py @@ -898,6 +898,15 @@ def dispatch(self, pretrigger): user_obj = self.users.get(nick) account = user_obj.account if user_obj else None + if "time" in pretrigger.tags and pretrigge...
4
3
1
[{"id": "G0", "claim": "The docstring of the new Channel.join_time attribute should state what it holds when the server-time IRCv3 capability is not available (the suggestion: that it will be None in that case).", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1"...
null
sopel-irc__sopel__2116
sopel-irc/sopel
2,116
defect
0ee597403e4e3d2b4e8a054533873b02c111b273
c5c91040feb673b6f21895d6081b8a256eef4791
coretasks, test: support CHGHOST command/capability
### Description Reduces churn in `bot.users` and `bot.channels` on networks that support the `chghost` CAP, since they send a flood of QUIT, JOIN, and MODE lines to connected clients without `chghost` support in order to emulate the CHGHOST behavior. Checks another box in #971. Also fixes a likely typo in a nearb...
diff --git a/sopel/coretasks.py b/sopel/coretasks.py index 979d42c8a0..6f70cf1b89 100644 --- a/sopel/coretasks.py +++ b/sopel/coretasks.py @@ -916,6 +916,7 @@ def receive_cap_ls_reply(bot, trigger): 'echo-message', 'multi-prefix', 'away-notify', + 'chghost', 'cap-notify', ...
1
1
0
[{"id": "G0", "claim": "The new CHGHOST handler should use `plugin.event` instead of the backward-compatibility `module.event` alias, since Sopel 8 should always use `plugin`.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
sopel-irc__sopel__2118
sopel-irc/sopel
2,118
defect
0ee597403e4e3d2b4e8a054533873b02c111b273
977ee98b9d636645ea5edba8d62ab9e55af75435
cli: remove legacy mode for run script
### Description Fix #1584 by removing the legacy parser completely, fixing the doc and the help message. Options are no longer available without a subcommands, which is a breaking change. However, it makes everything else better (the doc, the usage, the code etc.) and it's Sopel 8 and it's the right way to do a com...
diff --git a/sopel/cli/run.py b/sopel/cli/run.py index 3c47251711..944af58507 100755 --- a/sopel/cli/run.py +++ b/sopel/cli/run.py @@ -118,77 +118,17 @@ def run(settings, pid_file, daemon=False): os._exit(0) -def add_legacy_options(parser): - """Add legacy options to the argument parser. - - :param parse...
2
2
2
[{"id": "G0", "claim": "Bare `sopel` with no sub-command (and option-only invocations) should default to the `start` action, keeping `sopel start` as the default behavior as the old TODO planned, instead of the None default that leaves bare invocations printing usage.", "category": "correctness", "verdict": "supported"...
null
sopel-irc__sopel__2121
sopel-irc/sopel
2,121
defect
8ba105881dc5755a519d691ebffeb8e32a1e5484
6c942b4a21f99031e3f724a6fa15e5b90efd39b1
bot: remove `bot.memory['url_callbacks']` and use internal state
### Description Plugins doing this will receive warnings through the entire remaining lifetime of 7.x (at least several months, perhaps up to a year-ish), and it's high time to push plugin devs away from using anything but the `plugin.url` and `plugin.url_lazy` decorators. As pointed out in a comment below, also de...
diff --git a/sopel/bot.py b/sopel/bot.py index dea31b6b5c..3764508158 100644 --- a/sopel/bot.py +++ b/sopel/bot.py @@ -53,6 +53,15 @@ def __init__(self, config, daemon=False): self._rules_manager = plugin_rules.Manager() self._scheduler = plugin_jobs.Scheduler(self) + self._url_callbacks = to...
1
1
0
[{"id": "G0", "claim": "The search_url_callbacks() method should be deprecated and removed in Sopel 9, like the other URL-callback methods (register_url_callback and unregister_url_callback).", "category": "design", "verdict": "supported", "priority": "P1", "scope": "pre_existing"}]
null
sopel-irc__sopel__2216
sopel-irc/sopel
2,216
defect
b1fed8837726cecf2cc150abfed4e32b56bdad45
7af388922b628dcd378f4a2ea44248a5a9c78616
reddit, test: even more of the comments link format is optional
### Description Reddit will accept `/r/subreddit/comments/id`, `/comments/id`, or even just `/id`... The variations never end. Follow-up to #2208. After merging I found some further tweaks that hadn't been pushed up yet, probably because of #2210. Could use input from @half-duplex, the person who pointed out these ...
diff --git a/sopel/modules/reddit.py b/sopel/modules/reddit.py index 68a7d42036..5ae05b690b 100644 --- a/sopel/modules/reddit.py +++ b/sopel/modules/reddit.py @@ -29,7 +29,7 @@ subreddit_url = r'%s/r/([\w-]+)/?$' % domain post_or_comment_url = ( domain + - r'/r/\S+?/comments/(?P<submission>[\w-]+)' + r'(?:...
1
1
1
[{"id": "G0", "claim": "The reddit URL tests should verify which reddit rule (e.g. image_info or video_info) is actually called, rather than only asserting that exactly one reddit rule matched.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
sopel-irc__sopel__2236
sopel-irc/sopel
2,236
defect
c37f62b494407cfd2d28e7e938bd072e51e4da03
bb5acb5ca42ee10b0ec80dea46d9ac0bed219dfc
irc: implement CHANTYPES parameter for ISUPPORT
### Description Tin. This is based on #2231 which made it very easy to do: all commits are squashed into one that must be removed once that PR is merged. ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sopel-irc/sopel/blob/master/CONTRIBUTING.md) - [x] I can and do license this contrib...
diff --git a/docs/source/api.rst b/docs/source/api.rst index d95d7f8c1b..737085c21a 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -10,7 +10,14 @@ sopel.tools .. automodule:: sopel.tools :members: :exclude-members: iteritems, iterkeys, itervalues, raw_input - :private-members: Identifier._lowe...
6
6
0
[{"id": "G0", "claim": "It is probably best to call bot.rebuild_nick() only once, since CASEMAPPING and CHANTYPES are likely to be sent in the same 005 line.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Prefer passing a default to .get() over usin...
null
sopel-irc__sopel__2237
sopel-irc/sopel
2,237
defect
3db0992f262b462a21a08863cab49a05d1ad75c1
2a06736db998fceebb4615925301c62d99c99fa5
tools: move memory classes to tools.memories
### Description And also uses `SopelIdentifierMemory` into `target.Channel`. Based on #2236 (chekc only the last two commits). ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sopel-irc/sopel/blob/master/CONTRIBUTING.md) - [x] I can and do license this contribution under the EFLv2 - [...
diff --git a/docs/source/api.rst b/docs/source/api.rst index 737085c21a..c8d7dd7abb 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -18,6 +18,11 @@ sopel.tools.identifiers .. automodule:: sopel.tools.identifiers :members: +sopel.tools.memories +-------------------- + +.. automodule:: sopel.tools.me...
5
5
0
[{"id": "G0", "claim": "The new module docstring should read \"classes that are thread-safe, with some convenience features.\" instead of the awkward \"with some added feature\".", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "SopelMemory's docstri...
null
sopel-irc__sopel__2244
sopel-irc/sopel
2,244
defect
3db0992f262b462a21a08863cab49a05d1ad75c1
82129c2b8f04f413d7130e32608a671353848584
loader, plugin, plugins.rules: add `allow_bots` decorator
### Description You know, it's fun when you find an unmerged branch hanging around during a local cleanup. It needs rebasing, which I'll handle in a moment, but it will fill a gap in the plugin decorator library. After #2089 we're missing a way for plugin authors to opt back into getting messages from other bots. M...
diff --git a/docs/source/plugin/anatomy.rst b/docs/source/plugin/anatomy.rst index 09186d652f..8828821f9c 100644 --- a/docs/source/plugin/anatomy.rst +++ b/docs/source/plugin/anatomy.rst @@ -124,6 +124,32 @@ Example:: A rule with rate-limiting can return :const:`sopel.plugin.NOLIMIT` to let the user try again after a...
2
2
0
[{"id": "G0", "claim": "The documentation should describe non-rule (\"filter\") decorators such as `echo` and the new `allow_bots`, updating the existing docs section if one exists or noting that a future PR will be needed.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"},...
null
sopel-irc__sopel__2253
sopel-irc/sopel
2,253
defect
365cad7d128b31b97c463445b1853de82c6c3f84
404bcc8a9e0a018615bdfb371ff8a5ff5a615d65
loader, rules: use (pre)trigger.ctcp instead of tags
### Description Sopel 8's steps of #1683: * replace `trigger.tags['intent']` by `trigger.ctcp` (same for `PreTrigger`) * replace `plugin_callable.intents` by `plugin_callable.ctcp` * replace `AbstractRule.match_intent` by `AbstractRule.match_ctcp` * update tests and documentation accordingly * add various typ...
diff --git a/sopel/loader.py b/sopel/loader.py index dd6a070697..283e3628f0 100644 --- a/sopel/loader.py +++ b/sopel/loader.py @@ -85,14 +85,14 @@ def clean_callable(func, config): for command in cmds: func._docs[command] = (doc, examples) - if hasattr(func, 'intents'): + if hasatt...
3
3
0
[{"id": "G0", "claim": "Rewrap the `is_triggerable` docstring paragraph in sopel/loader.py so its lines stay at 72 columns or less instead of the one 79-column line.", "category": "style", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Make the CTCP match check explicit with `i...
null
sopel-irc__sopel__2261
sopel-irc/sopel
2,261
defect
b1e875300340f74a68774256f6c829afa35013b6
6b15c3d4f660d9e69e4c3b2cafde187c3b119aa0
core: replace `pkg_resources` with `importlib.metadata`
### Description Tin. Performance of `pkg_resources` can be quite slow (just search all of GitHub issues for "pkg_resources slow"); [its use is discouraged](https://setuptools.pypa.io/en/latest/pkg_resources.html) by the `setuptools` project itself, in favor of the newer modules such as `importlib.metadata`. Needs a...
diff --git a/requirements.txt b/requirements.txt index 9937ec9c3b..f2492374ae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,5 @@ geoip2>=4.0,<5.0 requests>=2.24.0,<3.0.0 dnspython<3.0 sqlalchemy>=1.4,<1.5 +importlib_metadata>=3.6; python_version < '3.10' +packaging diff --git a/sopel/__init__.py b/...
2
2
0
[{"id": "G0", "claim": "The EntryPointPlugin docstring still calls the entry point a '``setuptools`` entry point object' even though the pull request now uses importlib_metadata, so the docstring above needs adapting to the generic entry-point terminology.", "category": "documentation", "verdict": "supported", "priorit...
null
sopel-irc__sopel__2285
sopel-irc/sopel
2,285
defect
17bb5b9f1ba2f8d45be537977fd80e6349a251e7
2743253fdd113cc3dbb18194c2bd84400c22538c
url: improve private IP protection
### Description Atop #2282 Fixes #2284 Draft implementation should resolve #2348. - [x] Document TOCTOU ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sopel-irc/sopel/blob/master/CONTRIBUTING.md) - [x] I can and do license this contribution under the EFLv2 - [x] No issues are reporte...
diff --git a/requirements.txt b/requirements.txt index 1e8559009d..9ed465f04f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,6 @@ pytz praw>=4.0.0,<6.0.0 geoip2>=4.0,<5.0 requests>=2.24.0,<3.0.0 -dnspython<3.0 sqlalchemy>=1.4,<1.5 importlib_metadata>=3.6 packaging diff --git a/sopel/modules/url.p...
7
6
3
[{"id": "G0", "claim": "find_title should take explicit unsafe_urls and unsafe_domains parameters instead of a SopelMemory/bot.memory argument, so the bot's memory does not have to be passed around.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The meth...
null
sopel-irc__sopel__2299
sopel-irc/sopel
2,299
defect
df465a7751bbc312f76bd9006dac8840528542e7
32a9fd92b4bf13e8f9dcec7e8119ecd588421b0d
cli: look harder for $PWD/cfg, don't automatically start wizard
Github won't let me reopen #2093. +`Bugfix` because it now prints the .cfg path instead of ".sopel/foo" ### Description This fixes two annoyances: - Sopel automatically adds `.cfg` when searching the config dir, but it doesn't when searching the current working directory - If the config file is not found, it cur...
diff --git a/sopel/cli/run.py b/sopel/cli/run.py index 80687ad1ef..848ac57e4c 100755 --- a/sopel/cli/run.py +++ b/sopel/cli/run.py @@ -255,11 +255,13 @@ def get_configuration(options): try: settings = utils.load_settings(options) except config.ConfigurationNotFound as error: - print( - ...
6
4
3
[{"id": "G0", "claim": "Build the ConfigurationError message with % formatting (or .format()) instead of concatenating str(error) with extra parentheses.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The find_config docstring example is outdate...
null
sopel-irc__sopel__2320
sopel-irc/sopel
2,320
defect
5c4f56e505442031bea4affaa00cae722b61111d
04892942d583c22c1cb63caba3a683e0f74738f9
irc: configure anti-looping system
### Description Tin, fix #1618. The feature was surprisingly easy to implement, this is a draft because I want to make sure I've the right names before writing more documentation. ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sopel-irc/sopel/blob/master/CONTRIBUTING.md) - [x] I can a...
diff --git a/sopel/config/core_section.py b/sopel/config/core_section.py index 998b8a65a7..b969b4ce2d 100644 --- a/sopel/config/core_section.py +++ b/sopel/config/core_section.py @@ -133,6 +133,58 @@ class CoreSection(StaticSection): :func:`~sopel.plugin.nickname_command`. """ + anti_looping = ValidatedA...
8
6
3
[{"id": "G0", "claim": "The anti-looping timeframe documentation needs to mention a unit (seconds) when the docs are fleshed out.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The anti-looping options should use an antiloop_ prefix (antiloop_thre...
null
sopel-irc__sopel__2328
sopel-irc/sopel
2,328
defect
55c78a49b30772105229be3db6a0b3f18eb302e7
d201c51d7b622a8349a6d958e2dcaba3abbbc351
ci, packaging, meta: modernize Python packaging for Sopel
### Description After hours of reading various documentations (mostly: the [packaging user guide](https://packaging.python.org/en/latest/) and [setuptools guide for pyproject.toml](https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html)), I think I end up with a pretty good understanding of the topic m...
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff2220d4b9..9a50527c7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,19 +24,19 @@ jobs: - 3.8 - 3.9 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: ...
22
18
0
[{"id": "G0", "claim": "The new CONTRIBUTING.md text uses the British spelling 'favourite' while the docs consistently use American spellings, so it should read 'favorite'.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The virtualenv bullet shoul...
null
sopel-irc__sopel__2329
sopel-irc/sopel
2,329
defect
71380df85212747a6c02d8c37c9ffb7836001278
a4ec35e2f33264e72ab1cb622bd3e875a24adb03
loader, plugin: remove deprecated features
### Description Tin. Part of #2120: * some internal flags about example * remove support for regex in command name I didn't touch the currency plugin, will do in another PR. ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sopel-irc/sopel/blob/master/CONTRIBUTING.md) - [x] I can and...
diff --git a/sopel/loader.py b/sopel/loader.py index 77304c6752..cc7a17715d 100644 --- a/sopel/loader.py +++ b/sopel/loader.py @@ -74,8 +74,13 @@ def clean_callable(func, config): if any(hasattr(func, attr) for attr in ['commands', 'nickname_commands', 'action_commands']): if hasattr(func, 'example'): -...
8
7
0
[{"id": "G0", "claim": "Rewrapping the examples comprehension makes GitHub fail to highlight the actually-changed bit (if rec[\"help\"] -> if rec[\"is_help\"]).", "category": "maintainability", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "Remove the escape_name helper and cal...
null
sopel-irc__sopel__2359
sopel-irc/sopel
2,359
defect
13ea685cddf489328ed51d50ce282ec5a8445037
4e7ab24f35d828c933dfc06a2a7b36e17b83d982
trigger: Make `sender` property more consistent
### Description Short sleep does not make me a great comprehensive reader of specs, but commands that are 1) sent from the server to a client and 2) include a <target> (channel/nick), are actually quite rare. The IRC protocol is mostly numeric replies, and very few event types actually refer to a user (nick) or channe...
diff --git a/docs/source/package/trigger.rst b/docs/source/package/trigger.rst index 86002d0e1d..50f83c68ec 100644 --- a/docs/source/package/trigger.rst +++ b/docs/source/package/trigger.rst @@ -4,3 +4,8 @@ Triggers .. automodule:: sopel.trigger :members: + +Command context +--------------- + +.. autodata:: sop...
2
2
0
[{"id": "G0", "claim": "COMMANDS_WITH_CONTEXT should be a set/frozenset instead of a list, since membership tests against it are the typical operation and a set would be roughly 4x faster.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The TODO BUG ...
null
sopel-irc__sopel__2365
sopel-irc/sopel
2,365
defect
9014653601135513b2a7b6bb4d55799629b79445
024b8a865facaae37645a73fb6af65ecb444b391
backends: try only utf8 when UTF8ONLY
### Description When UTF8ONLY is active, raise a decoding error if the message fails to decode instead of attempting other encodings. As far as I can tell, Sopel never sends non-utf8 data unless someone's poking at the backend directly, so no other changes should be necessary to consider UTF8ONLY supported. (Actual...
diff --git a/sopel/irc/abstract_backends.py b/sopel/irc/abstract_backends.py index 2cf7c87506..2e348f6fcc 100644 --- a/sopel/irc/abstract_backends.py +++ b/sopel/irc/abstract_backends.py @@ -67,16 +67,15 @@ def decode_line(self, line: bytes) -> str: # We can't trust clients to pass valid Unicode. try:...
3
2
1
[{"id": "G0", "claim": "There is no test case with invalid input that fails both UTF-8 and CP-1252 decoding to exercise the final `raise ValueError('Unable to decode data from server.')`, which this PR makes reachable by removing the iso8859-1 fallback.", "category": "testing", "verdict": "supported", "priority": "P1",...
null
sopel-irc__sopel__2366
sopel-irc/sopel
2,366
defect
f738ad9328a5d5e84580e7e869cb4a7f83aba396
d986a7431cc643d9f0825a33b3b68902cd3c89f6
formatting: fix `color('some text', 0)`
### Description A literal `0` (nominally the color white, in mIRC convention) evaluates as `False`, which was being skipped by the `not` and making the function return its input text unchanged. Regression check added to existing `test_color()` case. ### Checklist - [x] I have read [CONTRIBUTING.md](https://gith...
diff --git a/sopel/formatting.py b/sopel/formatting.py index aa8d4ab731..ff8ffcf253 100644 --- a/sopel/formatting.py +++ b/sopel/formatting.py @@ -197,7 +197,7 @@ def color(text, fg=None, bg=None): 0-99. The known color names can be found in the :class:`colors` class of this module. """ - if not fg an...
1
1
1
[{"id": "G0", "claim": "Add tests that color() raises ValueError when the foreground or background color is an empty string (including mixed empty/non-empty pairs), as spelled out in the suggestion block.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null
sopel-irc__sopel__2369
sopel-irc/sopel
2,369
defect
b6d1e9d19769edc891f905290231d6b17d55035d
56423a1e27f76d9182d2de588e2fe9237691b165
backends: fix event loop close on invalid utf8 rx
### Description Upon receiving a line that isn't valid unicode, decode_line raises an exception which isn't caught and kills the event loop. I broke this in #2365 by confusing what class I was in and which contained .isupport, and trusting the (also by me, also incorrect) unit tests... Sorry >.> ### Checklist -...
diff --git a/sopel/coretasks.py b/sopel/coretasks.py index 621e8fb65f..401e1fd6ef 100644 --- a/sopel/coretasks.py +++ b/sopel/coretasks.py @@ -331,6 +331,10 @@ def handle_isupport(bot, trigger): bot._isupport = bot._isupport.apply(**parameters) + # update backend's utf8only setting + if 'UTF8ONLY' in bot...
2
2
1
[{"id": "G0", "claim": "The `utf8only` flag should be initialized with the other instance values inside `__init__` instead of as a class attribute (and the blank line right after the docstring removed).", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "clai...
null
sopel-irc__sopel__2370
sopel-irc/sopel
2,370
defect
53c5543d15a73aaba904ee5093212a575b3b6cf9
9c2f95ceb06c3c4a541450b28b8977d4ebabf2d9
trigger, irc: use STATUSMSG to handle status specific messages in channels
### Description Fix #1886. In this PR, I modified `PreTrigger` to parse the `sender` to check if the prefix was a `STATUSMSG` prefix, i.e. a message intended to a specific privilege level in the channel (such as ops, voice, etc.). Once this is done, the `PreTrigger` remove that prefix from the `sender` to create ...
diff --git a/sopel/irc/__init__.py b/sopel/irc/__init__.py index 6c87e7996e..5e08a1636b 100644 --- a/sopel/irc/__init__.py +++ b/sopel/irc/__init__.py @@ -309,6 +309,7 @@ def on_message(self, message: str) -> None: message, url_schemes=self.settings.core.auto_url_schemes, identifi...
4
4
1
[{"id": "G0", "claim": "The new code should pass `statusmsg_prefixes=self.isupport.get('STATUSMSG')` via the public `isupport` property rather than the private `_isupport` attribute at both call sites in sopel/irc/__init__.py, as previously existing uses of ISUPPORT data in that file use the property.", "category": "de...
null
sopel-irc__sopel__2371
sopel-irc/sopel
2,371
defect
53c5543d15a73aaba904ee5093212a575b3b6cf9
88750f3de79240f134941e971ae53ba1c825b849
config: strip quotes from FilenameAttribute
### Description Fix #2263. That was way easier than I expected. ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sopel-irc/sopel/blob/master/CONTRIBUTING.md) - [x] I can and do license this contribution under the EFLv2 - [x] No issues are reported by `make qa` (runs `make quality` and `ma...
diff --git a/sopel/config/types.py b/sopel/config/types.py index d84367911a..e2d3b41b84 100644 --- a/sopel/config/types.py +++ b/sopel/config/types.py @@ -696,6 +696,9 @@ def _parse(self, value, settings, section): if not value: return self.parse(value) + if value.startswith('"') or value...
2
2
2
[{"id": "G0", "claim": "The condition should be `and` instead of `or`, so quotes are stripped only when the value is quoted at both ends, not when a quote appears at just one end.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "FilenameAttribute shou...
null
sopel-irc__sopel__2429
sopel-irc/sopel
2,429
defect
1fe5e2ff283a76a8ea7f97dbdb078911cef08fc8
4b23ac90c742c127652ac80a22382ad99d4fc4be
irc: unescape hexadecimal sequences in ISUPPORT parameter values
### Description This changeset handles hexadecimal escape sequences in `ISUPPORT` parameter values, implementing #2195 ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sopel-irc/sopel/blob/master/CONTRIBUTING.md) - [x] I can and do license this contribution under the EFLv2 - [x] No issues a...
diff --git a/sopel/irc/isupport.py b/sopel/irc/isupport.py index 094ed7fd9d..8445be2da8 100644 --- a/sopel/irc/isupport.py +++ b/sopel/irc/isupport.py @@ -131,10 +131,38 @@ def _parse_prefix(value): } +def _hex_unescape(param): + """ + Unescape hexadecimal escape sequences (i.e. ``'\\xHH'``) + + Sopel fol...
6
4
1
[{"id": "G0", "claim": "The specification says a server that has not advertised CHARSET must not use escape sequences outside the permitted grammar (except \\x20), Sopel does not currently check this, and if we want to worry about it the check should probably be part of this changeset.", "category": "correctness", "ver...
null
sopel-irc__sopel__2434
sopel-irc/sopel
2,434
defect
799eb63ae1cbf14bc81b55383809c14b57f27a11
ee4ffb4d7d9582f2ca8252451fe4064a47045892
Add more placeholders to rate-limit messages, move template interpolation from `Rule` to `Sopel`
### Description Fix #2325. This changeset includes: - [x] plumbing changes in data flow about rate-limiting between `Sopel` and `Rule` - [x] new template fields for rate limit messages - unless somebody has suggestions for more fields, I'm considering this complete --- ### Checklist - [x] I ha...
diff --git a/sopel/bot.py b/sopel/bot.py index 5354602b14..6e98893992 100644 --- a/sopel/bot.py +++ b/sopel/bot.py @@ -604,25 +604,11 @@ def call_rule( context = trigger.sender is_channel = context and not context.is_nick() - # rate limiting - if not trigger.admin and not rule.is_unblo...
8
7
3
[{"id": "G0", "claim": "If the get_*_rate_message getters are not public API that we want to preserve, their logic can be moved into rate_limit_info.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The business of the is_*_rate_limited() methods might als...
null
sopel-irc__sopel__2448
sopel-irc/sopel
2,448
defect
e5bcd1fbfbc781eee990b47c0236f0772ba13124
7c6de702a5ecf0f896f569949425df02c0d5022e
core: better bot-mode handling
### Description Sending mode `+B` by default is pretty silly. As of #2088 we should have stopped doing so. Now we will. More importantly, WHO replies contain a bot flag on servers that support the bot-mode spec; it's indicated by the same character as the modechar advertised in ISupport's `BOT` token. We should tra...
diff --git a/sopel/config/core_section.py b/sopel/config/core_section.py index 80d63a6fbe..9391a2ea2b 100644 --- a/sopel/config/core_section.py +++ b/sopel/config/core_section.py @@ -949,11 +949,9 @@ def homedir(self): """ - modes = ValidatedAttribute('modes', default='B') + modes = ValidatedAttribute('m...
4
4
1
[{"id": "G0", "claim": "The pull request should keep `User.__init__`'s `user` and `host` parameters annotated as `Optional[str]`, since there are use-cases that create an empty shell of a user without those values.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "c...
null
sopel-irc__sopel__2500
sopel-irc/sopel
2,500
defect
271b306ac328ccea32da333787c00b739021bb39
f675d27629d350442cc5816609ddb6f069799fbd
build, meta: drop Python 3.7 support, checks, and CI job
### Description This fulfills the last "Finally letting the dead snakes lie." part of [the 8.0.0 milestone](https://github.com/sopel-irc/sopel/milestone/15)'s description. Python 3.7 was officially EOL'd as of a month ago, on June 27. ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sopel-irc/s...
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a530ca9db..4add455028 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,6 @@ jobs: strategy: matrix: python-version: - - "3.7" - "3.8" - "3.9" - "3.10" d...
7
6
1
[{"id": "G0", "claim": "The latest pyflakes (3.1.0+) raises F811 \"Redefinition of unused name\" for the `execute_handler` def in URLCallback.from_callable, so the code needs to be restructured (e.g. with if/else) to satisfy the linter.", "category": "tooling", "verdict": "supported", "priority": "P1", "scope": "pre_ex...
null
sopel-irc__sopel__2543
sopel-irc/sopel
2,543
defect
b2e4cde47b592d60e801088c07e170a0db7fb96d
bbaafc6d7884800b7b9eb6a01b0117d4213c40ff
tools, tools.calculation: docs/type-hint improvements, API fixes, better test coverage
### Description This starts with some tweaks to the docstring data in `tools` (`.. versionadded::` kinda stuff) and `tools.calculation` that I found sitting in a forgotten branch; apparently those smaller tweaks never reached the point of a full PR. That stalled work's finally done: `sopel/tools/calculation.py` i...
diff --git a/docs/source/package/tools/calculation.rst b/docs/source/package/tools/calculation.rst index 0bd2392a86..87ac1e085b 100644 --- a/docs/source/package/tools/calculation.rst +++ b/docs/source/package/tools/calculation.rst @@ -4,3 +4,4 @@ sopel.tools.calculation .. automodule:: sopel.tools.calculation :m...
2
2
0
[{"id": "G0", "claim": "Annotate guarded_pow's num and exp parameters as plain `float` instead of `Union[int, float]`, since PEP 484 explicitly allows int where float is annotated (or, if the Union is genuinely needed, add a comment explaining why).", "category": "maintainability", "verdict": "supported", "priority": "...
null
sopel-irc__sopel__2545
sopel-irc/sopel
2,545
defect
3b91a767b022b1a83a7b3feb5b1f8f3305775a7a
9e45e9a896a4f737485248aab314d88b83f670c8
plugins: avoid crash on broken symlink
### Description This changeset adds a check that a plugin file actually exists on disk before it is added to the list of known plugins. Closes #2269. ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sopel-irc/sopel/blob/master/CONTRIBUTING.md) - [x] I can and do license this contributio...
diff --git a/sopel/plugins/__init__.py b/sopel/plugins/__init__.py index bf1745c462..663404d3c6 100644 --- a/sopel/plugins/__init__.py +++ b/sopel/plugins/__init__.py @@ -31,7 +31,9 @@ import collections import importlib import itertools +import logging import os +from typing import TYPE_CHECKING # TODO: use std...
1
1
0
[{"id": "G0", "claim": "The new annotation on _list_plugin_filenames should use Union instead of | syntax, since the codebase currently uses Union everywhere else for this kind of annotation.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}]
null
sopel-irc__sopel__2552
sopel-irc/sopel
2,552
defect
d212dd10e905fc2d90e5cf8284c24a7bbd270859
46977b61cd00c9112e12e6927fb31d1ab2215319
irc, bot, builtins: add & use `AbstractBot.make_identifier_memory()` helper
### Description Here is a shortcut way of getting a new `SopelIdentifierMemory` with the `identifier_factory` kwarg filled in for you so it automatically uses the bot's awareness of casemapping from the IRC server's ISUPPORT tokens. Manual casemapping selection is still possible by using the `SopelIdentifierMemor...
diff --git a/sopel/bot.py b/sopel/bot.py index f7747aa980..9fb57cbae6 100644 --- a/sopel/bot.py +++ b/sopel/bot.py @@ -75,9 +75,7 @@ def __init__(self, config, daemon=False): self.modeparser = modes.ModeParser() """A mode parser used to parse ``MODE`` messages and modestrings.""" - self.chann...
2
1
1
[{"id": "G0", "claim": "The PR would be better with at least one automated test for the new `make_identifier_memory()` helper (e.g. in `test/test_coretasks.py`, following the ideas of the `test_handle_issuport_casemapping` test), because the method needs direct invocation in the test suite so it stays covered even if i...
null
sopel-irc__sopel__2561
sopel-irc/sopel
2,561
defect
51300a1ab854d6ec82d90df1bc876188c03335ff
cd904a9127f919c6bf45dafbb1aa4b657816ab16
coretasks: fix SASL EXTERNAL without password set
### Description Fix #2560, now separate and with test (verified to fail without patch) ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sopel-irc/sopel/blob/master/CONTRIBUTING.md) - [x] I can and do license this contribution under the EFLv2 - [x] No issues are reported by `make qa` (runs...
diff --git a/sopel/coretasks.py b/sopel/coretasks.py index 45e935154a..7559517bef 100644 --- a/sopel/coretasks.py +++ b/sopel/coretasks.py @@ -107,9 +107,9 @@ def _handle_sasl_capability( ) return plugin.CapabilityNegotiation.ERROR - # Check SASL configuration (password is required) + # Check ...
6
6
2
[{"id": "G0", "claim": "The SASL EXTERNAL no-password test should, like the SASL PLAIN test, feed the server's authentication-success messages (900/903) and assert that the bot then replies with CAP END.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Th...
null
sopel-irc__sopel__2578
sopel-irc/sopel
2,578
defect
7be94c3ada89855f27c73bf9693d8755d1c604e7
17e7eec404b48b9e72b81a21e6a978aec0731adc
coretasks: support `setname` CAP / `SETNAME` command
### Description Implements [`setname`](https://ircv3.net/specs/extensions/setname) spec. `coretasks` now updates user's `realname` when receiving `SETNAME` event. Sopel does not yet have a means to change its own realname without reconnecting, but changes to the config currently require a bot restart anyway so th...
diff --git a/sopel/coretasks.py b/sopel/coretasks.py index f10ebdbe2f..df94915808 100644 --- a/sopel/coretasks.py +++ b/sopel/coretasks.py @@ -159,6 +159,7 @@ def _handle_sasl_capability( CAP_ACCOUNT_TAG = plugin.capability( 'account-tag', handler=_handle_account_and_extjoin_capabilities) CAP_SASL = plugin.capab...
3
3
0
[{"id": "G0", "claim": "The test should use the suggested \"Bot du service réseau\" SETNAME string and assertion instead of \"Bot de Network Services\", gaining non-ascii character coverage.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The silent earl...
null
sopel-irc__sopel__2580
sopel-irc/sopel
2,580
defect
120477fe28f470f9308163203c43688ff9121e12
38724276ff0fe7e498c34d95e7eb69349c6cbd5d
plugin: `require_bot_privilege()` implies `require_chanmsg()`
### Description If the bot needs a channel privilege for a given callable, it probably wants to do something related to channel operations, and triggering such a callable in response to a private message makes no sense. Sorry about trying to add something into 8.0.0 this late… I've been writing the 8.0 migration ...
diff --git a/sopel/plugin.py b/sopel/plugin.py index 1b38149cab..2f47b6889a 100644 --- a/sopel/plugin.py +++ b/sopel/plugin.py @@ -1716,16 +1716,18 @@ def require_bot_privilege( <.bot.Sopel.say>`, but when ``reply`` is ``True`` it uses :meth:`bot.reply() <.bot.Sopel.reply>` instead. - Privilege requireme...
2
1
0
[{"id": "G0", "claim": "When the guarded callable skips evaluation in a private message, it should log a message (SnoopJ suggested a warning-level LOGGER line, possibly debug instead).", "category": "maintainability", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The two rewritt...
null
sopel-irc__sopel__2589
sopel-irc/sopel
2,589
defect
973a489355540d68b95db01a49e983ac7a740bcc
580094c29625ab83f07180397bffa469dc5b54d4
find: support escaping backslash, fix double-bolding, and add basic tests
### Description Allowing `\|` or `\/` is all well and good, but if one can't escape the escape character, things get very confusing! So let's make it possible to escape `\` itself as `\\`. With the test scaffolding now written (OK, much of it stolen from the preexisting `test/builtins/test_builtins_isup.py`), it'...
diff --git a/sopel/builtins/find.py b/sopel/builtins/find.py index db6528252e..b51b3f9576 100644 --- a/sopel/builtins/find.py +++ b/sopel/builtins/find.py @@ -121,11 +121,11 @@ def kick_cleanup(bot, trigger): [:,]\s+)? # Followed by optional colon/comma and whitespace s(?P<sep>/) ...
3
3
0
[{"id": "G0", "claim": "The new tests should use the user fixture's nick (user.nick) instead of the hard-coded 'User' nick, both when joining the channel and in the expected 'meant to say' reply.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Ad...
null
sopel-irc__sopel__2594
sopel-irc/sopel
2,594
defect
973a489355540d68b95db01a49e983ac7a740bcc
9df81ff3a6cacc3d3bcf0d9e8687ed91e5c82507
Fix version check for entrypoint plugins with unequal project/package names
### Description Fixes #2593. This changeset swallows all exceptions when trying to determine the version of an `EntryPointPlugin`, as there are more failure cases than what catching `ValueError` specifically covers, and allowing those exceptions to propagate breaks plugin reloading. ### Checklist - [x] I ha...
diff --git a/sopel/plugins/handlers.py b/sopel/plugins/handlers.py index 8a07cb3ada..567c7a6348 100644 --- a/sopel/plugins/handlers.py +++ b/sopel/plugins/handlers.py @@ -618,8 +618,9 @@ def get_version(self) -> Optional[str]: ): try: version = importlib.metadata.version(self.modu...
5
5
3
[{"id": "G0", "claim": "The bare `except:` added in EntryPointPlugin.get_version() will trip the linter and catches BaseException, so it should be `except Exception:`.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The real fix is to look up the ver...
null
sopel-irc__sopel__2620
sopel-irc/sopel
2,620
defect
1c6aeb93a269a3997a9d55ec102a9ed77e393402
1cd02c470b49162b306de47729601bd21ba29c46
irc.utils, test: also remove null (\x00) in safe()
### Description Fixes #2566. In `test_irc_utils` suite, rewrote `test_safe` and `test_safe_bytes` to generate a bunch more permutations of invalid characters automatically rather than writing them all out. The horse is definitely beaten *far* past death at this point... but the tests sure are thorough(bred). A...
diff --git a/sopel/irc/utils.py b/sopel/irc/utils.py index 12ba094618..3d3bf450f1 100644 --- a/sopel/irc/utils.py +++ b/sopel/irc/utils.py @@ -25,10 +25,11 @@ def safe(string): :rtype: str :raises TypeError: when ``string`` is ``None`` - This function removes newlines from a string and always returns a u...
2
2
0
[{"id": "G0", "claim": "The for-in loops with asserts in test_safe and test_safe_bytes should be rewritten as @pytest.mark.parametrize tests instead of embedding loops and assertions in the test body.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "It ma...
null
sopel-irc__sopel__2629
sopel-irc/sopel
2,629
defect
dcb9eec34ae3a83aa1130f38f5266c7e9642c571
23d443658f36dfb8cf1184c5c1b1b107bee67c24
bot, rules: fix rate limiting rules without a rate limit
### Description Fix #2627 by checking if the rate limit is actually set (equal or less than 0s). I decided to make the `at_time` parameter mandatory, as it's all internal stuffs and it makes it clearer what time we are comparing it to. That's how I figured out that it was about the repeating call to the same rule...
diff --git a/sopel/bot.py b/sopel/bot.py index cc908f247b..bf7faeee3e 100644 --- a/sopel/bot.py +++ b/sopel/bot.py @@ -594,27 +594,26 @@ def rate_limit_info( ) -> tuple[bool, Optional[str]]: if trigger.admin or rule.is_unblockable(): return False, None - + nick = trigger.nick ...
7
5
1
[{"id": "G0", "claim": "There should be a blank line after the early-return `if` block (the usual project style) instead of the `nick = trigger.nick` line following it directly.", "category": "maintainability", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The mypy 1.12 type-c...
null
sopel-irc__sopel__2633
sopel-irc/sopel
2,633
defect
1c6aeb93a269a3997a9d55ec102a9ed77e393402
a5fd1fe60aaebc791c85f957fa34ed31e37f5f33
plugins.handlers: fix some PyFilePlugin logic errors
### Description This fixes submodule search locations for `PyFilePlugin`s, checks whether the module spec is valid _before_ adding it to `sys.modules` (instead of checking after), and adds a regression test for the submodule search location fix. Fixing `submodule_search_locations` resolves #2619. ### Checklist...
diff --git a/sopel/plugins/handlers.py b/sopel/plugins/handlers.py index 8a07cb3ada..5fc86adff6 100644 --- a/sopel/plugins/handlers.py +++ b/sopel/plugins/handlers.py @@ -471,7 +471,7 @@ def __init__(self, filename): spec = importlib.util.spec_from_file_location( name, os....
1
1
0
[{"id": "G0", "claim": "The new regression test test_folder_plugin_imports should assert a result (e.g. handler.module.foo == 'bar baz') after handler.load() instead of only loading the plugin, so it actually verifies the submodule import worked.", "category": "testing", "verdict": "supported", "priority": "P2", "scope...
null
sopel-irc__sopel__2646
sopel-irc/sopel
2,646
defect
e7d86481d186f2faafa01cc46131485d2b4966d4
d3b0cf4e288250047e7d9dd3cccd97b8470e1f38
safety: fix safeify_url() exception on python 3.11
### Description Fixes #2644, or at least makes it not an uncaught exception. ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sopel-irc/sopel/blob/master/CONTRIBUTING.md) - [x] I can and do license this contribution under the EFLv2 - [x] No issues are reported by `make qa` (runs `make lin...
diff --git a/sopel/builtins/safety.py b/sopel/builtins/safety.py index bf47e7d6fd..f126538afe 100644 --- a/sopel/builtins/safety.py +++ b/sopel/builtins/safety.py @@ -126,11 +126,16 @@ def setup(bot: Sopel) -> None: def safeify_url(url: str) -> str: """Replace bits of a URL to make it hard to browse to.""" - ...
1
1
1
[{"id": "G0", "claim": "The except block in safeify_url() should not silently swallow errors: it must not just `pass`, and it should catch only the expected exception type (e.g. ValueError) instead of a bare `except Exception`.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"...
null
sopel-irc__sopel__2650
sopel-irc/sopel
2,650
defect
da0582246612ad6fc7eabfcfd57829a617af963c
c178f45e0ec1379d19c1bb063b41ca770a8778eb
privileges, url: fix privilege check in `.urlban` command family
### Description This is a possible resolution for #2649. Maybe there's a better way to do this—maybe it would be better to just use `AccessLevel._member_names_` directly—but suggesting an alternative approach when appropriate is what code review's for, right? The commits are separated out so it'll be easy to b...
diff --git a/sopel/builtins/url.py b/sopel/builtins/url.py index 66864d2e38..d927819669 100644 --- a/sopel/builtins/url.py +++ b/sopel/builtins/url.py @@ -64,7 +64,7 @@ class UrlSection(types.StaticSection): """A list of regular expressions to match URLs for which the title should not be shown.""" exclude_req...
4
1
0
[{"id": "G0", "claim": "The new privilege test's boilerplate could be made more legible by introducing a dict (or list) mapping usernames to modes instead of parallel hard-coded lists.", "category": "maintainability", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The privileges ...
null
sopel-irc__sopel__2654
sopel-irc/sopel
2,654
defect
abe42ec9b313fed885ec349f2be424356f702ef6
72d27d859904045bc769c9d35b79208d4a80aa83
Release prep: 8.0.2
Trying out a new workflow: I've merged the changelog and backport branches for 8.0.2 into this PR, which will both run CI on the final result and allow other maintainers to give the overall patch a once-over before it gets merged for final release. If we like doing things this way, we can use it for 8.1.0—and create...
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86fa716d1f..ca61bb301a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ on: pull_request: branches: - master - - v[0-9]+.[0-9]+.x + - v?[0-9]+.[0-9]+.x jobs: tests: @@ -25,6 +25,7 ...
2
2
0
[{"id": "G0", "claim": "The CI workflow's maintenance-branch filter `v[0-9]+.[0-9]+.x` does not match the `8.0.x` branch name, so CI will not run on the final result; the `v` prefix should be made optional.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "pre_existing"}, {"id": "G1", "cl...
null
sopel-irc__sopel__2676
sopel-irc/sopel
2,676
defect
97bb97c66c1d0816054263c4ad1e05400f229782
a20a2cc199041cbed7b3ab207b00d883c796f177
coretasks: handle '*' placeholder for omitted channel in WHO/WHOX RPLs
### Description Tin. Fixes #2675. Also explicitly tests the `0` placeholder for missing account name in WHOX (regular WHO doesn't send that). We do not request the other fields that could have placeholders (`ip` and `oplevel`) in WHOX. ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sop...
diff --git a/sopel/coretasks.py b/sopel/coretasks.py index eaa1776fea..6323abd97f 100644 --- a/sopel/coretasks.py +++ b/sopel/coretasks.py @@ -1549,7 +1549,11 @@ def _record_who( } for c in modes: priv = priv | mapping[c] - if channel not in bot.channels: + + # `*` placeholder is re...
2
2
0
[{"id": "G0", "claim": "The extra pytest.raises block can be dropped and replaced with a plain lookup assertion, since the preceding check already guarantees '*' is not in mockbot.channels.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "In _reco...
null
sopel-irc__sopel__2687
sopel-irc/sopel
2,687
defect
f6b1a3b4a137ce64312dd13a154a3ed45648491f
a7c8358b8edf602aad118192b7e1dd25f6460b02
bot, coretasks, config: add `hostmask` block type
### Description What it says on the tin. Sub-task of #1355, closes #2686. **[Tests added July 5]** _Previous status:_ Beginning in draft status; while the current test suite passes, I haven't yet gone through the test cases to add any specific checks that might be warranted for this new feature. So far, I've only...
diff --git a/sopel/bot.py b/sopel/bot.py index 984c25140f..a2d9f3824b 100644 --- a/sopel/bot.py +++ b/sopel/bot.py @@ -24,7 +24,6 @@ Sequence, TYPE_CHECKING, TypeVar, - Union, ) from sopel import db, irc, logger, plugin, plugins, tools @@ -878,16 +877,18 @@ def call( def _is_pretrigger_blocke...
8
6
0
[{"id": "G0", "claim": "The return annotation `tuple[bool, bool, bool] | tuple[None, None, None]` on `_is_pretrigger_blocked` is unwieldy and could be expressed more simply, e.g. with `Sequence[bool | None]`, `tuple[bool | None]`, or per-field aliases.", "category": "maintainability", "verdict": "supported", "priority"...
null
sopel-irc__sopel__2697
sopel-irc/sopel
2,697
defect
3db48c3a9a38d89ec8551fe8da9bb9bd97a657a6
2034cc1b5c6aae293cd36f0f927135e56ab9e996
web: stricter match with URL pattern
### Description Tin, closes #2475. Since I've learn about negative lookbehind, I can't stop using them. ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/sopel-irc/sopel/blob/master/CONTRIBUTING.md) - [x] I can and do license this contribution under the EFLv2 - [x] No issues are reported b...
diff --git a/sopel/builtins/url.py b/sopel/builtins/url.py index 09fbdb97d7..1d4d3f8098 100644 --- a/sopel/builtins/url.py +++ b/sopel/builtins/url.py @@ -26,7 +26,6 @@ if TYPE_CHECKING: - from collections.abc import Generator from typing import Iterable from sopel.bot import Sopel, SopelWrapper @@ ...
1
1
1
[{"id": "G0", "claim": "The PR changed the exclusion-character lookbehind branch of search_urls' regex but added no test of that lookbehind behavior with an exclusion character.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}]
null